]> Savannah Git Hosting - gnulib.git/commitdiff
stdio, utime-h: Fix more linkage errors when using C++.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Apr 2024 22:21:18 +0000 (00:21 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 17 Apr 2024 22:31:11 +0000 (00:31 +0200)
* lib/stdio.in.h (rpl_fwrite, rpl_fwrite_unlocked): Use _GL_EXTERN_C
instead of extern.
* lib/utime.in.h (_gl_utimens_windows): Likewise.

ChangeLog
lib/stdio.in.h
lib/utime.in.h

index 0890c3c43e745198ee7903ee383a034d03fdcd58..faabf767a0b2784c35337899fc97063207bd238f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-17  Bruno Haible  <bruno@clisp.org>
+
+       stdio, utime-h: Fix more linkage errors when using C++.
+       * lib/stdio.in.h (rpl_fwrite, rpl_fwrite_unlocked): Use _GL_EXTERN_C
+       instead of extern.
+       * lib/utime.in.h (_gl_utimens_windows): Likewise.
+
 2024-04-17  Bruno Haible  <bruno@clisp.org>
 
        Fix linkage errors when using C++.
index 4947307e578e9ffc6417fa9adb2e83caf1b32224..35b9f748219b374b6aaaffdd1731323e341b7385 100644 (file)
@@ -907,14 +907,14 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
        && !defined __cplusplus)
 #   undef fwrite
 #   undef fwrite_unlocked
-extern size_t __REDIRECT (rpl_fwrite,
-                          (const void *__restrict, size_t, size_t,
-                           FILE *__restrict),
-                          fwrite);
-extern size_t __REDIRECT (rpl_fwrite_unlocked,
-                          (const void *__restrict, size_t, size_t,
-                           FILE *__restrict),
-                          fwrite_unlocked);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite,
+                                (const void *__restrict, size_t, size_t,
+                                 FILE *__restrict),
+                                fwrite);
+_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite_unlocked,
+                                (const void *__restrict, size_t, size_t,
+                                 FILE *__restrict),
+                                fwrite_unlocked);
 #   define fwrite rpl_fwrite
 #   define fwrite_unlocked rpl_fwrite_unlocked
 #  endif
index 378427fe6e823d02930a4fd36dac6a2f96dfdc63..fb49941f9f7ab75b6621f1a8cf23af767e259f85 100644 (file)
@@ -116,7 +116,7 @@ _GL_CXXALIASWARN (utime);
 #endif
 
 #if @GNULIB_UTIME@
-extern int _gl_utimens_windows (const char *filename, struct timespec ts[2]);
+_GL_EXTERN_C int _gl_utimens_windows (const char *filename, struct timespec ts[2]);
 #endif