Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mkglobals_h « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e409e01ff9e6d94ddbf9ec707cf20efda80b91b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
my @argv = @ARGV;
$_ = join('', <>);
s/\n[^\n]*!globals.h[^\n]*\n/\n/sog;
s%/\*.*?\*/%%sog;
s/(enum\s.*?{.*?})/munge($1)/soge;
s/^(\s*)([a-zA-Z_])/$1extern $2/mog;
s/extern (extern|enum)/$1/sog;
s/\n\s*extern static[^\n]*\n/\n/sog;
s/\s+=.*?;/;/sog;
s/^\n+//sog;
s/#include "winsup\.h"\n//so;
s/-NL-/\n/sog;
s/-EQ-/=/sog;
s/\s+\n/\n/sog;
s/\n{2,}/\n/sog;
print <<PRELUDE,$_,"#endif /*_GLOBALS_H*/\n";
/* $target - Autogenerated from @argv.  Look there for comments. */

#ifndef _GLOBALS_H
PRELUDE
close $target_fd;
sub munge($) {
    my $val = shift;
    $val =~ s/\n/-NL-/sog;
    $val =~ s/=/-EQ-/sog;
    return $val;
}