aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/configure.in
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-13 07:09:20 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-13 07:09:20 +0000
commit0003059ba95a2c177bb7439243bc883a17e2dd93 (patch)
treef0c0dd538dbefaaf38246921b8311118abbf5a3a /wiretap/configure.in
parente7c5d04c07bc5f65552e3727dd17d6967c83ed1f (diff)
We are obliged to define HAVE_UNISTD_H in "config.h"; to avoid the
hideous problem on FreeBSD 3.[23] (and perhaps other BSDs) if HAVE_UNISTD_H is defined before "zlib.h" is included, turn "file_seek()" into a subroutine defined in a file that *undefines* HAVE_UNISTD_H before including "zlib.h", so that the *only* call to "gzseek()" is made from a file that does not have HAVE_UNISTD_H defined when it includes "zlib.h". Move "file_error()" to that file while you're at it, so it holds all the wrappers that hide the presence or absence of zlib from routines to read capture files. Turn "file.h", which declared those wrapper functions as well as wrapper macros, into "file_wrapper.h" - it belongs with the "file_wrapper.c" file that defines the wrapper functions, not with "file.c" which handles higher-layer file access functions. Remove the comment in "configure.in" that explained why defining HAVE_UNISTD_H was a bad idea, as we're not obliged to define it and work around the problem. (The comment in "file_wrapper.c" explains the workaround.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1463 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/configure.in')
-rw-r--r--wiretap/configure.in43
1 files changed, 1 insertions, 42 deletions
diff --git a/wiretap/configure.in b/wiretap/configure.in
index dbd1c9ea7e..884f901e14 100644
--- a/wiretap/configure.in
+++ b/wiretap/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.19 2000/01/10 17:33:17 gram Exp $
+# $Id: configure.in,v 1.20 2000/01/13 07:09:15 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -45,47 +45,6 @@ if test "x$GLIB_CFLAGS" = x ; then
fi
dnl Checks for header files
-dnl WARNING: do *NOT* check for "unistd.h" unless you work around the
-dnl following problem:
-dnl
-dnl At least on FreeBSD 3.2, "/usr/include/zlib.h" includes
-dnl "/usr/include/zconf.h", which, if HAVE_UNISTD_H is defined,
-dnl #defines "z_off_t" to be "off_t", and if HAVE_UNISTD_H is
-dnl not defines, #defines "z_off_t" to be "long" if it's not
-dnl already #defined.
-dnl
-dnl In 4.4-Lite-derived systems such as FreeBSD, "off_t" is
-dnl "long long int", not "long int", so the definition of "z_off_t" -
-dnl and therefore the types of the arguments to routines such as
-dnl "gzseek()", as declared, with prototypes, in "zlib.h" - depends
-dnl on whether HAVE_UNISTD_H is defined prior to including "zlib.h"!
-dnl
-dnl It's not defined in the FreeBSD 3.2 "zlib", so if we include "zlib.h"
-dnl after defining HAVE_UNISTD_H, we get a misdeclaration of "gzseek()",
-dnl and, if we're building with "zlib" support, anything that seeks
-dnl on a file may not work.
-dnl
-dnl Other BSDs may have the same problem, if they haven't done something
-dnl such as defining HAVE_UNISTD_H in "zconf.h".
-dnl
-dnl If "config.h" defines HAVE_UNISTD_H - which it will, on all systems
-dnl that have it, if we test for it here, and all 4.4-Lite-derived
-dnl BSDs have it - then, given that "zlib.h" is included by "file.h",
-dnl that means that unless we include "zlib.h" before we include
-dnl "config.h", we get a misdeclaration of "gzseek()".
-dnl
-dnl Unfortunately, it's "config.h" that tells us whether we have "zlib"
-dnl in the first place, so we don't know whether to include "zlib.h"
-dnl until we include "config.h"....
-dnl
-dnl Fortunately, we don't use "unistd.h", so we don't need to check
-dnl for it.
-dnl
-dnl If we ever *do* end up requiring HAVE_UNISTD_H, a fix might be to
-dnl turn "file_seek()" into a subroutine, at least if HAVE_ZLIB is
-dnl defined, have it take an "off_t" as its second argument, and
-dnl put it into a file that doesn't require HAVE_UNISTD_H.
-dnl
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h netinet/in.h unistd.h)