Re: cvs: php4 /ext/msession msession.c

From: Date: Tue, 05 Feb 2002 20:40:01 +0000
Subject: Re: cvs: php4 /ext/msession msession.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9287@lists.php.net to get a copy of this message
Mark L. Woodward wrote:
mlwmohawk Tue Feb 5 15:02:34 2002 EDT
  Modified files:                  /php4/ext/msession	msession.c   Log:
Sorry guys, PHP 4.0.6's ZEND_MODULE_API_NO is whacked, it has an extra zero, thus ZEND_MODULE_API_NO >= xxxx, will not work for about 18000 years. Added better checking, and cleaned up some of the #ifdef you seem to love so much.
just grep'ed thru my archive:
./php-4.0.0/Zend/modules.h         :#define ZEND_MODULE_API_NO 20000401
./php-4.0.1pl2/Zend/modules.h      :#define ZEND_MODULE_API_NO 20000609
./php-4.0.2/Zend/modules.h         :#define ZEND_MODULE_API_NO 20000809
./php-4.0.3pl1/Zend/modules.h      :#define ZEND_MODULE_API_NO 20000809
./php-4.0.4pl1/Zend/modules.h      :#define ZEND_MODULE_API_NO 20001214
./php-4.0.5/Zend/zend_modules.h    :#define ZEND_MODULE_API_NO 20001222
./php-4.0.6/Zend/zend_modules.h    :#define ZEND_MODULE_API_NO 20001222
./php-4.1.0/Zend/zend_modules.h    :#define ZEND_MODULE_API_NO 20010901
./php-4.1.1/Zend/zend_modules.h    :#define ZEND_MODULE_API_NO 20010901
./php4-cvs/Zend/zend_modules.h     :#define ZEND_MODULE_API_NO 20010901
where is that extra zero you are refering to?
Index: php4/ext/msession/msession.c diff -u php4/ext/msession/msession.c:1.23 php4/ext/msession/msession.c:1.24 --- php4/ext/msession/msession.c:1.23 Tue Feb 5 12:00:27 2002 +++ php4/ext/msession/msession.c Tue Feb 5 15:02:33 2002 @@ -46,6 +46,20 @@ /* Uncomment to get debugging messages */ /* #define ERR_DEBUG */ +/* Zend version number is out of whack in 4.0.6 */ +/* Numerical <> do not seem to work, older released version is greater than current */
tried "!=" instead of "<>"?
+/* This sets the PHP API version used in the file. */ +/* If this module does not compile on the version of PHP you are using, look for */ +/* this value in Zend/zend_modules.h, and set appropriately */ + +#if (ZEND_MODULE_API_NO == 20001222) +#define PHP_4_0_API +#define TSRMLS_CC +#define TSRMLS_FETCH() +#elif (ZEND_MODULE_API_NO >= 20010901) +#define PHP_4_1_API +#endif
there is no such thing as a PHP_4_0 api as you can see in the list above different php 4.0 releases made use of different zend api versions once again it is just by pure coincidence that both TSRMLS_CC and the additional fields in the module structure had been introduced in the same api version with your current patch you have made the code compatible with 4.0.5 and 4.0.6 but have broken BC with versions before 4.0.5 #if (ZEND_MODULE_API_NO < 20010901) #error old #elif (ZEND_MODULE_API_NO >= 20010901) #error new #else #error else #endif throws "#error: old" on source versions up to 4.0.6 and "#error: new" on 4.1.0 and above as expected on both linux and solaris -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77 Wir stellen für Sie aus auf der CeBIT 2002 und freuen uns in Halle 6 auf Ihren Besuch am Stand H 18

« previous php.cvs (#9287) next »