]> Savannah Git Hosting - gnulib.git/commitdiff
stdio: Fix compilation error in C++ mode on macOS.
authorBruno Haible <bruno@clisp.org>
Fri, 7 Apr 2023 21:42:41 +0000 (23:42 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 7 Apr 2023 21:42:41 +0000 (23:42 +0200)
* lib/stdio.in.h (getw, putw): Repeat the declaration even if the
function is already supposed to be declared.

ChangeLog
lib/stdio.in.h

index a176f12f3530b93bebbebca210af401ca54b596b..2c802cb369406e4711fc65647c1bcd71327552b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-07  Bruno Haible  <bruno@clisp.org>
+
+       stdio: Fix compilation error in C++ mode on macOS.
+       * lib/stdio.in.h (getw, putw): Repeat the declaration even if the
+       function is already supposed to be declared.
+
 2023-04-07  Bruno Haible  <bruno@clisp.org>
 
        vasnwprintf-posix tests: Avoid test failure on mingw.
index 0ed3e7595cb6fbcd78b65fcb4f8c404ea3e3945b..69242b6c3658466fe7834322bd3ea19f7c767d9b 100644 (file)
@@ -998,6 +998,10 @@ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 _GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
 # else
 #  if @HAVE_DECL_GETW@
+#   if defined __APPLE__ && defined __MACH__
+/* The presence of the declaration depends on _POSIX_C_SOURCE.  */
+_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream));
+#   endif
 _GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
 #  endif
 # endif
@@ -1241,6 +1245,10 @@ _GL_CXXALIASWARN (puts);
 _GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
 # else
 #  if @HAVE_DECL_PUTW@
+#   if defined __APPLE__ && defined __MACH__
+/* The presence of the declaration depends on _POSIX_C_SOURCE.  */
+_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream));
+#   endif
 _GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
 #  endif
 # endif