From: Vincent Pit Date: Wed, 22 Jul 2015 17:28:36 +0000 (-0300) Subject: Give a proper definition of SU_CXNAME() for non DEBUGGING builds X-Git-Tag: rt104751~8 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=181496f2ca2ce70348ee900a89f3e8854958c385 Give a proper definition of SU_CXNAME() for non DEBUGGING builds --- diff --git a/Upper.xs b/Upper.xs index 728cfec..e3713ae 100644 --- a/Upper.xs +++ b/Upper.xs @@ -973,10 +973,50 @@ done: /* --- Pop a context back -------------------------------------------------- */ -#if SU_DEBUG && defined(DEBUGGING) +#ifdef DEBUGGING # define SU_CXNAME(C) PL_block_type[CxTYPE(C)] #else -# define SU_CXNAME(C) "XXX" +# if SU_HAS_PERL(5, 11, 0) +static const char *su_block_type[] = { + "NULL", + "WHEN", + "BLOCK", + "GIVEN", + "LOOP_FOR", + "LOOP_PLAIN", + "LOOP_LAZYSV", + "LOOP_LAZYIV", + "SUB", + "FORMAT", + "EVAL", + "SUBST" +}; +# elif SU_HAS_PERL(5, 9, 3) +static const char *su_block_type[] = { + "NULL", + "SUB", + "EVAL", + "WHEN", + "SUBST", + "BLOCK", + "FORMAT", + "GIVEN", + "LOOP_FOR", + "LOOP_PLAIN", + "LOOP_LAZYSV", + "LOOP_LAZYIV" +}; +# else +static const char *su_block_type[] = { + "NULL", + "SUB", + "EVAL", + "LOOP", + "SUBST", + "BLOCK" +}; +# endif +# define SU_CXNAME(C) su_block_type[CxTYPE(C)] #endif static void su_pop(pTHX_ void *ud) {