Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106106555
D29902.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
799 B
Referenced Files
None
Subscribers
None
D29902.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
@@ -718,6 +718,17 @@
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
+/*
+ * Both glibc and OpenBSD enable c11 features when _ISOC11_SOURCE is defined, or
+ * when compiling with -stdc=c11. A strict reading of the standard would suggest
+ * doing it only for the former. However, a strict reading also requires C99
+ * mode only, so building with C11 is already undefined. Follow glibc's and
+ * OpenBSD's lead for this non-standard configuration for maximum compatibility.
+ */
+#if _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
+#undef __ISO_C_VISIBLE
+#define __ISO_C_VISIBLE 2011
+#endif
#else
/*-
* Deal with _ANSI_SOURCE:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 12:25 PM (12 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15604707
Default Alt Text
D29902.diff (799 B)
Attached To
Mode
D29902: headers: Implement _ISOC11_SOURCES macro when __POSIX_C_SOURCE defined
Attached
Detach File
Event Timeline
Log In to Comment