!!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.fnc, embed.pl,
-pp.sym, intrpvar.h, perlvars.h and thrdvar.h.
+pp.sym, intrpvar.h, and perlvars.h.
Any changes made here will be lost!
Edit those files and run 'make regen_headers' to effect changes.
$ret .= "$arg\n";
}
else {
- my ($flags,$retval,$func,@args) = @_;
+ my ($flags,$retval,$plain_func,@args) = @_;
my @nonnull;
my $has_context = ( $flags !~ /n/ );
my $never_returns = ( $flags =~ /r/ );
my $commented_out = ( $flags =~ /m/ );
my $is_malloc = ( $flags =~ /a/ );
my $can_ignore = ( $flags !~ /R/ ) && !$is_malloc;
+ my @names_of_nn;
+ my $func;
my $splint_flags = "";
if ( $SPLINT && !$commented_out ) {
if ($flags =~ /s/) {
$retval = "STATIC $splint_flags$retval";
- $func = "S_$func";
+ $func = "S_$plain_func";
}
else {
$retval = "PERL_CALLCONV $splint_flags$retval";
- if ($flags =~ /p/) {
- $func = "Perl_$func";
+ if ($flags =~ /[bp]/) {
+ $func = "Perl_$plain_func";
+ } else {
+ $func = $plain_func;
}
}
$ret .= "$retval\t$func(";
my $temp_arg = $arg;
$temp_arg =~ s/\*//g;
$temp_arg =~ s/\s*\bstruct\b\s*/ /g;
- if ( ($temp_arg ne "...") && ($temp_arg !~ /\w+\s+\w+/) ) {
- warn "$func: $arg doesn't have a name\n";
+ if ( ($temp_arg ne "...")
+ && ($temp_arg !~ /\w+\s+(\w+)(?:\[\d+\])?\s*$/) ) {
+ warn "$func: $arg ($n) doesn't have a name\n";
}
if ( $SPLINT && $nullok && !$commented_out ) {
$arg = '/*@null@*/ ' . $arg;
}
+ if (defined $1 && $nn) {
+ push @names_of_nn, $1;
+ }
}
$ret .= join ", ", @args;
}
}
$ret .= ";";
$ret = "/* $ret */" if $commented_out;
+ if (@names_of_nn) {
+ $ret .= "\n#define PERL_ARGS_ASSERT_\U$plain_func\E\t\\\n\t"
+ . join '; ', map "assert($_)", @names_of_nn;
+ }
$ret .= @attrs ? "\n\n" : "\n";
}
$ret;
s/[ \t]*#.*//; # Delete comments.
if (/^\s*(\S+)\s*$/) {
my $sym = $1;
- warn "duplicate symbol $sym while processing $file\n"
+ warn "duplicate symbol $sym while processing $file line $.\n"
if exists $$syms{$sym};
$$syms{$sym} = 1;
}
if (/PERLVARA?I?S?C?\($pre(\w+)/) {
my $sym = $1;
$sym = $pre . $sym if $keep_pre;
- warn "duplicate symbol $sym while processing $file\n"
+ warn "duplicate symbol $sym while processing $file line $.\n"
if exists $$syms{$sym};
$$syms{$sym} = $pre || 1;
}
}
my %intrp;
-my %thread;
my %globvar;
readvars %intrp, 'intrpvar.h','I';
-readvars %thread, 'thrdvar.h','T';
readvars %globvar, 'perlvars.h','G';
my $sym;
-foreach $sym (sort keys %thread) {
- warn "$sym in intrpvar.h as well as thrdvar.h\n" if exists $intrp{$sym};
-}
sub undefine ($) {
my ($sym) = @_;
END
-for $sym (sort keys %thread) {
- print EM multon($sym,'T','vTHX->');
-}
-
-print EM <<'END';
-
-/* cases 2 and 3 above */
-
-END
-
for $sym (sort keys %intrp) {
print EM multon($sym,'I','vTHX->');
}
END
-for $sym (sort keys %thread) {
- print EM multoff($sym,'T');
-}
-
print EM <<'END';
#endif /* MULTIPLICITY */
#define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \
EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX);
-#include "thrdvar.h"
#include "intrpvar.h"
#include "perlvars.h"
#pragma message disable (nonstandcast)
#endif
-#include "thrdvar.h"
#include "intrpvar.h"
#include "perlvars.h"
print CAPIH bincompat_var('I',$sym);
}
-foreach $sym (sort keys %thread) {
- print CAPIH bincompat_var('T',$sym);
-}
-
foreach $sym (sort keys %globvar) {
print CAPIH bincompat_var('G',$sym);
}
#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); }
-#include "thrdvar.h"
#include "intrpvar.h"
#undef PERLVAR