X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;ds=sidebyside;f=Magic.xs;h=40b438f831bef3f0d35a5bae6f70960a873f655d;hb=7afdaf8f49acc22b13ccfcee9bc03045d0a88036;hp=f7917abcad8c9fbde616cc2dd3bcb32f75ffeecd;hpb=ebe9eedb7d7e7f6acaae37c8dbb5c373e9fb6026;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Magic.xs b/Magic.xs index f7917ab..40b438f 100644 --- a/Magic.xs +++ b/Magic.xs @@ -133,6 +133,12 @@ # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling) #endif +#ifdef DEBUGGING +# define VMG_ASSERT(C) assert(C) +#else +# define VMG_ASSERT(C) +#endif + /* uvar magic and Hash::Util::FieldHash were commited with 28419, but we only * enable them on 5.10 */ #if VMG_HAS_PERL(5, 10, 0) @@ -385,6 +391,9 @@ typedef enum { OPc_COP, #if VMG_HAS_PERL(5, 21, 5) OPc_METHOP, +#endif +#if VMG_HAS_PERL(5, 21, 7) + OPc_UNOP_AUX, #endif OPc_MAX } opclass; @@ -404,6 +413,9 @@ static const char *const vmg_opclassnames[] = { "B::COP", #if VMG_HAS_PERL(5, 21, 5) "B::METHOP", +#endif +#if VMG_HAS_PERL(5, 21, 7) + "B::UNOP_AUX", #endif NULL }; @@ -480,6 +492,10 @@ static opclass vmg_opclass(const OP *o) { #if VMG_HAS_PERL(5, 21, 5) case OA_METHOP: return OPc_METHOP; +#endif +#if VMG_HAS_PERL(5, 21, 7) + case OA_UNOP_AUX: + return OPc_UNOP_AUX; #endif } @@ -1861,7 +1877,7 @@ static void vmg_teardown(pTHX_ void *param) { vmg_sv_magicext((SV *) PL_strtab, NULL, &vmg_global_teardown_vtbl, NULL, 0); } } else { - assert(vmg_loaded > 1); + VMG_ASSERT(vmg_loaded > 1); --vmg_loaded; } @@ -1890,7 +1906,7 @@ static void vmg_setup(pTHX) { MUTEX_INIT(&vmg_op_name_init_mutex); vmg_loaded = 1; } else { - assert(vmg_loaded > 0); + VMG_ASSERT(vmg_loaded > 0); ++vmg_loaded; } @@ -2024,7 +2040,7 @@ PPCODE: MY_CXT.depth = old_depth; MY_CXT.freed_tokens = NULL; VMG_LOADED_LOCK; - assert(vmg_loaded > 0); + VMG_ASSERT(vmg_loaded > 0); ++vmg_loaded; VMG_LOADED_UNLOCK; }