From b8b63a010000744162220bbe5d910b3de306d5fe Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 20 Dec 2021 16:53:35 +0100 Subject: [PATCH] Make libintl printf functions available in std namespace When using the #define f libintl_f the define will change the identifiers even in std::f This allows such uses to compile anyway --- gettext-runtime/intl/libgnuintl.in.h | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h index 19104ca0f..43b51fd1a 100644 --- a/gettext-runtime/intl/libgnuintl.in.h +++ b/gettext-runtime/intl/libgnuintl.in.h @@ -359,11 +359,17 @@ extern char *bind_textdomain_codeset (const char *__domainname, #undef fprintf #define fprintf libintl_fprintf extern int fprintf (FILE *, const char *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_fprintf; } +#endif #endif #if !((defined vfprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vfprintf) /* don't override gnulib */ #undef vfprintf #define vfprintf libintl_vfprintf extern int vfprintf (FILE *, const char *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vfprintf; } +#endif #endif #if !((defined printf && defined _GL_STDIO_H) || defined GNULIB_overrides_printf) /* don't override gnulib */ @@ -382,22 +388,34 @@ extern int vfprintf (FILE *, const char *, va_list); #endif #define printf libintl_printf extern int printf (const char *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_printf; } +#endif #endif #if !((defined vprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vprintf) /* don't override gnulib */ #undef vprintf #define vprintf libintl_vprintf extern int vprintf (const char *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vprintf; } +#endif #endif #if !((defined sprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_sprintf) /* don't override gnulib */ #undef sprintf #define sprintf libintl_sprintf extern int sprintf (char *, const char *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_sprintf; } +#endif #endif #if !((defined vsprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vsprintf) /* don't override gnulib */ #undef vsprintf #define vsprintf libintl_vsprintf extern int vsprintf (char *, const char *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vsprintf; } +#endif #endif #if @HAVE_SNPRINTF@ @@ -406,11 +424,17 @@ extern int vsprintf (char *, const char *, va_list); #undef snprintf #define snprintf libintl_snprintf extern int snprintf (char *, size_t, const char *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_snprintf; } +#endif #endif #if !((defined vsnprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vsnprintf) /* don't override gnulib */ #undef vsnprintf #define vsnprintf libintl_vsnprintf extern int vsnprintf (char *, size_t, const char *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vsnprintf; } +#endif #endif #endif @@ -421,11 +445,17 @@ extern int vsnprintf (char *, size_t, const char *, va_list); #undef asprintf #define asprintf libintl_asprintf extern int asprintf (char **, const char *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_asprintf; } +#endif #endif #if !((defined vasprintf && defined _GL_STDIO_H) || defined GNULIB_overrides_vasprintf) /* don't override gnulib */ #undef vasprintf #define vasprintf libintl_vasprintf extern int vasprintf (char **, const char *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vasprintf; } +#endif #endif #endif @@ -435,23 +465,41 @@ extern int vasprintf (char **, const char *, va_list); #undef fwprintf #define fwprintf libintl_fwprintf extern int fwprintf (FILE *, const wchar_t *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_fwprintf; } +#endif #undef vfwprintf #define vfwprintf libintl_vfwprintf extern int vfwprintf (FILE *, const wchar_t *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vfwprintf; } +#endif #undef wprintf #define wprintf libintl_wprintf extern int wprintf (const wchar_t *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_wprintf; } +#endif #undef vwprintf #define vwprintf libintl_vwprintf extern int vwprintf (const wchar_t *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vwprintf; } +#endif #undef swprintf #define swprintf libintl_swprintf extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); +#ifdef __cplusplus +namespace std { using ::libintl_swprintf; } +#endif #undef vswprintf #define vswprintf libintl_vswprintf extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); +#ifdef __cplusplus +namespace std { using ::libintl_vswprintf; } +#endif #endif -- 2.33.0