[svn-r4015] Purpose:

Code cleanup
Description:
    Several system functions don't have prototypes on Linux machines with our
    current compile flags.
Solution:
    Add _POSIX_SOURCE and _BSD_SOURCE macros to the compile line when compiling
    on Linux machines, to pick up missing prototypes.
Platforms tested:
    Linux (eirene), FreeBSD 4.3 (hawkwind)
This commit is contained in:
Quincey Koziol 2001-06-19 11:18:42 -05:00
parent 0a063ad481
commit 609950e388
2 changed files with 495 additions and 484 deletions

968
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -415,7 +415,7 @@ AC_HEADER_TIME
dnl Unix
AC_CHECK_HEADERS(sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h)
AC_CHECK_HEADERS(sys/socket.h sys/types.h)
AC_CHECK_HEADERS(stddef.h setjmp.h)
AC_CHECK_HEADERS(stddef.h setjmp.h features.h)
AC_CHECK_HEADERS(stdint.h, C9x=yes)
dnl Windows
AC_CHECK_HEADERS(io.h winsock.h sys/timeb.h)
@ -453,6 +453,15 @@ case "$host_cpu-$host_vendor-$host_os" in
fi
done
fi)
dnl Add POSIX support on Linux systems, so <features.h> defines
dnl __USE_POSIX, which is required to get the prototype for fdopen
dnl defined correctly in <stdio.h>
CPPFLAGS="-D_POSIX_SOURCE $CPPFLAGS"
dnl Also add BSD support on Linux systems, so <features.h> defines
dnl __USE_BSD, which is required to get the prototype for strdup
dnl defined correctly in <string.h> and snprintf & vsnprintf defined
dnl correctly in <stdio.h>
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
;;
esac