This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext re: C++: EXTERN_C needed, and where did sub install() go?
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 11 Oct 2006 09:53:59 +0000 (12:53 +0300)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Wed, 11 Oct 2006 07:02:56 +0000 (07:02 +0000)
Message-Id: <20061011065359.DFC4C8B3A1@seth.hut.fi>

p4raw-id: //depot/perl@28992

ext/re/re.pm
ext/re/re.xs

index b763fef..d4c4ac1 100644 (file)
@@ -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.
index 933296b..58fb124 100644 (file)
@@ -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,