Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137953882
D29902.id87925.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29902.id87925.diff
View Options
Index: sys/sys/cdefs.h
===================================================================
--- sys/sys/cdefs.h
+++ sys/sys/cdefs.h
@@ -718,6 +718,21 @@
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
+/*
+ * glibc enables c11 features when _ISOC11_SOURCE is defined, or when compiling
+ * with -stdc=c11. It's not clear that doing this automatically is standard
+ * complaint. However, definning _ISOC11_SOURCE to enable is compatible with
+ * glibc; standards complaint; and easy enough to do to enable in a Makefile
+ * when porting. We implement this glibc extension, though it has not yet been
+ * standardized. The various POSIX-1 standard issues allow enabling additional
+ * interfaces only when certain feature test macros are defined, which is why
+ * it's not clear that doing so automatically when C11 mode is used on the
+ * compiler is correct (especially when it is the default mode used).
+ */
+#if _ISOC11_SOURCE
+#undef __ISO_C_VISIBLE
+#define __ISO_C_VISIBLE 2011
+#endif
#else
/*-
* Deal with _ANSI_SOURCE:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 3:51 PM (5 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26287489
Default Alt Text
D29902.id87925.diff (1 KB)
Attached To
Mode
D29902: headers: Implement _ISOC11_SOURCES macro when __POSIX_C_SOURCE defined
Attached
Detach File
Event Timeline
Log In to Comment