summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-02-01 12:00:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-02-01 12:00:52 +0000
commit1620e443a06a157a55c4029f91277121bd1a3960 (patch)
tree90e01c778147c0ea61defe6d98bf0953eaf5e2d3 /gnu/usr.bin/perl
parent7ad1e7bb58b76857a57b6dd97f43bcdf21b4a242 (diff)
Ignore HASATTRIBUTE_UNUSED for C++ as our g++ does not grok
the __unused__ attribute. Also give XS functions C linkage. Patch taken from perl-current.
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r--gnu/usr.bin/perl/XSUB.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/XSUB.h b/gnu/usr.bin/perl/XSUB.h
index 2a8e90c7f06..547f2d3722b 100644
--- a/gnu/usr.bin/perl/XSUB.h
+++ b/gnu/usr.bin/perl/XSUB.h
@@ -91,10 +91,14 @@ handled automatically by C<xsubpp>.
#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
# define XS(name) __declspec(dllexport) void name(pTHX_ CV* cv)
#else
-# ifdef HASATTRIBUTE_UNUSED
+# 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