From bf4b0785f98099f444f4eb6b98b627a15f155abe Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 21 Aug 2020 16:43:56 +0200 Subject: [PATCH] common.h: undefine more stupid preprocessor defines from libintl.h libintl defines symbols such as 'fprintf', 'snprintf' or 'sprintf' to 'libintl_' 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'. --- src/common/common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/common.h b/src/common/common.h index 77ee3bbf3..2b78f7628 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -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))