This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
doc tweak suggested by M.J.T. Guy <mjtg@cus.cam.ac.uk>
[perl5.git] / ext / B / defsubs.h.PL
CommitLineData
4c1f658f 1#!perl
a12fb911
HM
2my ($out) = __FILE__ =~ /(^.*)[._]PL/i;
3if ($^O eq 'VMS') { $out =~ s/(^.*)[._](.*$)/$1.$2/;}
4c1f658f
NIS
4open(OUT,">$out") || die "Cannot open $file:$!";
5foreach my $const (qw(AVf_REAL
b874ff32 6 HEf_SVKEY
4c1f658f
NIS
7 SVf_IOK SVf_NOK SVf_POK SVf_ROK SVp_IOK SVp_POK ))
8 {
9 doconst($const);
10 }
11foreach my $file (qw(op.h cop.h))
12 {
13 open(OPH,"../../$file") || die "Cannot open ../../$file:$!";
14 while (<OPH>)
15 {
16 doconst($1) if (/#define\s+(\w+)\s+([\(\)\|\dx]+)\s*(?:$|\/\*)/);
17 }
18 close(OPH);
19 }
20close(OUT);
21
22sub doconst
23{
24 my $sym = shift;
25 my $l = length($sym);
26 print OUT <<"END";
27 newCONSTSUB(stash,"$sym",newSViv($sym));
28 av_push(export_ok,newSVpv("$sym",$l));
29END
30}