summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-06-18 11:09:05 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-06-18 14:15:36 -0400
commit57d4b8c5bc14bfcf2f6d0c4e04fa483734c339d5 (patch)
tree48f5b2d508d57c7f8b236b11dfa122e3fe5ab452
parentabf4b09915c10b2ff70adc27c72c9795fe2d7b42 (diff)
downloadperl-57d4b8c5bc14bfcf2f6d0c4e04fa483734c339d5.tar.gz
__clang__ seems to be thing, but leave also __clang.
This fixes the GCC_DIAG_IGNORE() + GCC_DIAG_RESTORE with clang.
-rw-r--r--inline.h9
-rw-r--r--perl.h2
2 files changed, 3 insertions, 8 deletions
diff --git a/inline.h b/inline.h
index 619c79ee7c..57275d414e 100644
--- a/inline.h
+++ b/inline.h
@@ -188,18 +188,13 @@ S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
/* ------------------------------- handy.h ------------------------------- */
/* saves machine code for a common noreturn idiom typically used in Newx*() */
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
+GCC_DIAG_IGNORE(-Wunused-function)
static void
S_croak_memory_wrap(void)
{
Perl_croak_nocontext("%s",PL_memory_wrap);
}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
+GCC_DIAG_RESTORE;
/* ------------------------------- utf8.h ------------------------------- */
diff --git a/perl.h b/perl.h
index ee333d1369..3c2e4e4cb0 100644
--- a/perl.h
+++ b/perl.h
@@ -386,7 +386,7 @@
* clang only pretends to be GCC 4.2, but still supports push/pop.
*/
-#if defined(__clang) || \
+#if defined(__clang__) || defined(__clang) || \
(defined( __GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406)
# define GCC_DIAG_DO_PRAGMA_(x) _Pragma (#x)