summaryrefslogtreecommitdiff
path: root/rts/PosixSource.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-05-25 15:43:13 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-05-25 15:43:13 +0000
commit1ea69bc6f349729ca858435e559b31b012f0d69a (patch)
treee66edfbae8243942d812646d4db7a9a4fdff7e55 /rts/PosixSource.h
parent88223168614ea60a5d76a264f6c11837b6c5a443 (diff)
downloadhaskell-1ea69bc6f349729ca858435e559b31b012f0d69a.tar.gz
Another attempt to get these #defines right
Apparently on Solaris it is an error to omit _ISOC99_SOURCE when using _POSIX_C_SOURCE==200112L.
Diffstat (limited to 'rts/PosixSource.h')
-rw-r--r--rts/PosixSource.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/rts/PosixSource.h b/rts/PosixSource.h
index 23101ea470..fa61b99926 100644
--- a/rts/PosixSource.h
+++ b/rts/PosixSource.h
@@ -14,6 +14,17 @@
#define _POSIX_C_SOURCE 200112L
#define _XOPEN_SOURCE 600
+#if !defined(freebsd_HOST_OS)
+// FreeBSD takes a different approach to _ISOC99_SOURCE: on FreeBSD it
+// means "I want *just* C99 things", whereas on GNU libc and Solaris
+// it means "I also want C99 things".
+//
+// On both GNU libc and FreeBSD, _ISOC99_SOURCE is implied by
+// _XOPEN_SOURCE==600, but on Solaris it is an error to omit it.
+//
+#define _ISOC99_SOURCE
+#endif
+
#if defined(darwin_HOST_OS)
/* If we don't define this the including sysctl breaks with things like
/usr/include/bsm/audit.h:224:0: