This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
XSLoader 0.21: use dl_find_symbol 3rd optional argument
authorReini Urban <rurban@cpanel.net>
Fri, 13 Mar 2015 23:31:41 +0000 (00:31 +0100)
committerTony Cook <tony@develop-help.com>
Tue, 10 Nov 2015 21:56:28 +0000 (08:56 +1100)
to skip the worthless dl_last_error message

dist/XSLoader/XSLoader_pm.PL

index 2651596..8a8852e 100644 (file)
@@ -124,10 +124,11 @@ print OUT <<'EOT';
 EOT
 
     if ($^O eq 'darwin') {
-print OUT <<'EOT';
-        if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) {
-            goto boot; #extension library has already been loaded, e.g. darwin
-        }
+      my $extra_arg = ', 1 ' if $DynaLoader::VERSION ge '1.37';
+print OUT <<"EOT";
+    if (\$boot_symbol_ref = dl_find_symbol( 0, \$bootname $extra_arg)) {
+        goto boot; #extension library has already been loaded, e.g. darwin
+    }
 EOT
     }