Fix: warning: inline function 'mmc_buffer_alloc' is not defined [-Wundefined-inline] warning: inline function 'mmc_buffer_free' is not defined [-Wundefined-inline] warning: inline function 'mmc_prepare_key' is not defined [-Wundefined-inline] warning: inline function 'mmc_prepare_key_ex' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_contains' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_copy' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_free' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_pop' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_push' is not defined [-Wundefined-inline] warning: inline function 'mmc_queue_remove' is not defined [-Wundefined-inline] Includes all of: https://github.com/websupport-sk/pecl-memcache/commit/82480df30259a439a545a23daffb076a047ffc74 And part of: https://github.com/websupport-sk/pecl-memcache/commit/c051ca73ee98a4e5207799ea452470153695512f See also: https://github.com/websupport-sk/pecl-memcache/issues/63 --- memcache_pool.c.orig 2013-04-07 21:12:54.000000000 -0500 +++ memcache_pool.c 2021-12-23 07:15:27.000000000 -0600 @@ -40,7 +40,7 @@ ZEND_DECLARE_MODULE_GLOBALS(memcache) -inline void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size) /* +MMC_POOL_INLINE void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size) /* ensures space for an additional size bytes {{{ */ { register size_t newlen; @@ -48,7 +48,7 @@ } /* }}} */ -inline void mmc_buffer_free(mmc_buffer_t *buffer) /* {{{ */ +MMC_POOL_INLINE void mmc_buffer_free(mmc_buffer_t *buffer) /* {{{ */ { if (buffer->value.c != NULL) { smart_str_free(&(buffer->value)); @@ -1676,7 +1676,7 @@ } /* }}} */ -inline int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len) /* {{{ */ +MMC_POOL_INLINE int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len) /* {{{ */ { unsigned int i; if (key_len == 0) { @@ -1694,7 +1694,7 @@ } /* }}} */ -inline int mmc_prepare_key(zval *key, char *result, unsigned int *result_len) /* {{{ */ +MMC_POOL_INLINE int mmc_prepare_key(zval *key, char *result, unsigned int *result_len) /* {{{ */ { if (Z_TYPE_P(key) == IS_STRING) { return mmc_prepare_key_ex(Z_STRVAL_P(key), Z_STRLEN_P(key), result, result_len); --- memcache_pool.h.orig 2013-04-07 21:12:54.000000000 -0500 +++ memcache_pool.h 2021-12-23 07:15:30.000000000 -0600 @@ -135,8 +135,15 @@ #define mmc_buffer_release(b) memset((b), 0, sizeof(*(b))) #define mmc_buffer_reset(b) (b)->value.len = (b)->idx = 0 -inline void mmc_buffer_alloc(mmc_buffer_t *, unsigned int); -inline void mmc_buffer_free(mmc_buffer_t *); +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +/* see https://gcc.gnu.org/gcc-5/porting_to.html */ +#define MMC_POOL_INLINE extern inline +#else +#define MMC_POOL_INLINE inline +#endif + +void mmc_buffer_alloc(mmc_buffer_t *, unsigned int); +void mmc_buffer_free(mmc_buffer_t *); /* stream handlers */ typedef struct mmc_stream mmc_stream_t; @@ -391,8 +398,8 @@ double timeval_to_double(struct timeval tv); struct timeval double_to_timeval(double sec); -inline int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *); -inline int mmc_prepare_key(zval *, char *, unsigned int *); +int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *); +int mmc_prepare_key(zval *, char *, unsigned int *); #define mmc_str_left(h, n, hlen, nlen) ((hlen) >= (nlen) ? memcmp((h), (n), (nlen)) == 0 : 0) --- memcache_queue.h.orig 2013-04-07 21:12:54.000000000 -0500 +++ memcache_queue.h 2021-12-23 07:15:30.000000000 -0600 @@ -39,16 +39,19 @@ #ifdef PHP_WIN32 #define MMC_QUEUE_INLINE +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +/* see https://gcc.gnu.org/gcc-5/porting_to.html */ +#define MMC_QUEUE_INLINE extern inline #else #define MMC_QUEUE_INLINE inline #endif -MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *, void *); -MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *); -MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *, void *); -MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *); -MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *); -MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *, void *); +void mmc_queue_push(mmc_queue_t *, void *); +void *mmc_queue_pop(mmc_queue_t *); +int mmc_queue_contains(mmc_queue_t *, void *); +void mmc_queue_free(mmc_queue_t *); +void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *); +void mmc_queue_remove(mmc_queue_t *, void *); #endif /*MEMCACHE_QUEUE_H_*/