Re: [PHP4BETA] cvs: /php4/ext/odbc config.h.stub config.m4 php3 _velocis.h php_odbc.c php_odbc.h velocis.c
| From: | Stig Bakken | Date: | Wed, 10 Nov 1999 08:56:24 +0000 |
| Subject: | Re: [PHP4BETA] cvs: /php4/ext/odbc config.h.stub config.m4 php3 _velocis.h php_odbc.c php_odbc.h velocis.c | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6099@lists.php.net to get a copy of this message | ||
Okay, time to refresh some memories. :-)
Back when 3.0 was in early alpha (or pre-alpha, I don't remember), we used
these HAVE_XXX symbols in the internal functions array, to determine
whether or not the functions from that extension were to be added to the
global function table. AFAIR, that was _the_ reason we switched from the
de-facto standard of "undef/define 1" to "define 0/define 1", because we
were actually using the values. But after this was changed to defining
module_entry_ptr to NULL instead, we didn't change it back. This has
confused a number of people into thinking that "define 0/define 1" is the
way to do it. They get bitten as soon as they use/cook/look at code from
projects following the de-facto standard.
This is at least my "historical perception" of this.
Maybe we should do a complete cleanup of this after b3? We could rename
any HAVE_XXX symbols that have the values 0 or 1 to either "WITH_XXX" or
"ENABLE_XXX", and leave the HAVE_XXX "namespace" to undef/define 1
symbols. If we document this in a visible place, that would hopefully be
the end of the confusion.
- Stig
On Wed, 10 Nov 1999, Rasmus Lerdorf wrote:
| On Tue, 9 Nov 1999, Stig Bakken wrote:
| > On Tue, 9 Nov 1999, Rasmus Lerdorf wrote:
| >
| > | > These changes were done for consistency. I'll update config.w32.h.
| > |
| > | Then you also need to change every single define in php_config.h
| >
| > I changed ext/odbc/config.h.stub, from which php_config.h is built, so the
| > HAVE_NNN symbols used in ext/odbc default to undefined. Or do you mean
| > something else?
|
| Ok, perhaps I am being completely daft here, but all the HAVE_* defines in
| php_config.h define to either 0 or 1, do they not? ie. a partial
| copy-paste from it:
|
| /* Define if you want the LDAP directory interface */
| #define HAVE_LDAP 0
| /* Define if you want the MCAL extension */
| #define HAVE_MCAL 0
| /* define if you want to use the mcrypt extension */
| /* #undef HAVE_LIBMCRYPT */
| /* define if you want to use the mhash extension */
| /* #undef HAVE_LIBMHASH */
| #define HAVE_MSQL 0
| #define MSQL1 0
| #ifndef HAVE_MYSQL
| #define HAVE_MYSQL 0
| #endif
| /* define if you want to use the oci8 extension */
| /* #undef HAVE_LIBOCI8 */
| #define HAVE_OCI8 0
|
| #define HAVE_SOLID 0
| #define HAVE_IBMDB2 0
| #define HAVE_IODBC 0
| #define HAVE_ESOOB 0
| #define HAVE_UNIXODBC 0
| #define HAVE_OPENLINK 0
| #define HAVE_ADABAS 0
| #define HAVE_CODBC 0
| #define HAVE_UODBC 0
| #define HAVE_EMPRESS 0
| #define HAVE_VELOCIS 0
| /* Define if you have the Oracle database client libraries */
| #define HAVE_ORACLE 0
| /* define if you want to use the PCRE extension */
| #define HAVE_PCRE 0
|
|
| That's what I meant when I said you'd need to change all the other ones as
| well. We have always used this approach, and if you are going to change
| the ODBC case to #define blah 1/#undef blah then we should be consistent
| and do it throughout. Personally I don't see why what we have isn't
| sufficient.
|
| -Rasmus
|