summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--XSUB.h2
-rw-r--r--perl.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/XSUB.h b/XSUB.h
index b7df5e29fd..9d4aae6249 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -104,7 +104,7 @@ is a lexical $_ in scope.
# define XS(name) EXPORT_C void name(pTHX_ CV* cv)
#endif
#ifndef XS
-# 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)
diff --git a/perl.h b/perl.h
index dccbf014f1..6f9f966a74 100644
--- a/perl.h
+++ b/perl.h
@@ -211,7 +211,7 @@
#endif
#ifndef PERL_UNUSED_DECL
-# ifdef HASATTRIBUTE_UNUSED
+# if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
# define PERL_UNUSED_DECL __attribute__unused__
# else
# define PERL_UNUSED_DECL