Switch to using the 'rubenvb' mingw builds
[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 #if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)
15 #define _POSIX_C_SOURCE 200112L
16 #define _XOPEN_SOURCE 600
17 #else
18 #define _POSIX_SOURCE 1
19 #define _POSIX_C_SOURCE 199506L
20 #define _XOPEN_SOURCE 500
21 // FreeBSD takes a different approach to _ISOC99_SOURCE: on FreeBSD it
22 // means "I want *just* C99 things", whereas on GNU libc and Solaris
23 // it means "I also want C99 things".
24 //
25 // On both GNU libc and FreeBSD, _ISOC99_SOURCE is implied by
26 // _XOPEN_SOURCE==600, but on Solaris it is an error to omit it.
27 #define _ISOC99_SOURCE
28 // Defining __USE_MINGW_ANSI_STDIO is the most portable way to tell
29 // mingw that we want to use the standard %lld style format specifiers,
30 // rather than the Windows %I64d style
31 #define __USE_MINGW_ANSI_STDIO 1
32 #endif
33
34 #if defined(darwin_HOST_OS)
35 /* If we don't define this the including sysctl breaks with things like
36 /usr/include/bsm/audit.h:224:0:
37 error: syntax error before 'u_char'
38 */
39 #define _DARWIN_C_SOURCE 1
40 #endif
41
42 #endif /* POSIXSOURCE_H */