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.12 by root, Sat Sep 22 00:22:59 2012 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: $!\n";
10 14
11my $oldstdout = select $fh; 15my $oldstdout = select $fh;
12 16
13print "# automatically generated from constants.pl.PL for perl $] built for $Config{archname}\n"; 17print "# automatically generated from constants.pl.PL for perl $] built for $Config{archname}\n";
14 18
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;
47
48print "package AnyEvent::IO;\n";
49
50i O_RDONLY => eval { Fcntl::O_RDONLY() } || 0;
51i O_WRONLY => eval { Fcntl::O_WRONLY() } || 1;
52i O_RDWR => eval { Fcntl::O_RDWR () } || 2;
53i O_CREAT => eval { Fcntl::O_CREAT () } || 64;
54i O_EXCL => eval { Fcntl::O_EXCL () } || 128;
55i O_TRUNC => eval { Fcntl::O_TRUNC () } || 512;
56i O_APPEND => eval { Fcntl::O_APPEND() } || 1024;
38 57
39print "package AnyEvent::Util;\n"; 58print "package AnyEvent::Util;\n";
40 59
41# broken windows perls use undocumented error codes... 60# broken windows perls use undocumented error codes...
42if ($WIN32) { 61if ($WIN32) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines