From: John Darrington Date: Wed, 24 Dec 2008 06:34:59 +0000 (+0900) Subject: Ensure that module version agrees with pspp version X-Git-Tag: v0.7.1~1^2~18 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49ce384421d791119e04cbdb6bd4ae4ec30740f4;p=pspp-builds.git Ensure that module version agrees with pspp version --- diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index 254b668c..b468cc74 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -148,14 +148,17 @@ make_value_from_scalar (SV *val, const struct variable *var) MODULE = PSPP -BOOT: +MODULE = PSPP PACKAGE = PSPP + +void +onBoot (ver) + const char *ver +CODE: + assert (0 == strcmp (ver, bare_version)); msg_init (NULL, message_handler); settings_init (0, 0); fh_init (); - -MODULE = PSPP PACKAGE = PSPP - SV * format_value (val, var) SV *val @@ -634,4 +637,3 @@ CODE: OUTPUT: RETVAL - diff --git a/perl-module/lib/PSPP.pm b/perl-module/lib/PSPP.pm index f4310eee..69e46707 100644 --- a/perl-module/lib/PSPP.pm +++ b/perl-module/lib/PSPP.pm @@ -2,8 +2,6 @@ use 5.008008; use strict; use warnings; -do 'pspp-vers.pl' || die "No version set"; - =head1 NAME PSPP - Perl extension to PSPP @@ -22,9 +20,13 @@ system files. None by default. =cut +BEGIN { + do 'pspp-vers.pl' || die "No version set"; + require XSLoader; + XSLoader::load('PSPP', $PSPP::VERSION); +} -require XSLoader; -XSLoader::load('PSPP', $PSPP::VERSION); +PSPP::onBoot($PSPP::VERSION); =pod