$NetBSD: patch-aq,v 1.3 2011/08/05 18:06:14 adam Exp $

--- XSUB.h.orig	2007-12-18 11:47:07.000000000 +0100
+++ XSUB.h
@@ -94,6 +94,9 @@ is a lexical $_ in scope.
 #ifndef PERL_UNUSED_VAR
 #  define PERL_UNUSED_VAR(x) ((void)x)
 #endif
+#ifndef PERL_UNUSED_DECL
+#  define PERL_UNUSED_DECL
+#endif
 
 #define ST(off) PL_stack_base[ax + (off)]
 
@@ -117,15 +120,7 @@ is a lexical $_ in scope.
 #  define XS(name) EXPORT_C XSPROTO(name)
 #endif
 #ifndef XS
-#  if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
-#    define XS(name) void name(pTHX_ CV* cv __attribute__unused__)
-#  else
-#    ifdef __cplusplus
-#      define XS(name) extern "C" XSPROTO(name)
-#    else
-#      define XS(name) XSPROTO(name)
-#    endif
-#  endif
+#  define XS(name) void name(pTHX_ CV* cv PERL_UNUSED_DECL)
 #endif
 
 #define dAX const I32 ax = (I32)(MARK - PL_stack_base + 1)
