Another attempt to get these #defines right
[ghc.git] / rts / PosixSource.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2005
4 *
5 * Include this file into sources which should not need any non-Posix services.
6 * That includes most RTS C sources.
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef POSIXSOURCE_H
10 #define POSIXSOURCE_H
11
12 #include <ghcplatform.h>
13
14 #define _POSIX_C_SOURCE 200112L
15 #define _XOPEN_SOURCE 600
16
17 #if !defined(freebsd_HOST_OS)
18 // FreeBSD takes a different approach to _ISOC99_SOURCE: on FreeBSD it
19 // means "I want *just* C99 things", whereas on GNU libc and Solaris
20 // it means "I also want C99 things".
21 //
22 // On both GNU libc and FreeBSD, _ISOC99_SOURCE is implied by
23 // _XOPEN_SOURCE==600, but on Solaris it is an error to omit it.
24 //
25 #define _ISOC99_SOURCE
26 #endif
27
28 #if defined(darwin_HOST_OS)
29 /* If we don't define this the including sysctl breaks with things like
30 /usr/include/bsm/audit.h:224:0:
31 error: syntax error before 'u_char'
32 */
33 #define _DARWIN_C_SOURCE 1
34 #endif
35
36 #endif /* POSIXSOURCE_H */