summaryrefslogtreecommitdiff
path: root/Xosdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'Xosdefs.h')
-rw-r--r--Xosdefs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Xosdefs.h b/Xosdefs.h
index a0b2e3e..ee33a32 100644
--- a/Xosdefs.h
+++ b/Xosdefs.h
@@ -135,9 +135,18 @@ in this Software without prior written authorization from The Open Group.
#ifdef __APPLE__
#define NULL_NOT_ZERO
+
+/* Defining any of these will sanitize the namespace to JUST want is defined by
+ * that particular standard. If that happens, we don't get some expected
+ * prototypes, typedefs, etc (like fd_mask). We can define _DARWIN_C_SOURCE to
+ * loosen our belts a tad.
+ */
+#if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
#define _DARWIN_C_SOURCE
#endif
+#endif
+
#ifdef __GNU__
#ifndef PATH_MAX
#define PATH_MAX 4096