Commit | Line | Data |
918c0b2d |
1 | # Do not remove the following line; MakeMaker relies on it to identify |
2 | # this file as a template for defsubs.h |
3 | # Extracting defsubs.h (with variable substitutions) |
4c1f658f |
4 | #!perl |
6e7c9e4d |
5 | my ($out) = __FILE__ =~ /(^.*)\.PL/i; |
93804878 |
6 | $out =~ s/_h$/.h/; |
4c1f658f |
7 | open(OUT,">$out") || die "Cannot open $file:$!"; |
cc50ac46 |
8 | print "Extracting $out...\n"; |
4c1f658f |
9 | foreach my $const (qw(AVf_REAL |
b874ff32 |
10 | HEf_SVKEY |
0ca04487 |
11 | SVf_IOK SVf_IVisUV SVf_NOK SVf_POK |
12 | SVf_ROK SVp_IOK SVp_POK )) |
4c1f658f |
13 | { |
14 | doconst($const); |
15 | } |
16 | foreach my $file (qw(op.h cop.h)) |
17 | { |
18 | open(OPH,"../../$file") || die "Cannot open ../../$file:$!"; |
19 | while (<OPH>) |
20 | { |
21 | doconst($1) if (/#define\s+(\w+)\s+([\(\)\|\dx]+)\s*(?:$|\/\*)/); |
22 | } |
23 | close(OPH); |
24 | } |
25 | close(OUT); |
26 | |
27 | sub doconst |
28 | { |
29 | my $sym = shift; |
30 | my $l = length($sym); |
31 | print OUT <<"END"; |
32 | newCONSTSUB(stash,"$sym",newSViv($sym)); |
79cb57f6 |
33 | av_push(export_ok,newSVpvn("$sym",$l)); |
4c1f658f |
34 | END |
35 | } |