diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-23 02:54:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-23 02:54:04 +0000 |
commit | 1b81dafdd5601dbfe0818b4ddc1c4a53ecd0270d (patch) | |
tree | d9104bd2b88bf1e124ce18a4b0ffca1f37c7d12f /win32/win32.c | |
parent | 0728a4ed706119abe392f330dc31f890964ce885 (diff) |
win32/win32.c: add rb_w32_inet_pton
* include/ruby/win32.h, win32/win32.c (rb_w32_inet_pton): add a
wrapper function for inet_pton minimum supported client is
Vista, as well as inet_ntop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index 2c888ae4c4..fbfbc37683 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -6959,6 +6959,19 @@ rb_w32_inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len) } /* License: Ruby's */ +int WSAAPI +rb_w32_inet_pton(int af, const char *src, void *dst) +{ + typedef int (WSAAPI inet_pton_t)(int, const char*, void *); + inet_pton_t *pInetPton; + pInetPton = (inet_pton_t *)get_proc_address("ws2_32", "inet_pton", NULL); + if (pInetPton) { + return pInetPton(af, src, dst); + } + return 0; +} + +/* License: Ruby's */ char rb_w32_fd_is_text(int fd) { |