(_POSIX_C_SOURCE): Use this only on hpux, it
authorKevin Ryde <user42@zip.com.au>
Wed, 8 Sep 2004 22:14:59 +0000 (22:14 +0000)
committerKevin Ryde <user42@zip.com.au>
Wed, 8 Sep 2004 22:14:59 +0000 (22:14 +0000)
causes too many problems elsewhere (glibc, freebsd, mingw).  Reported
by Andreas Vögele.

libguile/filesys.c
libguile/stime.c

index 78a9dff..5b23988 100644 (file)
 
 
 \f
+
+/* 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
index 32b58f4..dce7280 100644 (file)
 
 \f
 
+/* _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