Skip to content

Commit

Permalink
C: simplify boot_DynaLoader, fix windows dll slashes
Browse files Browse the repository at this point in the history
from cperl-5.24.0
  • Loading branch information
Reini Urban committed Jul 27, 2016
1 parent 2168747 commit ebe6bf8
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions lib/B/C.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7122,7 +7122,7 @@ static void
xs_init(pTHX)
{
char *file = __FILE__;
dTARG; dSP;
dTARG; dSP; CV * cv;
_EOT8
if ($CPERL51 and $debug{cv}) {
print q{
Expand All @@ -7134,9 +7134,6 @@ _EOT8
#if ($staticxs) { #FIXME!
# print "\n#undef USE_DYNAMIC_LOADING
#}
print "\n#ifdef USE_DYNAMIC_LOADING";
print "\n\tnewXS(\"DynaLoader::boot_DynaLoader\", boot_DynaLoader, file);";
print "\n#endif\n";

delete $xsub{'DynaLoader'};
delete $xsub{'UNIVERSAL'};
Expand All @@ -7156,11 +7153,8 @@ _EOT8
printf "\tXPUSHp(\"DynaLoader\", %d);\n", length("DynaLoader");
print "\tPUTBACK;\n";
warn "bootstrapping DynaLoader added to xs_init\n" if $verbose;
if ($PERL522) {
print "\tboot_DynaLoader(aTHX_ get_cv(\"DynaLoader::bootstrap\", GV_ADD));\n";
} else {
print "\tboot_DynaLoader(aTHX_ NULL);\n";
}
print "\tcv = newXS(\"DynaLoader::boot_DynaLoader\", boot_DynaLoader, file);\n";
print "\tboot_DynaLoader(aTHX_ cv);\n";
print "\tSPAGAIN;\n";
if ($CPERL51 and $^O ne 'MSWin32') {
print "\tdl_boot(aTHX);\n";
Expand Down Expand Up @@ -7350,10 +7344,11 @@ _EOT9
$sofile = "$modlibname/auto/$modpname/$modfname.".$Config{dlext};
}
#warn "load_file: $stashname, $stashfile, $sofile";
printf "\tmXPUSHp(\"%s\", %d);\n", $sofile, length($sofile);
} else {
printf "\tmXPUSHp(\"%s\", %d);\n", $stashfile, length($stashfile);
$stashfile = $sofile;
}
my $stashfile_len = length($stashfile);
$stashfile =~ s/(\\[^nrftacx"' ])/\\$1/g; # windows paths: \\ => \\\\
printf "\tmXPUSHp(\"%s\", %d);\n", $stashfile, $stashfile_len;
}
print "\tPUTBACK;\n";
warn "bootstrapping $stashname added to XSLoader dl_init\n" if $verbose;
Expand Down

0 comments on commit ebe6bf8

Please sign in to comment.