summaryrefslogtreecommitdiff
path: root/fmacros.h
diff options
context:
space:
mode:
authornot-a-robot <not-a-robot@rediger.net>2016-05-12 09:44:47 +0200
committernot-a-robot <not-a-robot@rediger.net>2016-05-12 09:44:47 +0200
commite93c05a7aa64736c91e455322c83181e8e67cd0e (patch)
tree93394aadaeae33c90a9ae0ee19f4b3f51ed0deac /fmacros.h
parent8ef4c472f85b8c964c3f5637de299d52cf17bf2d (diff)
parentbb1747b1bf92431e5c5e9699824d2ef52f863f45 (diff)
Auto merge of #378 - thomaslee:tom_fix_kfreebsd, r=badboy
Fix strerror_r on some esoteric platforms Defining _XOPEN_SOURCE=1 causes strange behavior on Debian kfreebsd archs -- i.e. the GNU userspace with FreeBSD kernel -- when _GNU_SOURCE is not defined (the default). Not sure I fully understand the bizarre semantics, but it seems to use the XSI-compliant interface (int strerror_r(int, char*, size_t)) but the GNU implementation (char *strerror_r(int, char*, size_t)) such that strerror_r returns 32-bits of a 64-bit char * on x86_64 kfreebsd. We would expect strerror_r to return zero when using the XSI-compliant strerror_r implementation or a 64-bit char* when using the GNU version. Instead, we get something in between! Unless I'm missing something, being more explicit about what version of _XOPEN_SOURCE we want seems to be the prudent thing to do here -- and if folks want the GNU implementation of strerror_r for some reason they can always -D_GNU_SOURCE explicitly.
Diffstat (limited to 'fmacros.h')
-rw-r--r--fmacros.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/fmacros.h b/fmacros.h
index 7635180..24c9bac 100644
--- a/fmacros.h
+++ b/fmacros.h
@@ -12,10 +12,8 @@
#if defined(__sun__)
#define _POSIX_C_SOURCE 200112L
-#elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__)
-#define _XOPEN_SOURCE 600
#else
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
#endif
#if defined(__APPLE__) && defined(__MACH__)