summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/XSUB.h b/XSUB.h
index 580d639c07..51112a944e 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -107,7 +107,11 @@ is a lexical $_ in scope.
# if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
# define XS(name) void name(pTHX_ CV* cv __attribute__unused__)
# else
-# define XS(name) void name(pTHX_ CV* cv)
+# ifdef __cplusplus
+# define XS(name) extern "C" void name(pTHX_ CV* cv)
+# else
+# define XS(name) void name(pTHX_ CV* cv)
+# endif
# endif
#endif