common.h: undefine more stupid preprocessor defines from libintl.h

libintl defines symbols such as 'fprintf', 'snprintf' or 'sprintf' to
'libintl_<original_name>' on certain platforms such as mingw or macOS.
'std::snprintf' becomes 'std::libiuntl_snprintf', which doesn't exist.

This conflicts with jpcre2.hpp which uses 'std::fprintf' and
'std::sprintf'.
This commit is contained in:
Moritz Bunkus 2020-08-21 16:43:56 +02:00
parent 860a77f33c
commit bf4b0785f9
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -74,7 +74,9 @@ using namespace std::string_literals;
// libintl defines 'snprintf' to 'libintl_snprintf' on certain
// platforms such as mingw or macOS. 'std::snprintf' becomes
// 'std::libintl_snprintf' which doesn't exist.
# undef fprintf
# undef snprintf
# undef sprintf
#else
# define gettext(s) (s)
# define ngettext(s_singular, s_plural, count) ((count) != 1 ? (s_plural) : (s_singular))