gnulib will only include the stdint.h if not available in the system, or if not correctly implemented in a given system. In my Ubuntu/Debian the module is not needed, as that file is already in the system, so no stdint.h will be created after runnning configure.

   The problem here is that #ifdef won't work if int64_t is a typedef,
   as in my stdint.h.

Yes. The #ifdef solution only works when using stdint.h from gnulib.

Checking for the specific int64_t with AC_CHECK_TYPE in configure.ac was the only solution I found, at least in GNU systems with a correct stdint.h not coming from gnulib. If the int64_t is not coming from the system, and it comes from gnulib's module, we can then try to use the #ifdef as gnulib will use macros to define the int64_t and friends. So a mixed approach will probably work.

   What do you think?

I agree with that approach. We can use AC_CHECK_TYPE to define
HAVE_INT_64 in config.h, and then something like:

   #if defined(HAVE_INT_64) || defined(int64_t)
     Use the system type.
   #endif

Yep, I'll send you updated patch.


Reply via email to