X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/8a0214ab98bbdd4da29dcb1e76877b3d24788e2e..91497b7f1eadb85318d1721ab68c3a72fedb43c6:/dist/Devel-PPPort/parts/inc/misc diff --git a/dist/Devel-PPPort/parts/inc/misc b/dist/Devel-PPPort/parts/inc/misc index 6d3edbc..ffed764 100644 --- a/dist/Devel-PPPort/parts/inc/misc +++ b/dist/Devel-PPPort/parts/inc/misc @@ -12,6 +12,7 @@ =provides __UNDEFINED__ +__REDEFINE__ END_EXTERN_C EXTERN_C INT2PTR @@ -19,6 +20,7 @@ MUTABLE_PTR NVTYPE PERLIO_FUNCS_CAST PERLIO_FUNCS_DECL +PERL_STATIC_INLINE PERL_UNUSED_ARG PERL_UNUSED_CONTEXT PERL_UNUSED_DECL @@ -38,6 +40,12 @@ ASSUME =implementation +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +__UNDEFINED__ PERL_STATIC_INLINE static inline +#else +__UNDEFINED__ PERL_STATIC_INLINE static +#endif + __UNDEFINED__ cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0) __UNDEFINED__ OpHAS_SIBLING(o) (cBOOL((o)->op_sibling)) __UNDEFINED__ OpSIBLING(o) (0 + (o)->op_sibling) @@ -52,7 +60,7 @@ __UNDEFINED__ __ASSERT_(statement) assert(statement), __UNDEFINED__ __ASSERT_(statement) #endif -__UNDEFINED__ __has_builtin(x) 0 +__UNDEF_NOT_PROVIDED__ __has_builtin(x) 0 #if __has_builtin(__builtin_unreachable) # define D_PPP_HAS_BUILTIN_UNREACHABLE @@ -220,7 +228,10 @@ __UNDEFINED__ SvRXOK(sv) (!!SvRX(sv)) #endif __UNDEFINED__ NOOP /*EMPTY*/(void)0 -__UNDEFINED__ dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL + +#if { VERSION < 5.6.1 } && { VERSION < 5.27.7 } +__REDEFINE__ dNOOP struct Perl___notused_struct +#endif #ifndef NVTYPE # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) @@ -259,17 +270,14 @@ __UNDEFINED__ PTR2IV(p) INT2PTR(IV,p) __UNDEFINED__ PTR2UV(p) INT2PTR(UV,p) __UNDEFINED__ PTR2NV(p) NUM2PTR(NV,p) -#undef START_EXTERN_C -#undef END_EXTERN_C -#undef EXTERN_C #ifdef __cplusplus -# define START_EXTERN_C extern "C" { -# define END_EXTERN_C } -# define EXTERN_C extern "C" +__REDEFINE__ START_EXTERN_C extern "C" { +__REDEFINE__ END_EXTERN_C } +__REDEFINE__ EXTERN_C extern "C" #else -# define START_EXTERN_C -# define END_EXTERN_C -# define EXTERN_C extern +__REDEFINE__ START_EXTERN_C +__REDEFINE__ END_EXTERN_C +__REDEFINE__ EXTERN_C extern #endif #if { VERSION < 5.004 } || defined(PERL_GCC_PEDANTIC) @@ -278,25 +286,20 @@ __UNDEF_NOT_PROVIDED__ PERL_GCC_BRACE_GROUPS_FORBIDDEN # endif #endif -#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) +#if ! defined(__GNUC__) || defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) || defined(__cplusplus) +# undef PERL_USE_GCC_BRACE_GROUPS +#else # ifndef PERL_USE_GCC_BRACE_GROUPS # define PERL_USE_GCC_BRACE_GROUPS # endif #endif -#undef STMT_START -#undef STMT_END -#if defined(VOIDFLAGS) && defined(PERL_USE_GCC_BRACE_GROUPS) -# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ -# define STMT_END ) +#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) +__REDEFINE__ STMT_START if (1) +__REDEFINE__ STMT_END else (void)0 #else -# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) -# define STMT_START if (1) -# define STMT_END else (void)0 -# else -# define STMT_START do -# define STMT_END while (0) -# endif +__REDEFINE__ STMT_START do +__REDEFINE__ STMT_END while (0) #endif __UNDEFINED__ boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) @@ -346,8 +349,7 @@ __UNDEFINED__ dAXMARK I32 ax = POPMARK; \ __UNDEFINED__ XSprePUSH (sp = PL_stack_base + ax - 1) #if { VERSION < 5.005 } -# undef XSRETURN -# define XSRETURN(off) \ +__REDEFINE__ XSRETURN(off) \ STMT_START { \ PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ return; \ @@ -837,8 +839,8 @@ __UNDEFINED__ isIDFIRST_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, IDFIRST __UNDEFINED__ isLOWER_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, LOWER) __UNDEFINED__ isPRINT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PRINT) -# undef isPSXSPC_utf8_safe /* Use the modern definition */ -__UNDEFINED__ isPSXSPC_utf8_safe(s,e) isSPACE_utf8_safe(s,e) +/* Use the modern definition */ +__REDEFINE__ isPSXSPC_utf8_safe(s,e) isSPACE_utf8_safe(s,e) __UNDEFINED__ isPUNCT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PUNCT) __UNDEFINED__ isSPACE_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, SPACE) @@ -910,8 +912,8 @@ __UNDEFINED__ isIDFIRST_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, I __UNDEFINED__ isLOWER_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, LOWER) __UNDEFINED__ isPRINT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PRINT) -# undef isPSXSPC_LC_utf8_safe /* Use the modern definition */ -__UNDEFINED__ isPSXSPC_LC_utf8_safe(s,e) isSPACE_LC_utf8_safe(s,e) +/* Use the modern definition */ +__REDEFINE__ isPSXSPC_LC_utf8_safe(s,e) isSPACE_LC_utf8_safe(s,e) __UNDEFINED__ isPUNCT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PUNCT) __UNDEFINED__ isSPACE_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, SPACE) @@ -1167,10 +1169,10 @@ newXS("Devel::PPPort::dAXMARK", XS_Devel__PPPort_dAXMARK, file); int OpSIBLING_tests() PREINIT: - OP *x; - OP *kid; - OP *middlekid; - OP *lastkid; + OP *x = NULL; + OP *kid = NULL; + OP *middlekid = NULL; + OP *lastkid = NULL; int count = 0; int failures = 0; int i; @@ -1426,8 +1428,8 @@ check_HeUTF8(utf8_key) hash = newHV(); key = SvPV(utf8_key, klen); - if (SvUTF8(utf8_key)) klen *= -1; - hv_store(hash, key, klen, newSVpvs("string"), 0); + hv_store(hash, key, SvUTF8(utf8_key) ? -klen : klen, + newSVpvs("string"), 0); hv_iterinit(hash); ent = hv_iternext(hash); assert(ent);