X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FPosixSource.h;h=d139dd50af65bdb9ae178a7a706d42ddc8536915;hb=26f4bfc82f2b2359259578e9c54d476fc2de650f;hp=cd1aeea34cfbf715fc9e5713869b83b90fcbe7fc;hpb=a2a67cd520b9841114d69a87a423dabcb3b4368e;p=ghc-hetmet.git diff --git a/rts/PosixSource.h b/rts/PosixSource.h index cd1aeea..d139dd5 100644 --- a/rts/PosixSource.h +++ b/rts/PosixSource.h @@ -9,11 +9,30 @@ #ifndef POSIXSOURCE_H #define POSIXSOURCE_H +#include + +#if defined(freebsd_HOST_OS) +#define _POSIX_C_SOURCE 200112L +#define _XOPEN_SOURCE 600 +#else #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 199506L #define _XOPEN_SOURCE 500 +// 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 -/* Let's be ISO C99 too... */ +#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 +#endif #endif /* POSIXSOURCE_H */