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.7 by root, Mon Oct 11 04:17:55 2010 UTC vs.
Revision 1.10 by root, Sun Dec 5 11:41:45 2010 UTC

1#! perl 1#! perl
2 2
3# this file is unfortunately only executed at Makefile.PL time 3# this file is unfortunately only executed at Makefile.PL time
4 4
5use Config; 5use Config;
6use Socket; 6
7# when built as part of perl, these are not available
8BEGIN { eval "use Socket ()" }
9BEGIN { eval "use Fcntl ()" }
10BEGIN { eval "use POSIX ()" }
7 11
8open my $fh, ">lib/AnyEvent/constants.pl" 12open my $fh, ">lib/AnyEvent/constants.pl"
9 or die "lib/AnyEvent/constants.pl: $_[0]\n"; 13 or die "lib/AnyEvent/constants.pl: $_[0]\n";
10 14
11my $oldstdout = select $fh; 15my $oldstdout = select $fh;
27# used a lot 31# used a lot
28i CYGWIN => $^O =~ /cygwin/i; 32i CYGWIN => $^O =~ /cygwin/i;
29i WIN32 => $WIN32; 33i WIN32 => $WIN32;
30 34
31# add these purely to avoid loading Fcntl, which is slow and bloated. 35# add these purely to avoid loading Fcntl, which is slow and bloated.
32use Fcntl ();
33 36
34i F_SETFL => eval { Fcntl::F_SETFL() };
35i F_SETFD => eval { Fcntl::F_SETFD() }; 37i F_SETFD => eval { Fcntl::F_SETFD() } || 2;
38i F_SETFL => eval { Fcntl::F_SETFL() } || 4;
36i O_NONBLOCK => eval { Fcntl::O_NONBLOCK() }; 39i O_NONBLOCK => eval { Fcntl::O_NONBLOCK() } || 04000;
37i FD_CLOEXEC => eval { Fcntl::FD_CLOEXEC() }; 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;
38 47
39print "package AnyEvent::Util;\n"; 48print "package AnyEvent::Util;\n";
40 49
41# broken windows perls use undocumented error codes... 50# broken windows perls use undocumented error codes...
42if ($WIN32) { 51if ($WIN32) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines