You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rasmus Lerdorf <ra...@lerdorf.on.ca> on 1998/08/13 04:38:22 UTC

MMN stuff

Just tried to compile mod_php3 against this new MMN stuff:

functions/apache.c: In function `php3_info_apache':
functions/apache.c:122: `MODULE_MAGIC_NUMBER' undeclared (first use in
this function)
functions/apache.c:122: (Each undeclared identifier is reported only once
functions/apache.c:122: for each function it appears in.)
make: *** [functions/apache.o] Error 1

Was it really the intent to not make this backward compatible?  This is
extremely ugly.  I have MODULE_MAGIC_NUMBER checks all over the place to
make sure mod_php3 works with all versions of 1.2.x and 1.3.x.  Now it
looks like I have to check for the presence of src/include/ap_mmn.h, and
if it is there do something like:

#define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR

Except, I can't #define one macro to the value of another like this, so I
am a tad screwed.  So I do this:

#if HAVE_AP_MMN_H
#if MODULE_MAGIC_NUMBER_MAJOR >= 19970831
   aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, php3_rqst->server, log_message);
#else
#if MODULE_MAGIC_NUMBER >= 19970831
   aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, php3_rqst->server, log_message);
#endif
#else
   log_error(log_message, php3_rqst->server);
#endif

As if this code wasn't ugly enough already.  And ok, I realize that in
this case, just the mere presence of ap_mmn.h will also mean that MMN is
more recent, so I could remove a check, but moving forward that isn't
necessarily true.

All other modules will of course instantly break as soon as we release
this version of Apache and all module authors will have to scramble to
release new versions in order to have them compile against 1.3.2.  Just
doesn't seem like a very friendly thing to do in a point release.

Why not simply keep MODULE_MAGIC_NUMBER and just add
MODULE_MAGIC_NUMBER_MINOR?

-Rasmus


Re: MMN stuff

Posted by Randy Terbush <ra...@Covalent.NET>.
This was not the intent. Fixed. Thanks for pointing this out.


Rasmus Lerdorf <ra...@lerdorf.on.ca> writes:
> Just tried to compile mod_php3 against this new MMN stuff:
> 
> functions/apache.c: In function `php3_info_apache':
> functions/apache.c:122: `MODULE_MAGIC_NUMBER' undeclared (first use in
> this function)
> functions/apache.c:122: (Each undeclared identifier is reported only once
> functions/apache.c:122: for each function it appears in.)
> make: *** [functions/apache.o] Error 1
> 
> Was it really the intent to not make this backward compatible?  This is
> extremely ugly.  I have MODULE_MAGIC_NUMBER checks all over the place to
> make sure mod_php3 works with all versions of 1.2.x and 1.3.x.  Now it
> looks like I have to check for the presence of src/include/ap_mmn.h, and
> if it is there do something like:
> 
> #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR
> 
> Except, I can't #define one macro to the value of another like this, so I
> am a tad screwed.  So I do this:
> 
> #if HAVE_AP_MMN_H
> #if MODULE_MAGIC_NUMBER_MAJOR >= 19970831
>    aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, php3_rqst->server, log_message);
> #else
> #if MODULE_MAGIC_NUMBER >= 19970831
>    aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, php3_rqst->server, log_message);
> #endif
> #else
>    log_error(log_message, php3_rqst->server);
> #endif
> 
> As if this code wasn't ugly enough already.  And ok, I realize that in
> this case, just the mere presence of ap_mmn.h will also mean that MMN is
> more recent, so I could remove a check, but moving forward that isn't
> necessarily true.
> 
> All other modules will of course instantly break as soon as we release
> this version of Apache and all module authors will have to scramble to
> release new versions in order to have them compile against 1.3.2.  Just
> doesn't seem like a very friendly thing to do in a point release.
> 
> Why not simply keep MODULE_MAGIC_NUMBER and just add
> MODULE_MAGIC_NUMBER_MINOR?
> 
> -Rasmus