diff --git a/libguile/filesys.c b/libguile/filesys.c index 78a9dff8a..5b23988e3 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -17,9 +17,11 @@ + +/* See stime.c for comments on why _POSIX_C_SOURCE is not always defined. */ #define _GNU_SOURCE /* ask glibc for everything */ -#ifndef __MINGW32__ -#define _POSIX_C_SOURCE 199506L /* for readdir_r elsewhere */ +#ifdef __hpux +#define _POSIX_C_SOURCE 199506L /* for readdir_r */ #endif #if HAVE_CONFIG_H diff --git a/libguile/stime.c b/libguile/stime.c index 32b58f4d4..dce728053 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -18,8 +18,21 @@ +/* _POSIX_C_SOURCE is not defined always, because it causes problems on some + systems, notably + + - FreeBSD loses all BSD and XOPEN defines. + - glibc loses some things like CLK_TCK. + - On MINGW it conflicts with the pthread headers. + + But on HP-UX _POSIX_C_SOURCE is needed, as noted, for gmtime_r. + + Perhaps a configure test could figure out what _POSIX_C_SOURCE gives and + what it takes away, and decide from that whether to use it, instead of + hard coding __hpux. */ + #define _GNU_SOURCE /* ask glibc for everything, in particular strptime */ -#ifndef __MINGW32__ +#ifdef __hpux #define _POSIX_C_SOURCE 199506L /* for gmtime_r prototype */ #endif