Hrvoje Niksic <hniksic(a)iskon.hr> writes:
Didier Verna <didier(a)xemacs.org> writes:
> | /* For use in #include statements.
> | You can't use macros directly within the <> of a #include statement.
> | The multiply nested macros are necessary to make old gcc's happy.
> | However, those nested macros are too much for AIX xlc to deal with. */
> | #if defined(_AIX) && !defined(__GNUC__)
> | #define ATHENA_INCLUDE(header_file) <ATHENA_H_PATH/header_file>
> | #else
...
> * Each time a new inclusion macro needs to be written, you have to
> redo the AIX test. I concede that this is not very satisfactory.
That kills it IMO. AIX /per se/ is of course not the issue. The
issue is that only God knows how many more compilers have exactly the
same problem. These #ifdef's scattered through code might only
increase.
Idea: maybe we should design a configure test to test which kind of
configure glue the user's preprocessor likes. Then our config.h.in
could say something like:
#define ATHENA_INCLUDE @INCLUDE_GLUE@(...)
Or why not just put it in one place as SMART_INCLUDE, and then
#if defined(_AIX) && !defined(__GNUC__)
#define SMART_INCLUDE(path,header_file) <path/header_file>
#else
#define INCLUDE_GLUE_2(dirname,basename) <##dirname##/##basename##>
#define INCLUDE_GLUE_1(dirname,basename) INCLUDE_GLUE_2(dirname,basename)
#define SMART_INCLUDE(path,header_file) INCLUDE_GLUE_1(path,header_file)
#endif
#define ATHENA_INCLUDE(x) SMART_INCLUDE(ATHENA_H_PATH,x)
#define SOUND_INCLUDE(x) SMART_INCLUDE(SOUND_H_PATH,x)
#define FOO_INCLUDE SMART_INCLUDE(FOO_H_PATH,x)
etc, etc? That way whenever you find that some compiler has problems you
just smarten up SMART_INCLUDE in one place, voila.
-bp