diff options
author | linimon <linimon@FreeBSD.org> | 2018-11-06 04:34:30 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2018-11-06 04:34:30 +0800 |
commit | 7a779c1cbe9e1207c7e8c08e8e1057f58bbd598f (patch) | |
tree | 8b84e5de19d848ab8a8ab4e44a538ae5d62b66d2 | |
parent | 0ed63925b98d977a140aa00ae728427741cc0a49 (diff) | |
download | freebsd-ports-gnome-7a779c1cbe9e1207c7e8c08e8e1057f58bbd598f.tar.gz freebsd-ports-gnome-7a779c1cbe9e1207c7e8c08e8e1057f58bbd598f.tar.zst freebsd-ports-gnome-7a779c1cbe9e1207c7e8c08e8e1057f58bbd598f.zip |
Base GCC fails to build this port because of duplicate typedefs;
fix it to allow build.
PR: 232324
Submitted by: Piotr Kubaj
Approved by: portmgr (tier-2 blanket)
-rw-r--r-- | net/pecl-zmq/files/patch-zmq__pollset.c | 150 |
1 files changed, 147 insertions, 3 deletions
diff --git a/net/pecl-zmq/files/patch-zmq__pollset.c b/net/pecl-zmq/files/patch-zmq__pollset.c index f0134b9b9e72..0abd622a7b72 100644 --- a/net/pecl-zmq/files/patch-zmq__pollset.c +++ b/net/pecl-zmq/files/patch-zmq__pollset.c @@ -1,5 +1,64 @@ ---- zmq_pollset.c.orig 2016-02-01 01:50:43 UTC +--- zmq_pollset.c.orig 2018-10-16 14:37:44 UTC +++ zmq_pollset.c +@@ -38,7 +38,7 @@ + + /* {{{ typedef struct _php_zmq_pollset + */ +-typedef struct _php_zmq_pollset { ++struct _php_zmq_pollset { + + zmq_pollitem_t *items; + zend_string **keys; +@@ -49,11 +49,11 @@ typedef struct _php_zmq_pollset { + size_t alloc_size; + + zval errors; +-} php_zmq_pollset; ++}; + /* }}} */ + + static +-void s_pollset_clear(php_zmq_pollset *set, zend_bool reinit) ++void s_pollset_clear(struct _php_zmq_pollset *set, zend_bool reinit) + { + size_t i; + +@@ -85,7 +85,7 @@ void s_pollset_clear(php_zmq_pollset *set, zend_bool r + } + + static +-size_t s_pollset_append(php_zmq_pollset *set, zmq_pollitem_t *item, zend_string *key, zval *entry) ++size_t s_pollset_append(struct _php_zmq_pollset *set, zmq_pollitem_t *item, zend_string *key, zval *entry) + { + size_t index = set->num_items; + +@@ -109,7 +109,7 @@ size_t s_pollset_append(php_zmq_pollset *set, zmq_poll + } + + static +-void s_pollset_delete(php_zmq_pollset *set, size_t index) ++void s_pollset_delete(struct _php_zmq_pollset *set, size_t index) + { + zend_string_release(set->keys[index]); + zval_ptr_dtor(&set->zv[index]); +@@ -144,7 +144,7 @@ void s_pollset_delete(php_zmq_pollset *set, size_t ind + } + + static +-zend_bool s_index_for_key(php_zmq_pollset *set, zend_string *key, size_t *index) ++zend_bool s_index_for_key(struct _php_zmq_pollset *set, zend_string *key, size_t *index) + { + zend_bool retval = 0; + size_t i; +@@ -160,7 +160,7 @@ zend_bool s_index_for_key(php_zmq_pollset *set, zend_s + } + + static +-zval *s_zval_for_index(php_zmq_pollset *set, size_t index) ++zval *s_zval_for_index(struct _php_zmq_pollset *set, size_t index) + { + return &set->zv[index]; + } @@ -169,7 +169,7 @@ static zend_string *s_create_key(zval *entry) { @@ -9,8 +68,39 @@ } else { zend_string *hash = php_spl_object_hash(entry); -@@ -222,7 +222,7 @@ size_t php_zmq_pollset_num_items(php_zmq_pollset *set) - zend_string *php_zmq_pollset_add(php_zmq_pollset *set, zval *entry, int events, int *error) +@@ -179,9 +179,9 @@ zend_string *s_create_key(zval *entry) + } + } + +-php_zmq_pollset *php_zmq_pollset_init() ++struct _php_zmq_pollset *_php_zmq_pollset_init() + { +- php_zmq_pollset *set = ecalloc (1, sizeof(php_zmq_pollset)); ++ struct _php_zmq_pollset *set = ecalloc (1, sizeof(struct _php_zmq_pollset)); + + array_init(&set->errors); + +@@ -195,7 +195,7 @@ php_zmq_pollset *php_zmq_pollset_init() + return set; + } + +-zend_bool php_zmq_pollset_items(php_zmq_pollset *set, zval *return_value) ++zend_bool php_zmq_pollset_items(struct _php_zmq_pollset *set, zval *return_value) + { + size_t i; + +@@ -214,15 +214,15 @@ zend_bool php_zmq_pollset_items(php_zmq_pollset *set, + return 1; + } + +-size_t php_zmq_pollset_num_items(php_zmq_pollset *set) ++size_t php_zmq_pollset_num_items(struct _php_zmq_pollset *set) + { + return set->num_items; + } + +-zend_string *php_zmq_pollset_add(php_zmq_pollset *set, zval *entry, int events, int *error) ++zend_string *php_zmq_pollset_add(struct _php_zmq_pollset *set, zval *entry, int events, int *error) { zend_string *key; - size_t num_items, index; @@ -27,3 +117,57 @@ memset(&item, 0, sizeof(zmq_pollitem_t)); if (Z_TYPE_P(entry) == IS_RESOURCE) { +@@ -273,7 +273,7 @@ zend_string *php_zmq_pollset_add(php_zmq_pollset *set, + return key; + } + +-zend_bool php_zmq_pollset_delete_by_key(php_zmq_pollset *set, zend_string *key) ++zend_bool php_zmq_pollset_delete_by_key(struct _php_zmq_pollset *set, zend_string *key) + { + size_t index; + +@@ -285,7 +285,7 @@ zend_bool php_zmq_pollset_delete_by_key(php_zmq_pollse + return 1; + } + +-zend_bool php_zmq_pollset_delete(php_zmq_pollset *set, zval *entry) ++zend_bool php_zmq_pollset_delete(struct _php_zmq_pollset *set, zval *entry) + { + zend_bool retval; + zend_string *key = s_create_key(entry); +@@ -296,7 +296,7 @@ zend_bool php_zmq_pollset_delete(php_zmq_pollset *set, + return retval; + } + +-int php_zmq_pollset_poll(php_zmq_pollset *set, int timeout, zval *r_array, zval *w_array) ++int php_zmq_pollset_poll(struct _php_zmq_pollset *set, int timeout, zval *r_array, zval *w_array) + { + int rc, i; + zend_bool readable = 0, writable = 0; +@@ -354,7 +354,7 @@ int php_zmq_pollset_poll(php_zmq_pollset *set, int tim + return rc; + } + +-void php_zmq_pollset_clear(php_zmq_pollset *set) ++void php_zmq_pollset_clear(struct _php_zmq_pollset *set) + { + // Clear errors + zend_hash_clean(Z_ARRVAL(set->errors)); +@@ -363,14 +363,14 @@ void php_zmq_pollset_clear(php_zmq_pollset *set) + s_pollset_clear(set, 1); + } + +-zval *php_zmq_pollset_errors(php_zmq_pollset *set) ++zval *php_zmq_pollset_errors(struct _php_zmq_pollset *set) + { + return &set->errors; + } + +-void php_zmq_pollset_destroy(php_zmq_pollset **ptr) ++void php_zmq_pollset_destroy(struct _php_zmq_pollset **ptr) + { +- php_zmq_pollset *set = *ptr; ++ struct _php_zmq_pollset *set = *ptr; + + // clear the pollset + s_pollset_clear(set, 0); |