mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Replace macro with inline function (#7365)
This commit is contained in:
parent
6db4b972d0
commit
d902b3a844
5 changed files with 16 additions and 31 deletions
|
@ -71,4 +71,16 @@ static inline MYSQLND_CSTRING mnd_str2c(const MYSQLND_STRING str)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline void mysqlnd_set_string(MYSQLND_STRING *buf, const char *string, size_t len) {
|
||||
if (buf->s) {
|
||||
mnd_efree(buf->s);
|
||||
buf->s = NULL;
|
||||
buf->l = 0;
|
||||
}
|
||||
if (string) {
|
||||
buf->s = mnd_pestrndup(string, len, 0);
|
||||
buf->l = len;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MYSQLND_ALLOC_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue