… | |
… | |
5 | use Config; |
5 | use Config; |
6 | |
6 | |
7 | # when built as part of perl, these are not available |
7 | # when built as part of perl, these are not available |
8 | BEGIN { eval "use Socket ()" } |
8 | BEGIN { eval "use Socket ()" } |
9 | BEGIN { eval "use Fcntl ()" } |
9 | BEGIN { eval "use Fcntl ()" } |
|
|
10 | BEGIN { eval "use POSIX ()" } |
10 | |
11 | |
11 | open my $fh, ">lib/AnyEvent/constants.pl" |
12 | open my $fh, ">lib/AnyEvent/constants.pl" |
12 | or die "lib/AnyEvent/constants.pl: $_[0]\n"; |
13 | or die "lib/AnyEvent/constants.pl: $_[0]\n"; |
13 | |
14 | |
14 | my $oldstdout = select $fh; |
15 | my $oldstdout = select $fh; |
… | |
… | |
35 | |
36 | |
36 | i F_SETFD => eval { Fcntl::F_SETFD() } || 2; |
37 | i F_SETFD => eval { Fcntl::F_SETFD() } || 2; |
37 | i F_SETFL => eval { Fcntl::F_SETFL() } || 4; |
38 | i F_SETFL => eval { Fcntl::F_SETFL() } || 4; |
38 | i O_NONBLOCK => eval { Fcntl::O_NONBLOCK() } || 04000; |
39 | i O_NONBLOCK => eval { Fcntl::O_NONBLOCK() } || 04000; |
39 | i FD_CLOEXEC => eval { Fcntl::FD_CLOEXEC() } || 1; |
40 | i FD_CLOEXEC => eval { Fcntl::FD_CLOEXEC() } || 1; |
|
|
41 | |
|
|
42 | print "package AnyEvent::Base;\n"; |
|
|
43 | |
|
|
44 | # add these purely to avoid loading POSIX, which is slow and bloated. |
|
|
45 | |
|
|
46 | i WNOHANG => eval { POSIX::WNOHANG() } || 1; |
40 | |
47 | |
41 | print "package AnyEvent::Util;\n"; |
48 | print "package AnyEvent::Util;\n"; |
42 | |
49 | |
43 | # broken windows perls use undocumented error codes... |
50 | # broken windows perls use undocumented error codes... |
44 | if ($WIN32) { |
51 | if ($WIN32) { |