Require GLib 2.4 or later.

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.

svn path=/trunk/; revision=25243
This commit is contained in:
Guy Harris 2008-05-05 22:47:32 +00:00
parent 773e6321d8
commit 31cae6e4ef
4 changed files with 3 additions and 157 deletions

View 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
#

View 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="",

View File

@ -25,14 +25,6 @@
#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"

View File

@ -27,10 +27,6 @@
#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.
*/