summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-20 22:30:16 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-20 22:30:16 +0000
commitaec614a53fcaa2a63038ec4dcf0fcd1cda92fd31 (patch)
tree9a4a347ff6f70319c70dd2a7404fc56bde9a759a /ext
parentab9184c907a73e26d04db8741a60e1abb3ead566 (diff)
downloadperl-aec614a53fcaa2a63038ec4dcf0fcd1cda92fd31.tar.gz
Update XS code to declare PERL_UNUSED_DECL conditionally
p4raw-id: //depot/perl@24521
Diffstat (limited to 'ext')
-rw-r--r--ext/List/Util/Util.xs14
-rw-r--r--ext/POSIX/POSIX.xs14
-rw-r--r--ext/Storable/Storable.xs15
3 files changed, 25 insertions, 18 deletions
diff --git a/ext/List/Util/Util.xs b/ext/List/Util/Util.xs
index 45aa92d62e..0c6a14dd8e 100644
--- a/ext/List/Util/Util.xs
+++ b/ext/List/Util/Util.xs
@@ -107,14 +107,16 @@ sv_tainted(SV *sv)
# define SvUV_set(sv, val) (((XPVUV*)SvANY(sv))->xuv_uv = (val))
#endif
-#ifdef HASATTRIBUTE
-# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
-# define PERL_UNUSED_DECL
+#ifndef PERL_UNUSED_DECL
+# ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
# else
-# define PERL_UNUSED_DECL __attribute__((unused))
+# define PERL_UNUSED_DECL
# endif
-#else
-# define PERL_UNUSED_DECL
#endif
#ifndef dNOOP
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 9f76b47c86..bdb41f9e3c 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -85,14 +85,16 @@ char *tzname[] = { "" , "" };
#endif
#endif
-#ifdef HASATTRIBUTE
-# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
-# define PERL_UNUSED_DECL
+#ifndef PERL_UNUSED_DECL
+# ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
# else
-# define PERL_UNUSED_DECL __attribute__((unused))
+# define PERL_UNUSED_DECL
# endif
-#else
-# define PERL_UNUSED_DECL
#endif
#ifndef dNOOP
diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs
index 628dd0a106..87f94e1aaa 100644
--- a/ext/Storable/Storable.xs
+++ b/ext/Storable/Storable.xs
@@ -86,14 +86,17 @@ typedef double NV; /* Older perls lack the NV type */
#endif
#endif
-#ifdef HASATTRIBUTE
-# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
-# define PERL_UNUSED_DECL
+
+#ifndef PERL_UNUSED_DECL
+# ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
# else
-# define PERL_UNUSED_DECL __attribute__((unused))
+# define PERL_UNUSED_DECL
# endif
-#else
-# define PERL_UNUSED_DECL
#endif
#ifndef dNOOP