From 819cbf9b5b9658409e4ebc15bf3fbad1625c4f27 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 9 Apr 2022 16:38:43 +0300 Subject: [PATCH 44/44] Make crosser Qt-client build work when nls has been enabled See osdn #44294 Signed-off-by: Marko Lindqvist --- utility/fcintl.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/utility/fcintl.h b/utility/fcintl.h index 68d4164ea7..ff876eae5b 100644 --- a/utility/fcintl.h +++ b/utility/fcintl.h @@ -32,7 +32,23 @@ extern "C" { * we don't want defined when nls is disabled. */ #ifdef FREECIV_HAVE_LIBINTL_H #include -#endif + +/* Ugly hacks to make nls-enabled builds work with libintl.h in crosser + * The problems came up in some C++ headers where functions by the same + * name as these global wrappers were used. As such, the libintl.h + * header is semantically wrong everywhere, not just in crosser, + * but crosser is the only environment where we know it to cause actual + * problems (failing build). As this workaround isn't semantically correct + * either, by limiting these adjustments to crosser, and even there only + * to C++ compilations, we get both + * 1) crosser build to go through + * 2) we are not accidentally breaking any other environment + */ +#if defined(FREECIV_CROSSER) && defined(__cplusplus) +#undef vswprintf +#endif /* FREECIV_CROSSER */ + +#endif /* FREECIV_HAVE_LIBINTL_H */ /* Core freeciv */ #define _(String) gettext(String) -- 2.35.1