From 49ce384421d791119e04cbdb6bd4ae4ec30740f4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 24 Dec 2008 15:34:59 +0900 Subject: [PATCH] Ensure that module version agrees with pspp version --- perl-module/PSPP.xs | 12 +++++++----- perl-module/lib/PSPP.pm | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) 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 -- 2.30.2