aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-05-29 06:56:07 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2007-05-29 06:56:07 +0000
commit72e0d4ff1dae8ddcbebdb20ae480fbb0a4f0b06c (patch)
tree7e4f2588b513edda09dc228f9704dc099692792d /configure.in
parentda975a2f4c810792cd5c969db9d0b4bd4c3fe812 (diff)
Check for G_GINT64_MODIFIER in Wireshark as we do in Wiretap.
In all the places where a cast to "long long" or "unsigned long long" was done, use G_GINT64_MODIFIER and get rid of the cast, as 1) there's no guarantee that "%ll" works and 2) there's no guarantee that "long long" works (the latter definitely does *NOT* work with MSVC++; the former doesn't work with regular printf in MSVC++, but it might work with the GLib printf-based functions). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21978 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index e719e0d23d..82a5971151 100644
--- a/configure.in
+++ b/configure.in
@@ -1194,6 +1194,44 @@ AC_C_BIGENDIAN
# XXX - do we need this?
AC_PROG_GCC_TRADITIONAL
+#
+# Does GLib define G_GINT64_MODIFIER?
+#
+AC_MSG_CHECKING([[whether glib.h defines the G_GINT64_MODIFIER macro]])
+AC_COMPILE_IFELSE(
+ [
+ AC_LANG_SOURCE(
+ [[
+ #include <glib.h>
+ #if GTK_MAJOR_VERSION >= 2
+ #include <glib/gprintf.h>
+ #endif
+ #include <stdio.h>
+
+ main()
+ {
+ char strbuf[16+1];
+ g_snprintf(strbuf, sizeof strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
+ }
+ ]])
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
+ [
+ AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
+ [
+ AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
+ [
+ AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
+ ])
+ ])
+ ])
+ ])
+
GETOPT_C=""
GETOPT_O=""
AC_CHECK_FUNC(getopt, GETOPT_O="",