summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-10-10 17:23:27 -0400
committerKarl Williamson <public@khwilliamson.com>2012-10-10 17:09:05 -0600
commit98c015b7a9b5140b2750b25518eb68b5024d7652 (patch)
tree8024448b612f5a6ed32e14adc9d2fd6916668b54 /perl.h
parent451f421fe4742646fa2efbed0f45a19f0713d00f (diff)
downloadperl-98c015b7a9b5140b2750b25518eb68b5024d7652.tar.gz
fix C++ builds broken by cdc4a174060
In commit cdc4a174060 static noreturn function, on a C++ build, (specific example, GCC ) got a post preprocessor prototype of "extern "C" static void S_fn_doesnt_return(". GCC generates a compile error if "extern "C"" and static used together. Plain C build were not affected. This commit fixed the problem by creating 2 new static exclusive macros, so extern "C" does not wind up on statics in a C++ build. The macros allow enough flexibility so any compiler/platform that needs a noreturn declaration specifier instead of a noreturn function attribute can have one.
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index bf96a8ea04..dfa0a4a426 100644
--- a/perl.h
+++ b/perl.h
@@ -5017,6 +5017,20 @@ struct tempsym; /* defined in pp_pack.c */
# define PERL_CALLCONV_NO_RET PERL_CALLCONV
#endif
+/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that
+ dont have a noreturn as a declaration specifier
+*/
+#ifndef PERL_STATIC_NO_RET
+# define PERL_STATIC_NO_RET STATIC
+#endif
+/* PERL_STATIC_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE on
+ builds that dont have a noreturn as a declaration specifier
+*/
+#ifndef PERL_STATIC_INLINE_NO_RET
+# define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE
+#endif
+
+
#undef PERL_CKDEF
#undef PERL_PPDEF
#define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o);