]> granicus.if.org Git - gc/commitdiff
Fix building of shared library with C++ support on MinGW
authorIvan Maidanski <ivmai@mail.ru>
Mon, 17 Jun 2019 07:18:52 +0000 (10:18 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 17 Jun 2019 07:18:52 +0000 (10:18 +0300)
* include/gc_config_macros.h [GC_DLL && !GC_API && __MINGW32__
&& GC_BUILD && __cplusplus] (GC_API): Add "extern" keyword.

include/gc_config_macros.h

index 2cb9ec8498ed4914124a486d66dda8e168a5956c..5580cac6c5a92c169e29e25efed3f3f600878615 100644 (file)
 #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)