PHP 4.0 Bug #3671: more multiple-include protection is needed

From: Date: Tue, 29 Feb 2000 23:11:47 +0000
Subject: PHP 4.0 Bug #3671: more multiple-include protection is needed
Groups: php.dev 
Request: Send a blank email to php-dev+get-16171@lists.php.net to get a copy of this message
From: djm@web.us.uu.net Operating system: BSD/OS 4.0.1 PHP version: 4.0 Beta 4 Patch Level 1 PHP Bug Type: Compile Failure Bug description: more multiple-include protection is needed Two files in 4.0b4pl1 cause compile failures because of multiple inclusion. In one case, the same struct is defined in two different files. Below are the errors, followed by the patch I used to make it compile. /bin/sh ./libtool --silent --mode=compile cc -DHAVE_CONFIG_H -I. -I/usr/src/local/usr.local/libexec/php4/. -I. -I./Zend -I/usr/src/local/usr.local/libexec/php4 -I/usr/local/include/apache-1.3.9 -I/usr/src/local/usr.local/libexec/php4/ext/xml/expat/xmltok -I/usr/src/local/usr.local/libexec/php4/ext/xml/expat/xmlparse -DXML_BYTE_ORDER=12 -D_REENTRANT -D__WANT_DB2__ -c internal_functions.c In file included from ext/standard/php3_standard.h:37, from internal_functions.c:48: ext/standard/php3_dir.h:37: warning: `phpext_dir_ptr' redefined ext/standard/php_dir.h:37: warning: this is the location of the previous definition In file included from internal_functions.c:68: ext/db/php3_db.h:44: warning: `phpext_db_ptr' redefined ext/db/php_db.h:93: warning: this is the location of the previous definition In file included from ext/standard/php3_standard.h:51, from internal_functions.c:48: ext/standard/url.h:31: redefinition of `struct url' ext/standard/url.h:40: redefinition of `url' ext/standard/url.h:40: `url' previously declared here In file included from internal_functions.c:68: ext/db/php3_db.h:48: redefinition of `struct dbm_info' ext/db/php3_db.h:53: redefinition of `dbm_info' ext/db/php_db.h:53: `dbm_info' previously declared here gmake[1]: *** [internal_functions.lo] Error 1 gmake[1]: Leaving directory `/usr/src/local/usr.local/libexec/php4' gmake: *** [all-recursive] Error 1 *** Error code 2 Stop. Index: ext/db/php3_db.h =================================================================== retrieving revision 1.1.1.1 diff -u -r1.1.1.1 php3_db.h --- ext/db/php3_db.h 1999/10/12 12:45:25 1.1.1.1 +++ ext/db/php3_db.h 2000/02/29 23:00:26 @@ -44,13 +44,14 @@ #define phpext_db_ptr &dbm_module_entry - +#ifndef _PHP_DB_H typedef struct dbm_info { char *filename; char *lockfn; int lockfd; void *dbf; } dbm_info; +#endif /* we're not going to bother with flatfile on win32 Index: ext/standard/url.h =================================================================== retrieving revision 1.1.1.2 diff -u -r1.1.1.2 url.h --- ext/standard/url.h 2000/02/29 05:48:11 1.1.1.2 +++ ext/standard/url.h 2000/02/29 23:00:26 @@ -28,6 +28,9 @@ */ /* $Id: url.h,v 1.1.1.2 2000/02/29 05:48:11 djm Exp $ */ +#ifndef _PHP_URL_H +#define _PHP_URL_H + typedef struct url { char *scheme; char *user; @@ -51,6 +54,8 @@ PHP_FUNCTION(urldecode); PHP_FUNCTION(rawurlencode); PHP_FUNCTION(rawurldecode); + +#endif /* _PHP_URL_H */ /* * Local variables:

« previous php.dev (#16171) next »