summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/XSUB.h b/XSUB.h
index d15af1f498..65c33c9a4e 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -39,20 +39,18 @@
#ifdef XS_VERSION
# define XS_VERSION_BOOTCHECK \
STMT_START { \
- char vn[255], *module = SvPV(ST(0),na); \
+ char *vn = "", *module = SvPV(ST(0),na); \
if (items >= 2) /* version supplied as bootstrap arg */ \
Sv = ST(1); \
else { \
- sprintf(vn,"%s::XS_VERSION", module); \
- Sv = perl_get_sv(vn, FALSE); /* XXX GV_ADDWARN */ \
- if (!Sv || !SvOK(Sv)) { \
- sprintf(vn,"%s::VERSION", module); \
- Sv = perl_get_sv(vn, FALSE); /* XXX GV_ADDWARN */ \
- } \
+ /* XXX GV_ADDWARN */ \
+ Sv = perl_get_sv(vn = form("%s::XS_VERSION", module), FALSE); \
+ if (!Sv || !SvOK(Sv)) \
+ Sv = perl_get_sv(vn = form("%s::VERSION", module), FALSE); \
} \
if (Sv && (!SvOK(Sv) || strNE(XS_VERSION, SvPV(Sv, na)))) \
- croak("%s object version %s does not match $%s %s", \
- module, XS_VERSION, vn, SvPV(Sv, na)); \
+ croak("%s object version %s does not match $%s %S", \
+ module, XS_VERSION, vn, Sv); \
} STMT_END
#else
# define XS_VERSION_BOOTCHECK