From 3c7767ef789712844a47d4e5360a65f542753694 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Sat, 26 Oct 2019 10:33:12 +0100 Subject: [PATCH] Fix MinGW-Issue #39757; avoid multiple vsnprintf() definitions. --- mingwrt/ChangeLog | 8 ++++++++ mingwrt/include/stdio.h | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 2dcced4..86c8b1b 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,11 @@ +2019-10-26 Keith Marshall + + Fix MinGW-Issue #39757; avoid multiple vsnprintf() definitions. + + * include/stdio.h [C++] (__mingw_stdio_redirect__): Defer redirection + to in-line definitions applicable for C, when the compiler suite is... + [__GNUC__]: ...this. + 2019-10-16 Keith Marshall Address MinGW-Issue #39677; declare _findclose() only once. diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h index 8ee3624..124d752 100644 --- a/mingwrt/include/stdio.h +++ b/mingwrt/include/stdio.h @@ -379,26 +379,26 @@ extern unsigned int _mingw_output_format_control( unsigned int, unsigned int ); /* User has expressed a preference for C99 conformance... */ # undef __mingw_stdio_redirect__ -# ifdef __cplusplus -/* For C++ we use inline implementations, to avoid interference - * with namespace qualification, which may result from using #defines. - */ -# define __mingw_stdio_redirect__ inline __cdecl __MINGW_NOTHROW - -# elif defined __GNUC__ +# if defined __GNUC__ /* FIXME: Is there any GCC version prerequisite here? * - * We also prefer inline implementations for C, when we can be confident - * that the GNU specific __inline__ mechanism is supported. + * We prefer inline implementations for both C and C++, when we can be + * confident that the GNU specific __inline__ mechanism is supported. */ # define __mingw_stdio_redirect__ static __inline__ __cdecl __MINGW_NOTHROW -# else /* Neither C++ nor __GNUC__ */ +# elif defined __cplusplus +/* For non-GNU C++ we use inline implementations, to avoid interference + * with namespace qualification, which may result from using #defines. + */ +# define __mingw_stdio_redirect__ inline __cdecl __MINGW_NOTHROW + +# else /* Neither GCC, nor non-GNU C++ */ /* Can't use inlines; fall back on module local static stubs. */ # define __mingw_stdio_redirect__ static __cdecl __MINGW_NOTHROW -# endif /* Neither C++ nor __GNUC__ */ +# endif /* Neither GCC, nor non-GNU C++ */ #endif /* __USE_MINGW_ANSI_STDIO || defined _ISOC99_SOURCE */ #if __USE_MINGW_ANSI_STDIO -- 2.11.0