From 72f4d256a73da40849cc4951936e661ad796d472 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 24 Oct 2013 17:56:13 -0700 Subject: [PATCH] Use VXS_ prefix for XSUB bodies in CPAN version MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The names of the functions in core and in the CPAN version will con- flict otherwise. Since perl versions before 5.16.0 did not have XS_INTERNAL (which could solve this problem another way, making the functions static), it’s easier just to use different names. --- vxs.inc | 83 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/vxs.inc b/vxs.inc index 1615f69..2552ce8 100644 --- a/vxs.inc +++ b/vxs.inc @@ -3,48 +3,51 @@ #ifdef PERL_CORE # define VXS_CLASS "version" +# define VXSp(name) XS_##name #else # define VXS_CLASS "version::vxs" +# define VXSp(name) VXS_##name #endif +#define VXS(name) XS(VXSp(name)) #ifdef VXS_XSUB_DETAILS # ifdef PERL_CORE {"UNIVERSAL::VERSION", XS_UNIVERSAL_VERSION, NULL}, # else - {VXS_CLASS "::_VERSION", XS_UNIVERSAL_VERSION, NULL}, + {VXS_CLASS "::_VERSION", VXS_UNIVERSAL_VERSION, NULL}, # endif - {VXS_CLASS "::()", XS_version_noop, NULL}, - {VXS_CLASS "::new", XS_version_new, NULL}, - {VXS_CLASS "::parse", XS_version_new, NULL}, - {VXS_CLASS "::(\"\"", XS_version_stringify, NULL}, - {VXS_CLASS "::stringify", XS_version_stringify, NULL}, - {VXS_CLASS "::(0+", XS_version_numify, NULL}, - {VXS_CLASS "::numify", XS_version_numify, NULL}, - {VXS_CLASS "::normal", XS_version_normal, NULL}, - {VXS_CLASS "::(cmp", XS_version_vcmp, NULL}, - {VXS_CLASS "::(<=>", XS_version_vcmp, NULL}, + {VXS_CLASS "::()", VXSp(version_noop), NULL}, + {VXS_CLASS "::new", VXSp(version_new), NULL}, + {VXS_CLASS "::parse", VXSp(version_new), NULL}, + {VXS_CLASS "::(\"\"", VXSp(version_stringify), NULL}, + {VXS_CLASS "::stringify", VXSp(version_stringify), NULL}, + {VXS_CLASS "::(0+", VXSp(version_numify), NULL}, + {VXS_CLASS "::numify", VXSp(version_numify), NULL}, + {VXS_CLASS "::normal", VXSp(version_normal), NULL}, + {VXS_CLASS "::(cmp", VXSp(version_vcmp), NULL}, + {VXS_CLASS "::(<=>", VXSp(version_vcmp), NULL}, # ifdef PERL_CORE {VXS_CLASS "::vcmp", XS_version_vcmp, NULL}, # else - {VXS_CLASS "::VCMP", XS_version_vcmp, NULL}, + {VXS_CLASS "::VCMP", VXS_version_vcmp, NULL}, # endif - {VXS_CLASS "::(bool", XS_version_boolean, NULL}, - {VXS_CLASS "::boolean", XS_version_boolean, NULL}, - {VXS_CLASS "::(+", XS_version_noop, NULL}, - {VXS_CLASS "::(-", XS_version_noop, NULL}, - {VXS_CLASS "::(*", XS_version_noop, NULL}, - {VXS_CLASS "::(/", XS_version_noop, NULL}, - {VXS_CLASS "::(+=", XS_version_noop, NULL}, - {VXS_CLASS "::(-=", XS_version_noop, NULL}, - {VXS_CLASS "::(*=", XS_version_noop, NULL}, - {VXS_CLASS "::(/=", XS_version_noop, NULL}, - {VXS_CLASS "::(abs", XS_version_noop, NULL}, - {VXS_CLASS "::(nomethod", XS_version_noop, NULL}, - {VXS_CLASS "::noop", XS_version_noop, NULL}, - {VXS_CLASS "::is_alpha", XS_version_is_alpha, NULL}, - {VXS_CLASS "::qv", XS_version_qv, NULL}, - {VXS_CLASS "::declare", XS_version_qv, NULL}, - {VXS_CLASS "::is_qv", XS_version_is_qv, NULL}, + {VXS_CLASS "::(bool", VXSp(version_boolean), NULL}, + {VXS_CLASS "::boolean", VXSp(version_boolean), NULL}, + {VXS_CLASS "::(+", VXSp(version_noop), NULL}, + {VXS_CLASS "::(-", VXSp(version_noop), NULL}, + {VXS_CLASS "::(*", VXSp(version_noop), NULL}, + {VXS_CLASS "::(/", VXSp(version_noop), NULL}, + {VXS_CLASS "::(+=", VXSp(version_noop), NULL}, + {VXS_CLASS "::(-=", VXSp(version_noop), NULL}, + {VXS_CLASS "::(*=", VXSp(version_noop), NULL}, + {VXS_CLASS "::(/=", VXSp(version_noop), NULL}, + {VXS_CLASS "::(abs", VXSp(version_noop), NULL}, + {VXS_CLASS "::(nomethod", VXSp(version_noop), NULL}, + {VXS_CLASS "::noop", VXSp(version_noop), NULL}, + {VXS_CLASS "::is_alpha", VXSp(version_is_alpha), NULL}, + {VXS_CLASS "::qv", VXSp(version_qv), NULL}, + {VXS_CLASS "::declare", VXSp(version_qv), NULL}, + {VXS_CLASS "::is_qv", VXSp(version_is_qv), NULL}, #else #ifndef dVAR @@ -64,7 +67,7 @@ typedef char HVNAME; # define HEKf "s" #endif -XS(XS_UNIVERSAL_VERSION) +VXS(UNIVERSAL_VERSION) { dVAR; dXSARGS; @@ -165,7 +168,7 @@ XS(XS_UNIVERSAL_VERSION) XSRETURN(1); } -XS(XS_version_new) +VXS(version_new) { dVAR; dXSARGS; @@ -233,7 +236,7 @@ XS(XS_version_new) Perl_croak(aTHX_ varname " is not of type version"); \ } STMT_END -XS(XS_version_stringify) +VXS(version_stringify) { dVAR; dXSARGS; @@ -251,7 +254,7 @@ XS(XS_version_stringify) } } -XS(XS_version_numify) +VXS(version_numify) { dVAR; dXSARGS; @@ -267,7 +270,7 @@ XS(XS_version_numify) } } -XS(XS_version_normal) +VXS(version_normal) { dVAR; dXSARGS; @@ -285,7 +288,7 @@ XS(XS_version_normal) } } -XS(XS_version_vcmp) +VXS(version_vcmp) { dVAR; dXSARGS; @@ -325,7 +328,7 @@ XS(XS_version_vcmp) } } -XS(XS_version_boolean) +VXS(version_boolean) { dVAR; dXSARGS; @@ -348,7 +351,7 @@ XS(XS_version_boolean) } } -XS(XS_version_noop) +VXS(version_noop) { dVAR; dXSARGS; @@ -361,7 +364,7 @@ XS(XS_version_noop) XSRETURN_EMPTY; } -XS(XS_version_is_alpha) +VXS(version_is_alpha) { dVAR; dXSARGS; @@ -380,7 +383,7 @@ XS(XS_version_is_alpha) } } -XS(XS_version_qv) +VXS(version_qv) { dVAR; dXSARGS; @@ -434,7 +437,7 @@ XS(XS_version_qv) return; } -XS(XS_version_is_qv) +VXS(version_is_qv) { dVAR; dXSARGS; -- 2.7.4