From: Jarkko Hietaniemi Date: Wed, 11 Oct 2006 09:53:59 +0000 (+0300) Subject: ext re: C++: EXTERN_C needed, and where did sub install() go? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b47c5f687ab54e29d31f118522dc9feadcc60d8;p=p5sagit%2Fp5-mst-13.2.git ext re: C++: EXTERN_C needed, and where did sub install() go? Message-Id: <20061011065359.DFC4C8B3A1@seth.hut.fi> p4raw-id: //depot/perl@28992 --- diff --git a/ext/re/re.pm b/ext/re/re.pm index b763fef..d4c4ac1 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -248,17 +248,18 @@ $flags{State} = $flags{DUMP} | $flags{EXECUTE} | $flags{STATE}; $flags{TRIE} = $flags{DUMP} | $flags{EXECUTE} | $flags{TRIEC}; my $installed; +my $installed_error; sub _load_unload { my ($on)= @_; if ($on) { if ( ! defined($installed) ) { require XSLoader; - XSLoader::load('re'); - $installed = install() || 0; + $installed = eval { XSLoader::load('re') } || 0; + $installed_error = $@; } if ( ! $installed ) { - die "'re' not installed!?"; + die "'re' not installed!? ($installed_error)"; } else { # We could just say = $installed; but then we wouldn't # "see" any changes to the color environment var. diff --git a/ext/re/re.xs b/ext/re/re.xs index 933296b..58fb124 100644 --- a/ext/re/re.xs +++ b/ext/re/re.xs @@ -24,7 +24,7 @@ extern SV* my_re_intuit_string (pTHX_ regexp *prog); extern regexp* my_regdupe (pTHX_ const regexp *r, CLONE_PARAMS *param); #endif -const struct regexp_engine my_reg_engine = { +EXTERN_C const struct regexp_engine my_reg_engine = { my_regcomp, my_regexec, my_re_intuit_start,