Stepan Kasal wrote, quoting David Fang: >> -------->8 snip 8<-------- >> | #if HAVE_STDINT_H >> | # include <stdint.h> >> | #endif >> -------->8 snip 8<-------- ... >> | #ifdef HAVE_STDINT_H >> | # include <stdint.h> >> | #endif >> >> After all, isn't this the convention used in producing "config.h" >> and using it for conditional #includes? > > Though I originally thought that `#ifdef' should be used, when I > came to autoconf community, I heard this ``it is defined as `1', > so that you can use either `#if' or `#ifdef'.'' So, please consider this trivial example: <example file="configure.ac"> AC_INIT AC_PROG_CC AC_CONFIG_HEADERS([config.h]) AC_CHECK_HEADERS([nonsuch.h]) AC_OUTPUT </example> Put this in an empty test directory, and then run these commands in that directory: <commands> autoheader autoconf ./configure cat config.h </commands> <output> : : /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the <nonsuch.h> header file. */ /* #undef HAVE_NONSUCH_H */ /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 : : </output> Yes, it defines `HAVE_*_H' to be `1', for headers which exist, but note how it *doesn't* define `HAVE_NONSUCH_H'; how does that jive with your assertion that it doesn't matter whether you use `#if' or `#ifdef'? `#if HAVE_NONSUCH_H' would be testing the *value* of a symbol which isn't defined, so is invalid. `#ifdef HAVE...' is the required format; `#if HAVE...' is a bug wrt current practice in `config.h', of not defining symbols for missing headers. Regards, Keith. _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf