OSDN Git Service

Add support for POSIX.1 "obsolescence" warnings.
authorKeith Marshall <keith@users.osdn.me>
Thu, 14 Dec 2017 23:42:03 +0000 (23:42 +0000)
committerKeith Marshall <keith@users.osdn.me>
Thu, 14 Dec 2017 23:42:03 +0000 (23:42 +0000)
mingwrt/ChangeLog
mingwrt/include/_mingw.h.in

index f4568ef..b006185 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-14  Keith Marshall  <keith@users.osdn.me>
+
+       Add support for POSIX.1 "obsolescence" warnings.
+
+       * include/_mingwrt.h.in (__POSIX_1995_DEPRECATED)
+       (__POSIX_2001_DEPRECATED, __POSIX_2008_DEPRECATED): New macros; define
+       them, such as each is conditional on the specific value assigned to...
+       [_POSIX_C_SOURCE]: ...this feature test macro, as the equivalent of...
+       (__MINGW_ATTRIB_DEPRECATED): ...this, or of nothing, as appropriate.
+
 2017-12-06  Keith Marshall  <keith@users.osdn.me>
 
        Prepare and publish MinGW.org WSL-5.0.2 release.
index 1cd2b57..e5c6b86 100644 (file)
@@ -478,6 +478,49 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case.  */
 # endif
 #endif
 
+#if _POSIX_C_SOURCE >= 199506L
+/* Conformance with POSIX.1-1996 has been requested; ensure that any
+ * interfaces which have been marked as "obsolescent", from this POSIX
+ * version onwards, will be reported as "deprecated", at point of use.
+ */
+# define __POSIX_1995_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
+
+#if _POSIX_C_SOURCE >= 200112L
+/* Conformance with POSIX.1-2001 has been requested; ensure that any
+ * interfaces which have been marked as "obsolescent", from this POSIX
+ * version onwards, will be reported as "deprecated", at point of use.
+ */
+# define __POSIX_2001_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
+
+#if _POSIX_C_SOURCE >= 200809L
+/* Conformance with POSIX.1-2008 has been requested; ensure that any
+ * interfaces which have been marked as "obsolescent", from this POSIX
+ * version onwards, will be reported as "deprecated", at point of use.
+ */
+# define __POSIX_2008_DEPRECATED  __MINGW_ATTRIB_DEPRECATED
+
+#else
+/* POSIX.1-2008 conformance is NOT required; do not object to use of
+ * interfaces which became "obsolescent" in this POSIX version, but
+ * were still fully supported in earlier versions.
+ */
+# define __POSIX_2008_DEPRECATED
+#endif
+#else
+/* POSIX.1-2001 conformance is NOT required; do not object to use of
+ * interfaces which became "obsolescent" in this POSIX version, but
+ * were still fully supported in earlier versions.
+ */
+# define __POSIX_2001_DEPRECATED
+#endif
+#else
+/* POSIX.1-1996 conformance is NOT required; do not object to use of
+ * interfaces which became "obsolescent" in this POSIX version, but
+ * were still fully supported in earlier versions.
+ */
+# define __POSIX_1995_DEPRECATED
+#endif
+
 #ifndef _ISOC99_SOURCE
  /* libmingwex.a provides free-standing implementations for many of the
   * functions which were introduced in C99; MinGW headers do not expose