Wednesday, 7 August 2019

[gccsdk] Patch to correctly set _XOPEN_SOURCE when _POSIX_C_SOURCE is defined

Index: recipe/files/gcc/libunixlib/include/features.h
===================================================================
--- recipe/files/gcc/libunixlib/include/features.h (revision 7208)
+++ recipe/files/gcc/libunixlib/include/features.h (working copy)
@@ -235,13 +235,13 @@
#endif

#if (_POSIX_C_SOURCE - 0) >= 200112L
-# define __USE_XOPEN2K 1
-# undef __USE_ISOC99
-# define __USE_ISOC99 1
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
#endif

#if (_POSIX_C_SOURCE - 0) >= 200809L
-# define __USE_XOPEN2K8 1
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 700
# undef _ATFILE_SOURCE
# define _ATFILE_SOURCE 1
#endif
Hi

This patch ensures that _XOPEN_SOURCE is set correctly when _POSIX_C_SOURCE is greater than or equal to 200112L. Previously, defining _POSIX_C_SOURCE to 200112L would enable XPG6 functions, but not functions for earlier XPG versions.


Regards
Cameron

No comments:

Post a Comment