From: Vincent Pit Date: Sat, 5 Jul 2008 10:51:46 +0000 (+0200) Subject: Add the VMG_HAS_PERL_{AND,OR} macros to test for a patchlevel and/or a perl version X-Git-Tag: v0.19~9 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=f914c47f06513236f3bffdfca2fb66e9a65b54bd;p=perl%2Fmodules%2FVariable-Magic.git Add the VMG_HAS_PERL_{AND,OR} macros to test for a patchlevel and/or a perl version --- diff --git a/Magic.xs b/Magic.xs index 8263116..a141792 100644 --- a/Magic.xs +++ b/Magic.xs @@ -30,6 +30,10 @@ # endif #endif +#define VMG_HAS_PERL_OR(P, R, V, S) ((VMG_PERL_PATCHLEVEL >= (P)) || (!VMG_PERL_PATCHLEVEL && PERL_VERSION_GE((R), (V), (S)))) + +#define VMG_HAS_PERL_AND(P, R, V, S) (PERL_VERSION_GE((R), (V), (S)) && (!VMG_PERL_PATCHLEVEL || (VMG_PERL_PATCHLEVEL >= (P)))) + /* --- Compatibility ------------------------------------------------------- */ #ifndef Newx