diff options
Diffstat (limited to 'src/tools/mark_pgdllimport.pl')
-rwxr-xr-x | src/tools/mark_pgdllimport.pl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tools/mark_pgdllimport.pl b/src/tools/mark_pgdllimport.pl index 834fcac5b54..7b51ae3c201 100755 --- a/src/tools/mark_pgdllimport.pl +++ b/src/tools/mark_pgdllimport.pl @@ -28,17 +28,18 @@ use warnings; for my $include_file (@ARGV) { open(my $rfh, '<', $include_file) || die "$include_file: $!"; - my $buffer = ''; + my $buffer = ''; my $num_pgdllimport_added = 0; while (my $raw_line = <$rfh>) { - my $needs_pgdllimport = 1; + my $needs_pgdllimport = 1; # By convention we declare global variables explicitly extern. We're # looking for those not already marked with PGDLLIMPORT. - $needs_pgdllimport = 0 if $raw_line !~ /^extern\s+/ - || $raw_line =~ /PGDLLIMPORT/; + $needs_pgdllimport = 0 + if $raw_line !~ /^extern\s+/ + || $raw_line =~ /PGDLLIMPORT/; # Make a copy of the line and perform a simple-minded comment strip. # Also strip trailing whitespace. @@ -48,8 +49,9 @@ for my $include_file (@ARGV) # Variable declarations should end in a semicolon. If we see an # opening parenthesis, it's probably a function declaration. - $needs_pgdllimport = 0 if $stripped_line !~ /;$/ - || $stripped_line =~ /\(/; + $needs_pgdllimport = 0 + if $stripped_line !~ /;$/ + || $stripped_line =~ /\(/; # Add PGDLLIMPORT marker, if required. if ($needs_pgdllimport) @@ -68,7 +70,7 @@ for my $include_file (@ARGV) if ($num_pgdllimport_added > 0) { printf "%s: adding %d PGDLLIMPORT markers\n", - $include_file, $num_pgdllimport_added; + $include_file, $num_pgdllimport_added; open(my $wfh, '>', $include_file) || die "$include_file: $!"; print $wfh $buffer; close($wfh); |