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

ruby-changes:11026

From: shyouhei <ko1@a...>
Date: Wed, 25 Feb 2009 15:05:27 +0900 (JST)
Subject: [ruby-changes:11026] Ruby:r22617 (ruby_1_8_6): merge revision(s) 21505:

shyouhei	2009-02-25 15:05:16 +0900 (Wed, 25 Feb 2009)

  New Revision: 22617

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

  Log:
    merge revision(s) 21505:
    * ext/socket/extconf.rb (gai_strerror): checks if available and if
      returns const pointer.
    * ext/socket/getaddrinfo.c (gai_strerror): defines only if non
      available.  [ruby-core:21328]

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/ext/socket/extconf.rb
    branches/ruby_1_8_6/ext/socket/getaddrinfo.c
    branches/ruby_1_8_6/version.h

Index: ruby_1_8_6/ext/socket/getaddrinfo.c
===================================================================
--- ruby_1_8_6/ext/socket/getaddrinfo.c	(revision 22616)
+++ ruby_1_8_6/ext/socket/getaddrinfo.c	(revision 22617)
@@ -39,6 +39,9 @@
  */
 
 #include "config.h"
+#ifdef RUBY_EXTCONF_H
+#include RUBY_EXTCONF_H
+#endif
 #include <sys/types.h>
 #if !defined(_WIN32) && !defined(__VMS)
 #include <sys/param.h>
@@ -199,7 +202,8 @@
 
 #define ERR(err) { error = (err); goto bad; }
 
-#if defined __UCLIBC__
+#ifndef HAVE_GAI_STRERROR
+#ifdef GAI_STRERROR_CONST
 const
 #endif
 char *
@@ -210,6 +214,7 @@
 		ecode = EAI_MAX;
 	return (char *)ai_errlist[ecode];
 }
+#endif
 
 void
 freeaddrinfo(ai)
@@ -388,7 +393,7 @@
 			port = htons((unsigned short)atoi(servname));
 		} else {
 			struct servent *sp;
-			char *proto;
+			const char *proto;
 
 			proto = NULL;
 			switch (pai->ai_socktype) {
Index: ruby_1_8_6/ext/socket/extconf.rb
===================================================================
--- ruby_1_8_6/ext/socket/extconf.rb	(revision 22616)
+++ ruby_1_8_6/ext/socket/extconf.rb	(revision 22617)
@@ -259,6 +259,19 @@
   have_func("inet_ntop") or have_func("inet_ntoa")
   have_func("inet_pton") or have_func("inet_aton")
   have_func("getservbyport")
+  if have_func("gai_strerror")
+    unless checking_for("gai_strerror() returns const pointer") {!try_compile(<<EOF)}
+#{cpp_include(headers)}
+#include <stdlib.h>
+void
+conftest_gai_strerror_is_const()
+{
+    *gai_strerror(0) = 0;
+}
+EOF
+      $defs << "-DGAI_STRERROR_CONST"
+    end
+  end
   have_header("arpa/nameser.h")
   have_header("resolv.h")
 end
Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 22616)
+++ ruby_1_8_6/ChangeLog	(revision 22617)
@@ -1,3 +1,11 @@
+Wed Feb 25 15:04:31 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/socket/extconf.rb (gai_strerror): checks if available and if
+	  returns const pointer.
+
+	* ext/socket/getaddrinfo.c (gai_strerror): defines only if non
+	  available.  [ruby-core:21328]
+
 Wed Feb 25 14:56:30 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 22616)
+++ ruby_1_8_6/version.h	(revision 22617)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2009-02-25"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20090225
-#define RUBY_PATCHLEVEL 353
+#define RUBY_PATCHLEVEL 354
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8

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

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