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 |
f675dbe5 |
5 | my ($out) = __FILE__ =~ /(^.*)\.PL/; |
6 | if ($^O eq 'VMS') { ($out) = __FILE__ =~ /^(.+)_PL$/i; } |
c529f79d |
7 | $out =~ s/_h$/.h/; |
4c1f658f |
8 | open(OUT,">$out") || die "Cannot open $file:$!"; |
918c0b2d |
9 | print "Extracting $out . . .\n"; |
4c1f658f |
10 | foreach my $const (qw(AVf_REAL |
b874ff32 |
11 | HEf_SVKEY |
0ca04487 |
12 | SVf_IOK SVf_IVisUV SVf_NOK SVf_POK |
13 | SVf_ROK SVp_IOK SVp_POK )) |
4c1f658f |
14 | { |
15 | doconst($const); |
16 | } |
17 | foreach my $file (qw(op.h cop.h)) |
18 | { |
19 | open(OPH,"../../$file") || die "Cannot open ../../$file:$!"; |
20 | while (<OPH>) |
21 | { |
22 | doconst($1) if (/#define\s+(\w+)\s+([\(\)\|\dx]+)\s*(?:$|\/\*)/); |
23 | } |
24 | close(OPH); |
25 | } |
26 | close(OUT); |
27 | |
28 | sub doconst |
29 | { |
30 | my $sym = shift; |
31 | my $l = length($sym); |
32 | print OUT <<"END"; |
33 | newCONSTSUB(stash,"$sym",newSViv($sym)); |
79cb57f6 |
34 | av_push(export_ok,newSVpvn("$sym",$l)); |
4c1f658f |
35 | END |
36 | } |