summaryrefslogtreecommitdiff
path: root/rts/PosixSource.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/PosixSource.h')
-rw-r--r--rts/PosixSource.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/rts/PosixSource.h b/rts/PosixSource.h
index f4b880e525..0ba74dfa69 100644
--- a/rts/PosixSource.h
+++ b/rts/PosixSource.h
@@ -21,18 +21,21 @@
9945:2002 or UNIX 03 and SUSv3.
Please also see trac ticket #11757 for more information about switch
to C99/C11.
-*/
-#define _POSIX_C_SOURCE 200112L
-#define _XOPEN_SOURCE 600
-#define __USE_MINGW_ANSI_STDIO 1
+ However, the use of `strnlen`, which is strictly speaking only available in
+ IEEE Std 1003.1-2008 (XPG7), requires lifting the bounds, to be able to
+ compile ghc on systems that are strict about enforcing the standard, e.g.
+ Apples mobile platforms.
+
+ Oracle's Solaris 11 supports only up to XPG6, hence the ifdef.
+ */
-#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:
- error: syntax error before 'u_char'
-*/
-#define _DARWIN_C_SOURCE 1
+#if defined(solaris2_HOST_OS)
+#define _POSIX_C_SOURCE 200112L
+#define _XOPEN_SOURCE 600
+#else
+#define _POSIX_C_SOURCE 200809L
+#define _XOPEN_SOURCE 700
#endif
#endif /* POSIXSOURCE_H */