Undoing Disabling Macros

The Apache header files can define some macro's to enforce portability. These macro's disable the use of non-portable functions in your code (as well as in system header files). Sometimes it is neccessary to have the non-portable code, especially if you are importing large amounts of legacy code. As long as you can (at least temporarily) assume that the module will only be compiled on a platform where the non-portable function is available then you can disable these disabling macro's with a simple #undef.

The only function that is currently disabled by the Apache API is the strtoul() function. It is disabled because it is not available on sunos4 systems.

If your system defines strtoul() with a with a macro and then apache redefines it then undefining Apache's macro will not restore your function. You may have to bite the bullet and port your code to use a different function.


Source File

// Apache's compatibility warnings are of no concern to us.
#undef strtoul

External Documentation

The following is excerpted from Apache 1.3's httpd.h:

/* strtoul does not exist on sunos4. */
#ifdef strtoul
#undef strtoul
#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead

Zachary C. Miller
Last modified: Tue Sep 14 02:12:41 CDT 1999