From: Nicholas Clark Date: Fri, 20 May 2005 22:30:16 +0000 (+0000) Subject: Update XS code to declare PERL_UNUSED_DECL conditionally X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aec614a53fcaa2a63038ec4dcf0fcd1cda92fd31;p=p5sagit%2Fp5-mst-13.2.git Update XS code to declare PERL_UNUSED_DECL conditionally p4raw-id: //depot/perl@24521 --- diff --git a/ext/List/Util/Util.xs b/ext/List/Util/Util.xs index 45aa92d..0c6a14d 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 9f76b47..bdb41f9 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 628dd0a..87f94e1 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