diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:15 (GMT) |
commit | 6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28 (patch) | |
tree | 7d22c170916773ed8248dc5d4b42f9caaa291baf /win/tclWinInit.c | |
parent | 4830ed53a3b546ff699230e332c0a6d4fecf5a24 (diff) | |
parent | eb476fdf9350b70cf8ab1ec90ad848dec9d1b75b (diff) | |
download | tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.zip tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.gz tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.bz2 |
Merge completion of dgp-read-bytes branch.
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 2f3c7e8..4e860b2 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -113,8 +113,8 @@ static int ToUtf(CONST WCHAR *wSrc, char *dst); * * TclpInitPlatform -- * - * Initialize all the platform-dependant things like signals and - * floating-point error handling. + * Initialize all the platform-dependant things like signals, + * floating-point error handling and sockets. * * Called at process initialization time. * @@ -130,20 +130,16 @@ static int ToUtf(CONST WCHAR *wSrc, char *dst); void TclpInitPlatform(void) { - tclPlatform = TCL_PLATFORM_WINDOWS; + WSADATA wsaData; + WORD wVersionRequested = MAKEWORD(2, 2); - /* - * The following code stops Windows 3.X and Windows NT 3.51 from - * automatically putting up Sharing Violation dialogs, e.g, when someone - * tries to access a file that is locked or a drive with no disk in it. - * Tcl already returns the appropriate error to the caller, and they can - * decide to put up their own dialog in response to that failure. - * - * Under 95 and NT 4.0, this is a NOOP because the system doesn't - * automatically put up dialogs when the above operations fail. - */ + tclPlatform = TCL_PLATFORM_WINDOWS; - SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS); + /* + * Initialize the winsock library. On Windows XP and higher this + * can never fail. + */ + WSAStartup(wVersionRequested, &wsaData); #ifdef STATIC_BUILD /* |