die "Invalid attributes for data symbol: $symbol" if $isdata && ($atsign || defined $args);
die "\@funcname without \@4 suffix not recognized: $symbol" if $atsign && !defined $args;
die "Invalid \@$args number: $symbol" if defined $args && ($args<0 || ($args%4));
- if (!$argscdecl) {
+ if (!defined $argscdecl) { # beware: $argscdecl may eq "0"
die "Duplicate symbol: $symbol" if exists $def{$symbol};
}
else {
$args=$argscdecl;
}
$def{$symbol}={
- "type"=>($isdata ? "data" : (!defined $args ? "cdecl" : (!$atsign ? "stdcall" : "fastcall"))),
+ "type"=>($isdata ? "data" : (!defined($args) || defined($argscdecl) ? "cdecl" : (!$atsign ? "stdcall" : "fastcall"))),
(!defined $args ? () : ("args4"=>$args/4)),
};
}
die "Symbol not in *.def files: $symbol" if $iswhat ne "undef" && !$def{$symbol};
if ($iswhat eq "pass" || $iswhat eq "wrap") {
die "args count not fixed up for '$iswhat' type: ".$symbol."[".$def{$symbol}{"type"}."]"
- if !$def{$symbol}{"args4"} && $def{$symbol}{"type"} ne "data";
+ if !exists $def{$symbol}{"args4"} && $def{$symbol}{"type"} ne "data"; # beware: {"args"} may ==0
die "'$iswhat' not permitted if <patch> not specified for module on symbol: $symbol" if !$patch{$module};
$def{$symbol}{$iswhat}=1;
}