]> Savannah Git Hosting - gnulib.git/commitdiff
stdio: port better to older macOS
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Nov 2023 18:50:30 +0000 (10:50 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Nov 2023 18:50:30 +0000 (10:50 -0800)
* lib/stdio.in.h: Do not define _POSIX_C_SOURCE on older macOS,
as it is not needed and defining it causes other problems.
Problem reported by Sevan Janiyan in:
https://mail.gnu.org/r/bug-gnulib/2023-11/msg00039.html

ChangeLog
lib/stdio.in.h

index 0c49471d04bf214a123bfa0834f1df3bfd873355..b8fd98a2b1c11a594cfd0ccec4fded00461e173b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-11-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdio: port better to older macOS
+       * lib/stdio.in.h: Do not define _POSIX_C_SOURCE on older macOS,
+       as it is not needed and defining it causes other problems.
+       Problem reported by Sevan Janiyan in:
+       https://mail.gnu.org/r/bug-gnulib/2023-11/msg00039.html
+
 2023-11-09  Bruno Haible  <bruno@clisp.org>
 
        rand: Add tests.
index 118874d877dc9d6f1c848c58657a01a75f0b7f74..22b5ca46b23327871de5cbfb8550d16723519662 100644 (file)
 
 /* Suppress macOS deprecation warnings for sprintf and vsprintf.  */
 #if (defined __APPLE__ && defined __MACH__) && !defined _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-# define _GL_DEFINED__POSIX_C_SOURCE
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+#  include <AvailabilityMacros.h>
+# endif
+# if (defined MAC_OS_X_VERSION_MIN_REQUIRED \
+      && 101300 <= MAC_OS_X_VERSION_MIN_REQUIRED)
+#  define _POSIX_C_SOURCE 200809L
+#  define _GL_DEFINED__POSIX_C_SOURCE
+# endif
 #endif
 
 #define _GL_ALREADY_INCLUDING_STDIO_H