[前][次][番号順一覧][スレッド一覧]

ruby-changes:10154

From: akr <ko1@a...>
Date: Tue, 20 Jan 2009 20:06:40 +0900 (JST)
Subject: [ruby-changes:10154] Ruby:r21698 (trunk): * ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.

akr	2009-01-20 20:06:22 +0900 (Tue, 20 Jan 2009)

  New Revision: 21698

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21698

  Log:
    * ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.
    * ext/socket/mkconstants.rb: prepend header if -H is not given.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/mkconstants.rb
    trunk/ext/socket/rubysocket.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21697)
+++ ChangeLog	(revision 21698)
@@ -1,3 +1,9 @@
+Tue Jan 20 20:05:21 2009  Tanaka Akira  <akr@f...>
+
+	* ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.
+
+	* ext/socket/mkconstants.rb: prepend header if -H is not given.
+
 Tue Jan 20 17:50:00 2009  NARUSE, Yui  <naruse@r...>
 
 	* ext/nkf/nkf-utf8/nkf.c (nkf_buf): use nkf_char.
Index: ext/socket/rubysocket.h
===================================================================
--- ext/socket/rubysocket.h	(revision 21697)
+++ ext/socket/rubysocket.h	(revision 21698)
@@ -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
Index: ext/socket/mkconstants.rb
===================================================================
--- ext/socket/mkconstants.rb	(revision 21697)
+++ ext/socket/mkconstants.rb	(revision 21698)
@@ -34,10 +34,7 @@
 
 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_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 @@
 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 @@
   File.open(opt_H, 'w') {|f|
     f << header_result
   }
+else
+  result = header_result + result
 end
 
 if opt_o

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]