]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Add the VMG_HAS_PERL_{AND,OR} macros to test for a patchlevel and/or a perl version
authorVincent Pit <vince@profvince.com>
Sat, 5 Jul 2008 10:51:46 +0000 (12:51 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 5 Jul 2008 10:51:46 +0000 (12:51 +0200)
Magic.xs

index 82631169a3f7055157fd48cde7b844cd663d6dd7..a141792332b31d9952232278b06156bef4d3b086 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
 # 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