Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154795437
D47584.id146477.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
983 B
Referenced Files
None
Subscribers
None
D47584.id146477.diff
View Options
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -513,7 +513,14 @@
#define _POSIX_C_SOURCE 199209
#endif
-/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
+/*
+ * Deal with various X/Open Portability Guides and Single UNIX Spec. We use the
+ * '- 0' construct so software that defines _XOPEN_SOURCE to nothing doesn't
+ * cause errors. X/Open CAE Specification, August 1994, System Interfaces and
+ * Headers, Issue 4, Version 2 section 2.2 states an empty definition means the
+ * same thing as _POSIX_C_SOURCE == 2. This broadly mirrors "System V Interface
+ * Definition, Fourth Edition", but earlier editions suggest some ambiguity.
+ */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 800
#define __XSI_VISIBLE 800
@@ -531,6 +538,9 @@
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
+#else
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 199209
#endif
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 11:25 AM (22 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32503167
Default Alt Text
D47584.id146477.diff (983 B)
Attached To
Mode
D47584: cdefs.h: Document the _XOPEN_SOURCE - 0 construct
Attached
Detach File
Event Timeline
Log In to Comment