|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-06 22:31 UTC] gk at gknw dot de
Description: ------------ The NetWare compiler we use is very strict and breaks when const is used where not expected. The commit: http://cvs.php.net/viewvc.cgi/php-src/ext/exif/exif.c?r1=1.196&r2=1.197 breaks the NetWare compile due to the line: static const zend_module_dep exif_module_deps[] = { exif.c:258: illegal implicit conversion from 'const struct exif.c:258: _zend_module_dep[2]' to exif.c:258: 'struct _zend_module_dep *' the patch below fixes this and also adds ifdefs as used with other extensions f.e. pdp_*; not sure if these are really needed, but this change: -static const zend_module_dep exif_module_deps[] = { +static zend_module_dep exif_module_deps[] = { is definetely required. --- exif.c.orig Mon Dec 31 08:33:29 2007 +++ exif.c Thu Mar 06 23:15:31 2008 @@ -242,19 +242,25 @@ /* }}} */ /* {{{ exif dependencies */ -static const zend_module_dep exif_module_deps[] = { +#if ZEND_MODULE_API_NO >= 20050922 +static zend_module_dep exif_module_deps[] = { ZEND_MOD_REQUIRED("standard") #if EXIF_USE_MBSTRING ZEND_MOD_REQUIRED("mbstring") #endif {NULL, NULL, NULL} }; +#endif /* }}} */ /* {{{ exif_module_entry */ zend_module_entry exif_module_entry = { +#if ZEND_MODULE_API_NO >= 20050922 STANDARD_MODULE_HEADER_EX, NULL, +#else + STANDARD_MODULE_HEADER, +#endif exif_module_deps, "exif", exif_functions, PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
From what I see the Metrowerks compiler is right when it finds a type mismatch - what's wrong is that it errors out instead of only warn, but unfortunately this cant the changed with a compiler switch. Looking at ./Zend/zend_modules.h I see struct _zend_module_entry declared as: struct _zend_module_entry { unsigned short size; unsigned int zend_api; unsigned char zend_debug; unsigned char zts; struct _zend_ini_entry *ini_entry; struct _zend_module_dep *deps; char *name; .... if I change the struct to use 'const zend_module_dep *': --- zend_modules.h.orig Mon Dec 31 08:33:26 2007 +++ zend_modules.h Fri Mar 07 20:10:34 2008 @@ -80,7 +80,7 @@ unsigned char zend_debug; unsigned char zts; struct _zend_ini_entry *ini_entry; - struct _zend_module_dep *deps; + const struct _zend_module_dep *deps; char *name; struct _zend_function_entry *functions; int (*module_startup_func)(INIT_FUNC_ARGS); then it works fine with unchanged exif.c extension; however sure it breaks then with _every_ other module since none currently use 'const zend_module_dep', at least not in PHP 5.2 source tree. So if we want the modules use 'const zend_module_dep' then the header zend_modules.h must also be changed, and it must be done for _all_ modules.