diff options
author | Brian Evans <grknight@gentoo.org> | 2017-05-19 16:56:20 -0400 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2017-05-19 16:56:20 -0400 |
commit | df36d833b926ccb70bccb784bc7cbfafb687c74f (patch) | |
tree | 35430a5089ed347258376ba35191795a7ff10800 /dev-php | |
parent | dev-perl/Test-Deep: Cleanup old re bug #614340 (diff) | |
download | gentoo-df36d833b926ccb70bccb784bc7cbfafb687c74f.tar.gz gentoo-df36d833b926ccb70bccb784bc7cbfafb687c74f.tar.bz2 gentoo-df36d833b926ccb70bccb784bc7cbfafb687c74f.zip |
dev-php/pecl-memcache: Add patch that does not rely on -std=gnu89
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Diffstat (limited to 'dev-php')
-rw-r--r-- | dev-php/pecl-memcache/files/3.0.8-c99-inline.patch | 85 | ||||
-rw-r--r-- | dev-php/pecl-memcache/pecl-memcache-3.0.8-r3.ebuild | 46 |
2 files changed, 131 insertions, 0 deletions
diff --git a/dev-php/pecl-memcache/files/3.0.8-c99-inline.patch b/dev-php/pecl-memcache/files/3.0.8-c99-inline.patch new file mode 100644 index 000000000000..818b3ce1e2d9 --- /dev/null +++ b/dev-php/pecl-memcache/files/3.0.8-c99-inline.patch @@ -0,0 +1,85 @@ +diff -aurN a/memcache_pool.h b/memcache_pool.h +--- a/memcache_pool.h 2013-04-07 22:12:54.000000000 -0400 ++++ b/memcache_pool.h 2017-05-19 16:04:45.262858090 -0400 +@@ -135,8 +135,14 @@ + #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__ < 199901L ++#define MMC_POOL_INLINE inline ++#else ++#define MMC_POOL_INLINE __attribute__ ((gnu_inline)) inline ++#endif ++ ++MMC_POOL_INLINE void mmc_buffer_alloc(mmc_buffer_t *, unsigned int); ++MMC_POOL_INLINE void mmc_buffer_free(mmc_buffer_t *); + + /* stream handlers */ + typedef struct mmc_stream mmc_stream_t; +@@ -391,8 +397,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 *); ++MMC_POOL_INLINE int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *); ++MMC_POOL_INLINE int mmc_prepare_key(zval *, char *, unsigned int *); + + #define mmc_str_left(h, n, hlen, nlen) ((hlen) >= (nlen) ? memcmp((h), (n), (nlen)) == 0 : 0) + +diff -aurN a/memcache_queue.h b/memcache_queue.h +--- a/memcache_queue.h 2013-04-07 22:12:54.000000000 -0400 ++++ b/memcache_queue.h 2017-05-19 16:07:23.753983941 -0400 +@@ -40,7 +40,11 @@ + #ifdef PHP_WIN32 + #define MMC_QUEUE_INLINE + #else ++#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L + #define MMC_QUEUE_INLINE inline ++#else ++#define MMC_QUEUE_INLINE __attribute__ ((gnu_inline)) inline ++#endif + #endif + + MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *, void *); +diff -aurN a/memcache_pool.c b/memcache_pool.c +--- a/memcache_pool.c 2013-04-07 22:12:54.000000000 -0400 ++++ b/memcache_pool.c 2017-05-19 16:22:51.592845885 -0400 +@@ -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); diff --git a/dev-php/pecl-memcache/pecl-memcache-3.0.8-r3.ebuild b/dev-php/pecl-memcache/pecl-memcache-3.0.8-r3.ebuild new file mode 100644 index 000000000000..2712c682f647 --- /dev/null +++ b/dev-php/pecl-memcache/pecl-memcache-3.0.8-r3.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +PHP_EXT_NAME="memcache" +PHP_EXT_INI="yes" +PHP_EXT_ZENDEXT="no" +DOCS=( README ) +PATCHES=( "${FILESDIR}/3.0.8-c99-inline.patch" ) + +USE_PHP="php5-6" + +inherit php-ext-pecl-r3 + +KEYWORDS="~amd64 ~hppa ~ppc64 ~x86" + +DESCRIPTION="PHP extension for using memcached" +LICENSE="PHP-3" +SLOT="0" +IUSE="+session" + +DEPEND="sys-libs/zlib + dev-lang/php:5.6[session?]" +RDEPEND="${DEPEND}" + +# The test suite requires memcached to be running. +RESTRICT='test' + +src_configure() { + local PHP_EXT_ECONF_ARGS=( --enable-memcache --with-zlib-dir=/usr $(use_enable session memcache-session) ) + php-ext-source-r3_src_configure +} + +src_install() { + php-ext-pecl-r3_src_install + + php-ext-source-r3_addtoinifiles "memcache.allow_failover" "true" + php-ext-source-r3_addtoinifiles "memcache.max_failover_attempts" "20" + php-ext-source-r3_addtoinifiles "memcache.chunk_size" "32768" + php-ext-source-r3_addtoinifiles "memcache.default_port" "11211" + php-ext-source-r3_addtoinifiles "memcache.hash_strategy" "consistent" + php-ext-source-r3_addtoinifiles "memcache.hash_function" "crc32" + php-ext-source-r3_addtoinifiles "memcache.redundancy" "1" + php-ext-source-r3_addtoinifiles "memcache.session_redundancy" "2" + php-ext-source-r3_addtoinifiles "memcache.protocol" "ascii" +} |