|
From: Keith M. <no...@so...> - 2017-06-12 19:22:02
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The branch, 5.0-active has been updated
via 16ab58171b55e2959b97866b6fc8e913615c8e03 (commit)
from 1cf415906a7b483690ef3db9793c17da5e01da97 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sf.net/p/mingw/mingw-org-wsl/ci/16ab58171b55e2959b97866b6fc8e913615c8e03/
commit 16ab58171b55e2959b97866b6fc8e913615c8e03
Author: Keith Marshall <kei...@us...>
Date: Mon Jun 5 20:15:12 2017 +0100
Automatically correct obsolete _XOPEN_SOURCE usage.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 2765231..6b604b3 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,12 @@
+2017-06-05 Keith Marshall <kei...@us...>
+
+ Automatically correct obsolete _XOPEN_SOURCE usage.
+
+ * include/_mingw.h.in (__paste, __valueless): New macros; define them.
+ (_XOPEN_SOURCE) [defined with no value]: Use them to attempt to deduce
+ this obsolete usage; if detected, redefine it with a default assigned
+ value of one, emulating -D_XOPEN_SOURCE command line definition.
+
2017-05-24 Keith Marshall <kei...@us...>
Fix snprintf()/vsnprintf() -Wformat vs. multiple definition issue.
diff --git a/mingwrt/include/_mingw.h.in b/mingwrt/include/_mingw.h.in
index 5e54a22..1cd2b57 100644
--- a/mingwrt/include/_mingw.h.in
+++ b/mingwrt/include/_mingw.h.in
@@ -401,6 +401,31 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
# endif
#endif
+/* Some applications may define _XOPEN_SOURCE, without assigning any
+ * value to it. Such usage may have been permitted in early SUS, but
+ * it became obsolete as of SUSv2. Attempt to detect obsolete usage,
+ * as it makes an effective evaluation of any _XOPEN_SOURCE version
+ * dependency difficult, (without the use of ugly kludges at EVERY
+ * point of reference which attempts a version comparison).
+ */
+#define __paste(prefix,suffix) prefix ## suffix
+#define __valueless(token) ((token - 0) == 0) && (__paste(token,10) == 10)
+
+#if defined _XOPEN_SOURCE && __valueless(_XOPEN_SOURCE)
+/* _XOPEN_SOURCE appears to have been defined without its mandatory
+ * value; diagnose this brain-damaged obsolete usage (verbosely)...
+ */
+#warning "_XOPEN_SOURCE seems to have been improperly defined."
+#warning "Mandatory _XOPEN_SOURCE value assignment appears to be missing."
+#warning "Redefining _XOPEN_SOURCE to mitigate obsolete misuse."
+
+/* ...and redefine, emulating implicit behaviour of -D_XOPEN_SOURCE on
+ * the GCC command line, (which DOES assign an implied value of one).
+ */
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+
#ifndef _POSIX_C_SOURCE
/* Users may define this, either directly or indirectly, to explicitly
* enable a particular level of visibility for the subset of those POSIX
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 9 +++++++++
mingwrt/include/_mingw.h.in | 25 +++++++++++++++++++++++++
2 files changed, 34 insertions(+)
hooks/post-receive
--
Repository: mingw-org-wsl
|