summaryrefslogtreecommitdiff
path: root/minimod.pl
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2009-05-06 12:50:09 +0100
committerSteve Hay <SteveHay@planit.com>2009-05-06 12:55:00 +0100
commit938cfd5cbc71c8edc25160094f2b45a593724fb5 (patch)
treed5ed07fe0a7b9a951723cb76d81d792f1ffa089a /minimod.pl
parentbebf870e6d027ca8a7a3da6a23b4612c5178aae4 (diff)
downloadperl-938cfd5cbc71c8edc25160094f2b45a593724fb5.tar.gz
Fix code before declaration compile error on Win32
The code written out by ExtUtils::Miniperl::writemain() contained the code PERL_UNUSED_CONTEXT; before the declarations const char file[] = __FILE__; dXSUB_SYS; which Win32's VC++ compiler doesn't like.
Diffstat (limited to 'minimod.pl')
-rw-r--r--minimod.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/minimod.pl b/minimod.pl
index fea77c0ef7..bd945c25d4 100644
--- a/minimod.pl
+++ b/minimod.pl
@@ -67,11 +67,12 @@ sub writemain{
print "EXTERN_C void boot_${cname} (pTHX_ CV* cv);\n";
}
- my ($tail1,$tail2) = ( $tail =~ /\A(.*\n)(\s*\}.*)\Z/s );
- print $tail1;
+ my ($tail1,$tail2,$tail3) = ( $tail =~ /\A(.*{\s*\n)(.*\n)(\s*\}.*)\Z/s );
+ print $tail1;
print "\tconst char file[] = __FILE__;\n";
print "\tdXSUB_SYS;\n" if $] > 5.002;
+ print $tail2;
foreach $_ (@exts){
my($pname) = canon('/', $_);
@@ -91,7 +92,7 @@ sub writemain{
}
print "\t}\n";
}
- print $tail2;
+ print $tail3;
}
sub canon{