summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--XSUB.h2
-rw-r--r--malloc.c2
-rw-r--r--perl.h8
3 files changed, 9 insertions, 3 deletions
diff --git a/XSUB.h b/XSUB.h
index acc0cdedb9..74e37ed5f0 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -69,7 +69,7 @@ handled automatically by C<xsubpp>.
/* gcc -Wall: if an xsub has no arguments and PPCODE is used
* and none of ST, XSRETURN or XSprePUSH macros are used
* then `ax' (setup by dXSARGS) is unused. */
-#define dAX I32 ax __attribute__((unused)) = MARK - PL_stack_base + 1
+#define dAX I32 ax PERL_UNUSED_DECL = MARK - PL_stack_base + 1
#define dITEMS I32 items = SP - MARK
diff --git a/malloc.c b/malloc.c
index f73e22dfd4..6a2ff15547 100644
--- a/malloc.c
+++ b/malloc.c
@@ -305,7 +305,7 @@
# define pTHX void
# define pTHX_
# ifdef HASATTRIBUTE
-# define dTHX extern int Perl___notused __attribute__ ((unused))
+# define dTHX extern int Perl___notused PERL_UNUSED_DECL
# else
# define dTHX extern int Perl___notused
# endif
diff --git a/perl.h b/perl.h
index fd22a063c9..43e11504f0 100644
--- a/perl.h
+++ b/perl.h
@@ -225,8 +225,14 @@ struct perl_thread;
# define CALLPROTECT CALL_FPTR(PL_protect)
#endif
+#ifdef HASATTRIBUTE
+# define PERL_UNUSED_DECL __attribute__((unused))
+#else
+# define PERL_UNUSED_DECL
+#endif
+
#define NOOP (void)0
-#define dNOOP extern int Perl___notused __attribute__ ((unused))
+#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
#ifndef pTHX
# define pTHX void