ruby-changes:10016
From: yugui <ko1@a...>
Date: Fri, 16 Jan 2009 00:39:39 +0900 (JST)
Subject: [ruby-changes:10016] Ruby:r21558 (ruby_1_9_1): merges r21505 from trunk into ruby_1_9_1.
yugui 2009-01-16 00:38:42 +0900 (Fri, 16 Jan 2009) New Revision: 21558 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21558 Log: merges r21505 from trunk into ruby_1_9_1. * 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_9_1/ChangeLog branches/ruby_1_9_1/ext/socket/extconf.rb branches/ruby_1_9_1/ext/socket/getaddrinfo.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21557) +++ ruby_1_9_1/ChangeLog (revision 21558) @@ -1,3 +1,11 @@ +Wed Jan 14 13:09:00 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 Jan 14 12:39:16 2009 Nobuyoshi Nakada <nobu@r...> * io.c (rb_io_wait_readable, rb_io_wait_writable): need rb_fd_ptr. Index: ruby_1_9_1/ext/socket/getaddrinfo.c =================================================================== --- ruby_1_9_1/ext/socket/getaddrinfo.c (revision 21557) +++ ruby_1_9_1/ext/socket/getaddrinfo.c (revision 21558) @@ -39,6 +39,9 @@ */ #include "ruby/config.h" +#ifdef RUBY_EXTCONF_H +#include RUBY_EXTCONF_H +#endif #include <sys/types.h> #ifndef _WIN32 #include <sys/param.h> @@ -195,8 +198,8 @@ #define ERR(err) { error = (err); goto bad; } -#ifndef __HAIKU__ -#if defined __UCLIBC__ +#ifndef HAVE_GAI_STRERROR +#ifdef GAI_STRERROR_CONST const #endif char * Index: ruby_1_9_1/ext/socket/extconf.rb =================================================================== --- ruby_1_9_1/ext/socket/extconf.rb (revision 21557) +++ ruby_1_9_1/ext/socket/extconf.rb (revision 21558) @@ -254,6 +254,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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/