* Fix a compilation issue on FreeBSD by defining _BSD_SOURCE and including

<sys/cdefs.h>.
This commit is contained in:
Sam Hocevar 2008-07-15 20:15:47 +00:00 committed by sam
parent 1653045c19
commit cacdf20050
2 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,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/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 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 lseek64 mmap64 fopen64 dup dup2 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill 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)

View File

@ -20,6 +20,8 @@
/* Need this for RTLD_NEXT */
#define _GNU_SOURCE
/* Need this for MAP_ANON and valloc() on FreeBSD (together with cdefs.h) */
#define _BSD_SOURCE
/* Use this to get mmap64() on glibc systems */
#define _LARGEFILE64_SOURCE
/* Use this to get posix_memalign */
@ -37,6 +39,9 @@
#include <errno.h>
#include <signal.h>
#if defined HAVE_SYS_CDEFS_H
# include <sys/cdefs.h>
#endif
#if defined HAVE_MALLOC_H
# include <malloc.h>
#endif