From 154d13e3015cc30fdaa754fce88f9fe4d6dc48d4 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 17 Jun 2019 10:18:52 +0300 Subject: [PATCH] Fix building of shared library with C++ support on MinGW * include/gc_config_macros.h [GC_DLL && !GC_API && __MINGW32__ && GC_BUILD && __cplusplus] (GC_API): Add "extern" keyword. --- include/gc_config_macros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 2cb9ec8..5580cac 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -177,7 +177,9 @@ #if defined(GC_DLL) && !defined(GC_API) # if defined(__MINGW32__) || defined(__CEGCC__) -# if defined(GC_BUILD) || defined(__MINGW32_DELAY_LOAD__) +# if defined(__cplusplus) && defined(GC_BUILD) && defined(__MINGW32__) +# define GC_API extern __declspec(dllexport) +# elif defined(GC_BUILD) || defined(__MINGW32_DELAY_LOAD__) # define GC_API __declspec(dllexport) # else # define GC_API __declspec(dllimport) -- 2.7.4