summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-12-24 13:11:45 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2014-12-24 13:20:07 +0000
commit1ea760a1752743f62a7abd01a89e4d8ffdd594d9 (patch)
treeda60daf1eb44893192ab7d56cddebd9559454c47
parent5c5f0d52fc42141069a3d6406c7f85eaa0455ea1 (diff)
downloadperl-1ea760a1752743f62a7abd01a89e4d8ffdd594d9.tar.gz
Fix compilation errors in globals.c with MinGW/gcc -xc++
error: external linkage required for symbol 'PL_charclass' because of 'dllexport' attribute and likewise for many other symbols declared EXTCONST.
-rw-r--r--INTERN.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/INTERN.h b/INTERN.h
index da3057a83c..39b48f4f1b 100644
--- a/INTERN.h
+++ b/INTERN.h
@@ -29,10 +29,17 @@
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
# if (defined(WIN32) && defined(__MINGW32__)) || defined(__SYMBIAN32__)
-# define EXT __declspec(dllexport)
-# define dEXT
-# define EXTCONST __declspec(dllexport) const
-# define dEXTCONST const
+# ifdef __cplusplus
+# define EXT __declspec(dllexport)
+# define dEXT
+# define EXTCONST __declspec(dllexport) extern const
+# define dEXTCONST const
+# else
+# define EXT __declspec(dllexport)
+# define dEXT
+# define EXTCONST __declspec(dllexport) const
+# define dEXTCONST const
+# endif
# else
# ifdef __cplusplus
# define EXT