dect
/
libpcap
Archived
13
0
Fork 0

Check for the intN_t and u_intN_t types the same way we do for tcpdump;

that works better on Tru64 UNIX.

Include the relevant headers for those types in savefile.c, for the same
reason.
This commit is contained in:
Guy Harris 2009-07-08 01:10:18 -07:00
parent 968888b3e0
commit 2723ec4198
5 changed files with 1243 additions and 765 deletions

30
aclocal.m4 vendored
View File

@ -581,36 +581,6 @@ AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
AC_MSG_RESULT($ac_cv_lbl_have_run_path)
])
dnl
dnl Due to the stupid way it's implemented, AC_CHECK_TYPE is nearly useless.
dnl
dnl usage:
dnl
dnl AC_LBL_CHECK_TYPE
dnl
dnl results:
dnl
dnl int32_t (defined)
dnl u_int32_t (defined)
dnl
AC_DEFUN(AC_LBL_CHECK_TYPE,
[AC_MSG_CHECKING(for $1 using $CC)
AC_CACHE_VAL(ac_cv_lbl_have_$1,
AC_TRY_COMPILE([
# include "confdefs.h"
# include <sys/types.h>
# if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
# endif],
[$1 i],
ac_cv_lbl_have_$1=yes,
ac_cv_lbl_have_$1=no))
AC_MSG_RESULT($ac_cv_lbl_have_$1)
if test $ac_cv_lbl_have_$1 = no ; then
AC_DEFINE($1, $2, [if we have $1])
fi])
dnl
dnl Checks to see if unaligned memory accesses fail
dnl

View File

@ -130,6 +130,9 @@
/* Define to 1 if the system has the type `struct ether_addr'. */
#undef HAVE_STRUCT_ETHER_ADDR
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
/* Define to 1 if you have the <sys/bufmod.h> header file. */
#undef HAVE_SYS_BUFMOD_H
@ -241,17 +244,29 @@
/* Define as token for inline if inlining supported */
#undef inline
/* Define to `short' if int16_t not defined. */
#undef int16_t
/* Define to `int' if int32_t not defined. */
#undef int32_t
/* Define to `long long' if int64_t not defined. */
#undef int64_t
/* Define to `signed char' if int8_t not defined. */
#undef int8_t
/* on sinix */
#undef sinix
/* if we have u_int16_t */
/* Define to `unsigned short' if u_int16_t not defined. */
#undef u_int16_t
/* if we have u_int32_t */
/* Define to `unsigned int' if u_int32_t not defined. */
#undef u_int32_t
/* if we have u_int64_t */
/* Define to `unsigned long long' if u_int64_t not defined. */
#undef u_int64_t
/* if we have u_int8_t */
/* Define to `unsigned char' if u_int8_t not defined. */
#undef u_int8_t

1879
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,64 @@ AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
AC_LBL_CHECK_TYPE(u_int8_t, u_char)
AC_LBL_CHECK_TYPE(u_int16_t, u_short)
AC_LBL_CHECK_TYPE(u_int32_t, u_int)
AC_LBL_CHECK_TYPE(u_int64_t, unsigned long long)
AC_CHECK_HEADERS(sys/bitypes.h)
AC_CHECK_TYPE([int8_t], ,
[AC_DEFINE([int8_t], [signed char],
[Define to `signed char' if int8_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int8_t], ,
[AC_DEFINE([u_int8_t], [unsigned char],
[Define to `unsigned char' if u_int8_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int16_t], ,
[AC_DEFINE([int16_t], [short],
[Define to `short' if int16_t not defined.])]
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int16_t], ,
[AC_DEFINE([u_int16_t], [unsigned short],
[Define to `unsigned short' if u_int16_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int32_t], ,
[AC_DEFINE([int32_t], [int],
[Define to `int' if int32_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int32_t], ,
[AC_DEFINE([u_int32_t], [unsigned int],
[Define to `unsigned int' if u_int32_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int64_t], ,
[AC_DEFINE([int64_t], [long long],
[Define to `long long' if int64_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int64_t], ,
[AC_DEFINE([u_int64_t], [unsigned long long],
[Define to `unsigned long long' if u_int64_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
#
# Try to arrange for large file support.

View File

@ -37,6 +37,20 @@ static const char rcsid[] _U_ =
#include "config.h"
#endif
#ifdef WIN32
#include <pcap-stdinc.h>
#else /* WIN32 */
#if HAVE_INTTYPES_H
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
#include <sys/types.h>
#endif /* WIN32 */
#include <errno.h>
#include <memory.h>
#include <stdio.h>