diff --git a/configure.ac b/configure.ac index 724730e..9932dbb 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,7 @@ esac AC_SUBST(WINSOCK2_LIBS) AC_SUBST(DLL_LDFLAGS) -AC_CHECK_HEADERS(windows.h winsock2.h io.h process.h unistd.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/cdefs.h sys/socket.h netinet/in.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h sys/time.h endian.h) +AC_CHECK_HEADERS(windows.h winsock2.h io.h process.h unistd.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/cdefs.h sys/socket.h netinet/in.h arpa/inet.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h sys/time.h endian.h) AC_CHECK_FUNCS(setenv waitpid setrlimit gettimeofday fork kill pipe _pipe) AC_CHECK_FUNCS(open64 __open64 lseek64 __lseek64 mmap64 fopen64 __fopen64 __freopen64 dup dup2 fseeko __fseeko64 __fsetpos64 _IO_getc getline getdelim __getdelim fgetln __srefill __filbuf map_fd memalign posix_memalign aio_read accept bind connect socket readv pread recv recvfrom recvmsg mmap valloc sigaction getpagesize getc_unlocked getchar_unlocked fgetc_unlocked fread_unlocked fgets_unlocked) diff --git a/src/lib-fd.c b/src/lib-fd.c index ea1d1bd..2e31bf1 100644 --- a/src/lib-fd.c +++ b/src/lib-fd.c @@ -49,6 +49,9 @@ #if defined HAVE_NETINET_IN_H # include #endif +#if defined HAVE_ARPA_INET_H +# include +#endif #if defined HAVE_SYS_UIO_H # include #endif diff --git a/src/lib-stream.c b/src/lib-stream.c index 0acad14..7c6359b 100644 --- a/src/lib-stream.c +++ b/src/lib-stream.c @@ -18,7 +18,12 @@ #include "config.h" -#define _GNU_SOURCE /* for getline() and getdelim() */ +/* Needed for getline() and getdelim() */ +#define _GNU_SOURCE + +#if defined HAVE___SREFILL || defined HAVE___FILBUF +# define HAVE_REFILL_STDIO +#endif #if defined HAVE_STDINT_H # include @@ -29,7 +34,7 @@ #include #include -#if defined HAVE___SREFILL && defined HAVE_UNISTD_H +#if defined HAVE_REFILL_STDIO && defined HAVE_UNISTD_H # include /* Needed for __srefill’s lseek() call */ #endif @@ -39,10 +44,6 @@ #include "fuzz.h" #include "fd.h" -#if defined HAVE___SREFILL || defined HAVE___FILBUF -# define HAVE_REFILL_STDIO -#endif - #if defined HAVE___SREFILL int NEW(__srefill)(FILE *fp); #endif