mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
96a49b1ada
commit
f188bf2acb
3 changed files with 26 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Wed Jan 14 13:09:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Wed Jan 14 12:39:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_wait_readable, rb_io_wait_writable): need rb_fd_ptr.
|
* io.c (rb_io_wait_readable, rb_io_wait_writable): need rb_fd_ptr.
|
||||||
|
|
|
@ -255,6 +255,19 @@ unless getaddr_info_ok and have_func("getnameinfo", headers) and have_func("geta
|
||||||
have_func("inet_ntop") or have_func("inet_ntoa")
|
have_func("inet_ntop") or have_func("inet_ntoa")
|
||||||
have_func("inet_pton") or have_func("inet_aton")
|
have_func("inet_pton") or have_func("inet_aton")
|
||||||
have_func("getservbyport")
|
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("arpa/nameser.h")
|
||||||
have_header("resolv.h")
|
have_header("resolv.h")
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ruby/config.h"
|
#include "ruby/config.h"
|
||||||
|
#ifdef RUBY_EXTCONF_H
|
||||||
|
#include RUBY_EXTCONF_H
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -195,8 +198,8 @@ if (pai->ai_flags & AI_CANONNAME) {\
|
||||||
|
|
||||||
#define ERR(err) { error = (err); goto bad; }
|
#define ERR(err) { error = (err); goto bad; }
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
#ifndef HAVE_GAI_STRERROR
|
||||||
#if defined __UCLIBC__
|
#ifdef GAI_STRERROR_CONST
|
||||||
const
|
const
|
||||||
#endif
|
#endif
|
||||||
char *
|
char *
|
||||||
|
|
Loading…
Add table
Reference in a new issue