diff options
author | ale <ale@FreeBSD.org> | 2008-01-29 18:14:37 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2008-01-29 18:14:37 +0800 |
commit | aa6d3a0a58b978e805e465ac926ded368d0f5d56 (patch) | |
tree | 414bb0a19253730b73bb52d1ec3539cb70851ff8 | |
parent | 150b9098e47c04a54283c9952cd8ce0a8e3e16c1 (diff) | |
download | freebsd-ports-gnome-aa6d3a0a58b978e805e465ac926ded368d0f5d56.tar.gz freebsd-ports-gnome-aa6d3a0a58b978e805e465ac926ded368d0f5d56.tar.zst freebsd-ports-gnome-aa6d3a0a58b978e805e465ac926ded368d0f5d56.zip |
Fixes for 64-bit systems.
PR: ports/120088
Submitted by: mm
Patch from: mi
-rw-r--r-- | databases/php5-pgsql/files/patch-pgsql.c | 100 | ||||
-rw-r--r-- | lang/php5/Makefile | 2 | ||||
-rw-r--r-- | lang/php5/files/patch-Zend_zend_list.c | 38 | ||||
-rw-r--r-- | lang/php5/files/patch-Zend_zend_list.h | 24 | ||||
-rw-r--r-- | lang/php53/Makefile | 2 | ||||
-rw-r--r-- | lang/php53/files/patch-Zend_zend_list.c | 38 | ||||
-rw-r--r-- | lang/php53/files/patch-Zend_zend_list.h | 24 |
7 files changed, 226 insertions, 2 deletions
diff --git a/databases/php5-pgsql/files/patch-pgsql.c b/databases/php5-pgsql/files/patch-pgsql.c new file mode 100644 index 000000000000..ecc1fdd2f193 --- /dev/null +++ b/databases/php5-pgsql/files/patch-pgsql.c @@ -0,0 +1,100 @@ +--- pgsql.c.orig 2007-10-04 01:31:58.000000000 +0200 ++++ pgsql.c 2008-01-29 11:10:15.000000000 +0100 +@@ -62,6 +62,7 @@ + #define PGSQL_MAX_LENGTH_OF_LONG 30 + #define PGSQL_MAX_LENGTH_OF_DOUBLE 60 + ++#if UINT_MAX > LONG_MAX + #define PGSQL_RETURN_OID(oid) do { \ + if (oid > LONG_MAX) { \ + smart_str s = {0}; \ +@@ -71,7 +72,9 @@ + } \ + RETURN_LONG((long)oid); \ + } while(0) +- ++#else ++#define PGSQL_RETURN_OID(oid) RETURN_LONG((long)oid) ++#endif + + #if HAVE_PQSETNONBLOCKING + #define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag) +@@ -272,7 +275,7 @@ + static int le_link, le_plink, le_result, le_lofp, le_string; + + /* {{{ _php_pgsql_trim_message */ +-static char * _php_pgsql_trim_message(const char *message, int *len) ++static char * _php_pgsql_trim_message(const char *message, size_t *len) + { + register int i = strlen(message)-1; + +@@ -363,7 +366,7 @@ + if (PGG(log_notices)) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message); + } +- zend_hash_index_update(&PGG(notices), (int)resource_id, (void **)¬ice, sizeof(php_pgsql_notice *), NULL); ++ zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void **)¬ice, sizeof(php_pgsql_notice *), NULL); + } + } + /* }}} */ +@@ -761,13 +764,14 @@ + */ + if (!(connect_type & PGSQL_CONNECT_FORCE_NEW) + && zend_hash_find(&EG(regular_list),str.c,str.len+1,(void **) &index_ptr)==SUCCESS) { +- int type,link; ++ int type; ++ ulong link; + void *ptr; + + if (Z_TYPE_P(index_ptr) != le_index_ptr) { + RETURN_FALSE; + } +- link = (int) index_ptr->ptr; ++ link = (uintptr_t /* ulong is as wide or wider than pointer */) index_ptr->ptr; + ptr = zend_list_find(link,&type); /* check if the link is still there */ + if (ptr && (type==le_link || type==le_plink)) { + Z_LVAL_P(return_value) = link; +@@ -1748,12 +1752,15 @@ + + + if (return_oid) { ++#if UINT_MAX > LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */ + if (oid > LONG_MAX) { + smart_str oidstr = {0}; + smart_str_append_unsigned(&oidstr, oid); + smart_str_0(&oidstr); + RETURN_STRINGL(oidstr.c, oidstr.len, 0); +- } else { ++ } else ++#endif ++ { + RETURN_LONG((long)oid); + } + } +@@ -1854,6 +1861,7 @@ + + oid = PQftype(pgsql_result, Z_LVAL_PP(field)); + ++#if UINT_MAX > LONG_MAX + if (oid > LONG_MAX) { + smart_str s = {0}; + smart_str_append_unsigned(&s, oid); +@@ -1863,6 +1871,7 @@ + Z_TYPE_P(return_value) = IS_STRING; + } + else ++#endif + { + Z_LVAL_P(return_value) = (long)oid; + Z_TYPE_P(return_value) = IS_LONG; +@@ -5741,8 +5750,8 @@ + { + zval *row; + char *field_name, *element, *data; +- size_t num_fields, element_len, data_len; +- int pg_numrows, pg_row; ++ size_t num_fields, element_len; ++ int pg_numrows, pg_row, data_len; + uint i; + assert(Z_TYPE_P(ret_array) == IS_ARRAY); + diff --git a/lang/php5/Makefile b/lang/php5/Makefile index f0c269469584..8a636438d1b3 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -7,7 +7,7 @@ PORTNAME= php5 PORTVERSION= 5.2.5 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP} MASTER_SITE_SUBDIR= distributions diff --git a/lang/php5/files/patch-Zend_zend_list.c b/lang/php5/files/patch-Zend_zend_list.c new file mode 100644 index 000000000000..efa8862d1ce8 --- /dev/null +++ b/lang/php5/files/patch-Zend_zend_list.c @@ -0,0 +1,38 @@ +--- Zend/zend_list.c.orig 2007-01-01 10:35:46.000000000 +0100 ++++ Zend/zend_list.c 2008-01-29 11:05:14.000000000 +0100 +@@ -48,7 +48,7 @@ + return index; + } + +-ZEND_API int _zend_list_delete(int id TSRMLS_DC) ++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -65,7 +65,7 @@ + } + + +-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) ++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -78,7 +78,7 @@ + } + } + +-ZEND_API int _zend_list_addref(int id TSRMLS_DC) ++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -350,7 +350,7 @@ + } + + +-char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) ++char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC) + { + zend_rsrc_list_dtors_entry *lde; + int rsrc_type; diff --git a/lang/php5/files/patch-Zend_zend_list.h b/lang/php5/files/patch-Zend_zend_list.h new file mode 100644 index 000000000000..308ac56b33b2 --- /dev/null +++ b/lang/php5/files/patch-Zend_zend_list.h @@ -0,0 +1,24 @@ +--- Zend/zend_list.h.orig 2007-01-01 10:35:46.000000000 +0100 ++++ Zend/zend_list.h 2008-01-29 11:05:12.000000000 +0100 +@@ -71,9 +71,9 @@ + void zend_destroy_rsrc_list_dtors(void); + + ZEND_API int zend_list_insert(void *ptr, int type); +-ZEND_API int _zend_list_addref(int id TSRMLS_DC); +-ZEND_API int _zend_list_delete(int id TSRMLS_DC); +-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); ++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC); ++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC); ++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC); + + #define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) + #define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) +@@ -82,7 +82,7 @@ + ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); + ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); + +-ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); ++ZEND_API char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC); + ZEND_API int zend_fetch_list_dtor_id(char *type_name); + + extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ diff --git a/lang/php53/Makefile b/lang/php53/Makefile index f0c269469584..8a636438d1b3 100644 --- a/lang/php53/Makefile +++ b/lang/php53/Makefile @@ -7,7 +7,7 @@ PORTNAME= php5 PORTVERSION= 5.2.5 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP} MASTER_SITE_SUBDIR= distributions diff --git a/lang/php53/files/patch-Zend_zend_list.c b/lang/php53/files/patch-Zend_zend_list.c new file mode 100644 index 000000000000..efa8862d1ce8 --- /dev/null +++ b/lang/php53/files/patch-Zend_zend_list.c @@ -0,0 +1,38 @@ +--- Zend/zend_list.c.orig 2007-01-01 10:35:46.000000000 +0100 ++++ Zend/zend_list.c 2008-01-29 11:05:14.000000000 +0100 +@@ -48,7 +48,7 @@ + return index; + } + +-ZEND_API int _zend_list_delete(int id TSRMLS_DC) ++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -65,7 +65,7 @@ + } + + +-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) ++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -78,7 +78,7 @@ + } + } + +-ZEND_API int _zend_list_addref(int id TSRMLS_DC) ++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC) + { + zend_rsrc_list_entry *le; + +@@ -350,7 +350,7 @@ + } + + +-char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) ++char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC) + { + zend_rsrc_list_dtors_entry *lde; + int rsrc_type; diff --git a/lang/php53/files/patch-Zend_zend_list.h b/lang/php53/files/patch-Zend_zend_list.h new file mode 100644 index 000000000000..308ac56b33b2 --- /dev/null +++ b/lang/php53/files/patch-Zend_zend_list.h @@ -0,0 +1,24 @@ +--- Zend/zend_list.h.orig 2007-01-01 10:35:46.000000000 +0100 ++++ Zend/zend_list.h 2008-01-29 11:05:12.000000000 +0100 +@@ -71,9 +71,9 @@ + void zend_destroy_rsrc_list_dtors(void); + + ZEND_API int zend_list_insert(void *ptr, int type); +-ZEND_API int _zend_list_addref(int id TSRMLS_DC); +-ZEND_API int _zend_list_delete(int id TSRMLS_DC); +-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); ++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC); ++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC); ++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC); + + #define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) + #define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) +@@ -82,7 +82,7 @@ + ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); + ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); + +-ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); ++ZEND_API char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC); + ZEND_API int zend_fetch_list_dtor_id(char *type_name); + + extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ |