summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-05-02 08:59:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-05-02 08:59:56 (GMT)
commit1e3394cc4fee92acebb7c79a7fb31aba9e1aab54 (patch)
tree84ad5e5324401e5fb231e9656e4bcecbb3387ae7 /win/tclWinInit.c
parent340a361ed19847861c47b986eb8d522c1a6cc700 (diff)
parent7ea92b545f09208376e9a9f8aa1aac53148f3f65 (diff)
downloadtcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.zip
tcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.tar.gz
tcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.tar.bz2
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 2c21d38..8b600f6 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)
{
+ WSADATA wsaData;
+ WORD wVersionRequested = MAKEWORD(2, 2);
+
tclPlatform = TCL_PLATFORM_WINDOWS;
/*
- * 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.
+ * Initialize the winsock library. On Windows XP and higher this
+ * can never fail.
*/
-
- SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS);
+ WSAStartup(wVersionRequested, &wsaData);
#ifdef STATIC_BUILD
/*