From 6c827301d1aa34af16f035d1ec160162bde2da11 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Jan 2017 01:16:51 +0100 Subject: [PATCH] Fix regex library compilation after MinGW _stricmp() fixes Don't use extern "C" in C code. --- include/wx/msw/gccpriv.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/gccpriv.h b/include/wx/msw/gccpriv.h index 8fd4490b73..319b98746b 100644 --- a/include/wx/msw/gccpriv.h +++ b/include/wx/msw/gccpriv.h @@ -150,13 +150,23 @@ manually declare the functions we need in this case if necessary. */ #ifdef __MINGW32_TOOLCHAIN__ + /* + The macro below is used in wx/wxcrtbase.h included from C regex library + code, so make sure it compiles in non-C++ code too. + */ + #ifdef __cplusplus + #define wxEXTERNC extern "C" + #else + #define wxEXTERNC + #endif + /* This macro is somewhat unusual as it takes the list of parameters inside parentheses and includes semicolon inside it as putting the semicolon outside wouldn't do the right thing when this macro is empty. */ #define wxDECL_FOR_MINGW32_ALWAYS(rettype, func, params) \ - extern "C" _CRTIMP rettype __cdecl __MINGW_NOTHROW func params ; + wxEXTERNC _CRTIMP rettype __cdecl __MINGW_NOTHROW func params ; #ifdef __STRICT_ANSI__ #define wxNEEDS_STRICT_ANSI_WORKAROUNDS