Require GLib 2.4 or later.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 May 2008 22:47:32 +0000 (22:47 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 May 2008 22:47:32 +0000 (22:47 +0000)
That means that G_GINT64_MODIFIER will be defined, so don't check
whether it's defined.

We don't use the PRI[douxX]64 macros, as we use the GLib print routines
and thus use G_GINT64_MODIFIER instead.  Get rid of the checks for
whether inttypes.h defines PRI[douxX]64; just check whether it exists at
all.

That means we don't set INTTYPES_H_DEFINES_FORMATS, so don't check for
it.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25243 f5534014-38df-0310-8fa8-9805f1628bb7

acinclude.m4
configure.in
epan/packet.h
epan/tap.h

index b6eb4b5f4f440f3af6238b8f517979bb55826086..37258ed2018d29bffb69b3fe002e1b8096389a02 100644 (file)
@@ -1510,48 +1510,6 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
        AC_SUBST(KRB5_LIBS)
 ])
 
-dnl
-dnl Check whether a given format can be used to print 64-bit integers
-dnl
-AC_DEFUN([AC_WIRESHARK_CHECK_64BIT_FORMAT],
-[
-  AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers])
-  ac_save_CFLAGS="$CFLAGS"
-  ac_save_LIBS="$LIBS"
-  CFLAGS="$CFLAGS $GLIB_CFLAGS"
-  LIBS="$GLIB_LIBS $LIBS"
-  AC_RUN_IFELSE(
-    [
-      AC_LANG_SOURCE(
-       [[
-         #include <glib.h>
-         #include <glib/gprintf.h>
-         #include <stdio.h>
-
-         main()
-         {
-           guint64 t = 1;
-           char strbuf[16+1];
-           g_snprintf(strbuf, sizeof strbuf, "%016$1x", t << 32);
-           if (strcmp(strbuf, "0000000100000000") == 0)
-             exit(0);
-           else
-             exit(1);
-         }
-       ]])
-    ],
-    [
-      AC_DEFINE(G_GINT64_MODIFIER, "$1", [Format modifier for printing 64-bit numbers])
-      AC_MSG_RESULT(yes)
-    ],
-    [
-      AC_MSG_RESULT(no)
-      $2
-    ])
-  CFLAGS="$ac_save_CFLAGS"
-  LIBS="$ac_save_LIBS"
-])
-
 #
 # AC_WIRESHARK_GCC_CFLAGS_CHECK
 #
index 167affaa4259c76fe60790051c1d30e7c4a632ad..290830980cf61b7be2bf9720045861c30723375c 100644 (file)
@@ -584,14 +584,14 @@ if test "$GTK_OK" = "no" ; then
        wireshark_bin=""
        wireshark_man=""
        # Honor GLIB_CFLAGS
-       AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib 2.0 or later distribution not found.), gmodule)
+       AM_PATH_GLIB_2_0(2.4.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib 2.0 or later distribution not found.), gmodule)
 
 else
        wireshark_bin="wireshark\$(EXEEXT)"
        wireshark_man="wireshark.1"
         wireshark_SUBDIRS="codecs gtk"
        # Honor GLIB_CFLAGS
-       AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib 2.0 or later distribution not found.), gmodule)
+       AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
 fi
 
 #
@@ -630,66 +630,6 @@ else
   have_plugins=no
 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 <glib.h>
-           #include <stdio.h>
-           #include <sys/types.h>
-
-           main()
-           {
-             printf("%" PRId64 "\n", (gint64)1);
-             printf("%" PRIo64 "\n", (guint64)1);
-             printf("%" PRIx64 "\n", (guint64)1);
-             printf("%" PRIX64 "\n", (guint64)1);
-             printf("%" PRIu64 "\n", (guint64)1);
-           }
-         ]])
-      ],
-      [
-       AC_MSG_RESULT(yes)
-       ac_wireshark_inttypes_h_defines_formats=yes
-      ],
-      [
-       AC_MSG_RESULT(no)
-       ac_wireshark_inttypes_h_defines_formats=no
-      ])
-  ],
-  [
-    #
-    # We don't have inttypes.h, so it obviously can't define those
-    # macros.
-    #
-    ac_wireshark_inttypes_h_defines_formats=no
-  ])
-if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
-  AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
-else
-  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])
-           ])
-       ])
-    ])
-fi
-
 AC_SUBST(wireshark_bin)
 AC_SUBST(wireshark_man)
 
@@ -1164,8 +1104,7 @@ fi
 AC_SUBST(LIBCAP_LIBS)
 
 dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
+AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
 AC_CHECK_HEADERS(netinet/in.h)
 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
@@ -1290,45 +1229,6 @@ 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>
-       #include <glib/gprintf.h>
-       #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(l,
-      [
-      AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
-       [
-         AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
-           [
-             AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
-               [
-                 AC_MSG_ERROR([neither %lx nor %llx nor %Lx nor %qx worked on a 64-bit integer])
-               ])
-           ])
-       ])
-    ])
-  ])
-
 GETOPT_C=""
 GETOPT_O=""
 AC_CHECK_FUNC(getopt, GETOPT_O="",
index edaaacf66c6ba11899c4e4c44db67d68738150c6..0ccb2785768252cb736f8e77c7fd0bf4a3141280 100644 (file)
 #ifndef __PACKET_H__
 #define __PACKET_H__
 
-/*
- * If <inttypes.h> defines formats to be used to print 64-bit integers,
- * include it.
- */
-#ifdef INTTYPES_H_DEFINES_FORMATS
-#include <inttypes.h>
-#endif
-
 #include "wiretap/wtap.h"
 #include "proto.h"
 #include "tvbuff.h"
index e9890cd03bde1df122eb19b60b03a8695b9e72aa..4f4855deff49a2d9c749e142a3697d286f9dd919 100644 (file)
 
 #include "epan/epan.h"
 
-#ifdef INTTYPES_H_DEFINES_FORMATS
-#include <inttypes.h>
-#endif
-
 /* With MSVC and a libwireshark.dll, we need a 
  * special declaration of num_tap_filters.
  */