ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/constants.pl.PL
(Generate patch)

Comparing AnyEvent/constants.pl.PL (file contents):
Revision 1.9 by root, Fri Nov 26 21:27:41 2010 UTC vs.
Revision 1.10 by root, Sun Dec 5 11:41:45 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines