summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-18 14:10:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-18 14:10:06 +0000
commit05a278b4cdc8456580e51055ccb89fe4d1cd46ed (patch)
treebe02312738c84536b2ab08ccadbbec3c031fff76 /ext/socket/socket.c
parentbe2d3f5979f10cd06f6d1512ee367b2ec43ef315 (diff)
* ext/readline/readline.c: use rb_f_notimplement for methods not
implemented. * ext/openssl/ossl_engine.c: ditto. * ext/openssl/ossl_config.c: ditto. * ext/openssl/ossl_cipher.c: ditto. * ext/openssl/ossl_pkcs5.c: ditto. * ext/openssl/ossl_x509ext.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/basicsocket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. * ext/iconv/iconv.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 8b3d681d08..d041293a68 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -75,6 +75,7 @@ pair_yield(VALUE pair)
}
#endif
+#if defined HAVE_SOCKETPAIR
/*
* call-seq:
* Socket.pair(domain, type, protocol) => [socket1, socket2]
@@ -99,7 +100,6 @@ pair_yield(VALUE pair)
VALUE
rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
{
-#if defined HAVE_SOCKETPAIR
VALUE domain, type, protocol;
int d, t, p, sp[2];
int ret;
@@ -127,10 +127,10 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
return rb_ensure(pair_yield, r, io_close, s1);
}
return r;
+}
#else
- rb_notimplement();
+#define rsock_sock_s_socketpair rb_f_notimplement
#endif
-}
/*
* call-seq:
@@ -867,11 +867,7 @@ sock_gethostname(VALUE obj)
return rb_str_new2(un.nodename);
}
#else
-static VALUE
-sock_gethostname(VALUE obj)
-{
- rb_notimplement();
-}
+#define sock_gethostname rb_f_notimplement
#endif
#endif
@@ -1470,6 +1466,7 @@ sockaddr_obj(struct sockaddr *addr)
}
#endif
+#if defined(HAVE_GETIFADDRS) || (defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) && !defined(__hpux)) || defined(SIOCGIFCONF) || defined(_WIN32)
/*
* call-seq:
* Socket.ip_address_list => array
@@ -1748,10 +1745,11 @@ socket_s_ip_address_list(VALUE self)
CloseHandle(h);
return list;
-#else
- rb_notimplement();
#endif
}
+#else
+#define socket_s_ip_address_list rb_f_notimplement
+#endif
/*
* Class +Socket+ provides access to the underlying operating system