my $file;
foreach $file (get_files()) {
process_file($file);
- if ($^O eq 'MSWin32') {
- $file =~ s/errno/winsock/;
- process_file($file);
- }
}
write_errno_pm();
unlink "errno.c" if -f "errno.c";
# hidden in a special place
$file{'/boot/develop/headers/posix/errno.h'} = 1;
+ } elsif ($^O eq 'vos') {
+ # avoid problem where cpp returns non-POSIX pathnames
+ $file{'/system/include_library/errno.h'} = 1;
} else {
open(CPPI,"> errno.c") or
die "Cannot open errno.c";
if ($^O eq 'NetWare') {
- print CPPI "#include <nwerrno.h>\n";
+ print CPPI "#include <nwerrno.h>\n";
} else {
- print CPPI "#include <errno.h>\n";
+ print CPPI "#include <errno.h>\n";
+ if ($^O eq 'MSWin32') {
+ print CPPI "#define _WINSOCKAPI_\n"; # don't drag in everything
+ print CPPI "#include <winsock.h>\n";
+ }
}
close(CPPI);
my($name,$expr);
next unless ($name, $expr) = /"(.*?)"\s*\[\s*\[\s*(.*?)\s*\]\s*\]/;
next if $name eq $expr;
- $expr =~ s/(\d+)[LU]+\b/$1/g; # 2147483647L et alia
+ $expr =~ s/\(?\(\w+\)([^\)]*)\)?/$1/; # ((type)0xcafebabe) at alia
+ $expr =~ s/((?:0x)?[0-9a-fA-F]+)[LU]+\b/$1/g; # 2147483647L et alia
+ next if $expr =~ m/^[a-zA-Z]+$/; # skip some Win32 functions
+ if($expr =~ m/^0[xX]/) {
+ $err{$name} = hex $expr;
+ }
+ else {
$err{$name} = eval $expr;
}
+ delete $err{$name} unless defined $err{$name};
+ }
close(CPPO);
}
die "Errno architecture ($Config{'archname'}-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
\$VERSION = "$VERSION";
+\$VERSION = eval \$VERSION;
\@ISA = qw(Exporter);
EDQ