From: Bruno Haible Date: Fri, 7 Apr 2023 21:42:41 +0000 (+0200) Subject: stdio: Fix compilation error in C++ mode on macOS. X-Git-Tag: v1.0~1494 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c33d7e3b40042440e4295f46adff1d94051c74f7;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index a176f12f35..2c802cb369 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-04-07 Bruno Haible + + 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 vasnwprintf-posix tests: Avoid test failure on mingw. diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 0ed3e7595c..69242b6c36 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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