diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-06-19 00:07:23 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-06-19 00:07:23 +0000 |
commit | 7002776572e651843e3e7f7e429ccf13fea1ece5 (patch) | |
tree | 593809b9d0b8c5957cfc6c99ddb8538b37f2f05c /configure.in | |
parent | 641a9fbf4787de71d4f9eb2d59b864920ae29bb3 (diff) |
Pick up the stuff I did for tcpdump to figure out the right strings to
use to format 64-bit integers.
Fix the RSVP dissector to use that rather than hardcoding "%ll" in.
Remove the "only if G_HAVE_GINT64 is defined" bit from the discussion of
64-bit integers - we're too dependent on having them to support
compilers that don't have a 64-bit integral data type. Do, however,
note that neither "long" nor "long long" are acceptable, and also note
that you shouldn't assume "%ll" does the trick for printing them.
svn path=/trunk/; revision=11182
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/configure.in b/configure.in index f9903a56c6..b571e70e8f 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.266 2004/06/17 14:37:43 jmayer Exp $ +# $Id: configure.in,v 1.267 2004/06/19 00:07:22 guy Exp $ # AC_INIT(etypes.h) @@ -230,6 +230,64 @@ if test "$HAVE_GNU_SED" = no ; then esac fi +# +# We can't just check for <inttypes.h> - some systems have one that +# doesn't define all the PRI[doxu]64 macros. +# +AC_CHECK_HEADERS(inttypes.h, + [ + # + # OK, we have inttypes.h, but does it define those macros? + # + AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]]) + AC_COMPILE_IFELSE( + [ + AC_LANG_SOURCE( + [[ + #include <inttypes.h> + #include <stdio.h> + #include <sys/types.h> + + main() + { + printf("%" PRId64 "\n", (u_int64_t)1); + printf("%" PRIo64 "\n", (u_int64_t)1); + printf("%" PRIx64 "\n", (u_int64_t)1); + printf("%" PRIu64 "\n", (u_int64_t)1); + } + ]]) + ], + [ + AC_MSG_RESULT(yes) + ac_ethereal_inttypes_h_defines_formats=yes + ], + [ + AC_MSG_RESULT(no) + ac_ethereal_inttypes_h_defines_formats=no + ]) + ], + [ + # + # We don't have inttypes.h, so it obviously can't define those + # macros. + # + ac_ethereal_inttypes_h_defines_formats=no + ]) +if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then + AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros]) +else + AC_ETHEREAL_CHECK_64BIT_FORMAT(ll, + [ + AC_ETHEREAL_CHECK_64BIT_FORMAT(L, + [ + AC_ETHEREAL_CHECK_64BIT_FORMAT(q, + [ + AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer]) + ]) + ]) + ]) +fi + # Enable/disable tethereal AC_ARG_ENABLE(ethereal, |