diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-20 11:06:22 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-20 11:06:22 +0000 |
| commit | 5709562113559e3c7ff93df08d1f9dedf31ed902 (patch) | |
| tree | ec88a2fa738319100ca02d648dfb3800badf5c73 /ext/socket | |
| parent | 66238bfdff108d7a11052d1a9ad386b59e739cb2 (diff) | |
| download | ruby-5709562113559e3c7ff93df08d1f9dedf31ed902.tar.gz ruby-5709562113559e3c7ff93df08d1f9dedf31ed902.tar.xz ruby-5709562113559e3c7ff93df08d1f9dedf31ed902.zip | |
* ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.
* ext/socket/mkconstants.rb: prepend header if -H is not given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
| -rw-r--r-- | ext/socket/mkconstants.rb | 9 | ||||
| -rw-r--r-- | ext/socket/rubysocket.h | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb index bc574aa3e..c7f599beb 100644 --- a/ext/socket/mkconstants.rb +++ b/ext/socket/mkconstants.rb @@ -34,10 +34,7 @@ end opt.parse! -result = '' -# workaround for NetBSD, OpenBSD and etc. -result << "#define pseudo_AF_FTIP pseudo_AF_RTIP\n" h = {} DATA.each_line {|s| @@ -258,7 +255,8 @@ def_intern('intern_protocol_family', /\APF_/) def_intern('intern_socktype', /\ASOCK_/) def_intern('intern_ipproto', /\AIPPROTO_/) -result << ERB.new(<<'EOS', nil, '%').result(binding) +result = ERB.new(<<'EOS', nil, '%').result(binding) +/* autogenerated file */ <%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %> @@ -276,6 +274,7 @@ init_constants(VALUE mConst) EOS header_result = ERB.new(<<'EOS', nil, '%').result(binding) +/* autogenerated file */ <%= gen_const_decls %> <%= NAME_TO_INT_DEFS.map {|decl, func| decl }.join("\n") %> <%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| decl }.join("\n") %> @@ -285,6 +284,8 @@ if opt_H File.open(opt_H, 'w') {|f| f << header_result } +else + result = header_result + result end if opt_o diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h index 365eab63d..6d4a70a95 100644 --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -59,9 +59,20 @@ #include <fcntl.h> #endif #endif + #ifndef EWOULDBLOCK #define EWOULDBLOCK EAGAIN #endif + +/* + * workaround for NetBSD, OpenBSD and etc. + * The problem is since 4.4BSD-Lite. + * FreeBSD fix the problem at FreeBSD 2.2.0. + * NetBSD fix the problem at NetBSD 3.0 by kern/29624. + * OpenBSD fix the problem at OpenBSD 3.8. + */ +#define pseudo_AF_FTIP pseudo_AF_RTIP + #ifndef HAVE_GETADDRINFO # include "addrinfo.h" #endif |
