summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2007-02-01 12:00:51 +0000
committermillert <millert@openbsd.org>2007-02-01 12:00:51 +0000
commit795783969c80308a76853f51cd19b42a7b4c06c1 (patch)
treede52dcae1a4ffde6e71d85d28b2619317f902359
parentadd support for [-k mode]; tests/ok otto@. (diff)
downloadwireguard-openbsd-795783969c80308a76853f51cd19b42a7b4c06c1.tar.xz
wireguard-openbsd-795783969c80308a76853f51cd19b42a7b4c06c1.zip
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.
-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