From 464ee095ff7320be43e67edcc99829237eeff901 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Wed, 8 Sep 2004 22:14:59 +0000 Subject: [PATCH] =?UTF-8?q?(=5FPOSIX=5FC=5FSOURCE):=20Use=20this=20only=20?= =?UTF-8?q?on=20hpux,=20it=20causes=20too=20many=20problems=20elsewhere=20?= =?UTF-8?q?(glibc,=20freebsd,=20mingw).=20=20Reported=20by=20Andreas=20V?= =?UTF-8?q?=C3=B6gele.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libguile/filesys.c | 6 ++++-- libguile/stime.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) 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