aboutsummaryrefslogtreecommitdiffstats
path: root/win32/win32.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-10 04:55:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-10 04:55:34 +0000
commita32bc08d36360adf59806908ebe790ff03f689a2 (patch)
treeaff30ce96dfe57baca2258006515aa59f57e8988 /win32/win32.c
parent0de28773260c8c47dec6a39711765c27acc646de (diff)
downloadruby-a32bc08d36360adf59806908ebe790ff03f689a2.tar.gz
* configure.in, win32/Makefile.sub (LIBS, COMMON_HEADERS): use
winsock2 on mswin32/mingw. * ext/socket/extconf.rb: ditto. * win32/win32.c (StartSockets): ditto. * win32/win32.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 166d58e792..ea379c754a 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1972,21 +1972,17 @@ StartSockets(void)
{
WORD version;
WSADATA retdata;
- int ret;
int iSockOpt;
//
// initalize the winsock interface and insure that it's
// cleaned up at exit.
//
- version = MAKEWORD(1, 1);
- if (ret = WSAStartup(version, &retdata))
+ version = MAKEWORD(2, 0);
+ if (WSAStartup(version, &retdata))
rb_fatal ("Unable to locate winsock library!\n");
- if (LOBYTE(retdata.wVersion) != 1)
- rb_fatal("could not find version 1 of winsock dll\n");
-
- if (HIBYTE(retdata.wVersion) != 1)
- rb_fatal("could not find version 1 of winsock dll\n");
+ if (LOBYTE(retdata.wVersion) != 2)
+ rb_fatal("could not find version 2 of winsock dll\n");
atexit((void (*)(void)) WSACleanup);
@@ -3658,7 +3654,7 @@ rb_w32_fopen(const char *path, const char *mode)
}
FILE *
-rb_w32_fdopen(int handle, char *type)
+rb_w32_fdopen(int handle, const char *type)
{
FILE *f = (errno = 0, _fdopen(handle, type));
if (f == NULL && errno == 0) {