>From 44dc586d2511adfd708c0a9000663ac4c2ab8579 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 18 Apr 2024 00:21:18 +0200 Subject: [PATCH 2/2] 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. --- ChangeLog | 7 +++++++ lib/stdio.in.h | 16 ++++++++-------- lib/utime.in.h | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0890c3c43e..faabf767a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-04-17 Bruno Haible + + 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 Fix linkage errors when using C++. diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 4947307e57..35b9f74821 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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 diff --git a/lib/utime.in.h b/lib/utime.in.h index 378427fe6e..fb49941f9f 100644 --- a/lib/utime.in.h +++ b/lib/utime.in.h @@ -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 -- 2.34.1