summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-05-04 11:05:34 (GMT)
committernijtmans <nijtmans>2010-05-04 11:05:34 (GMT)
commit12f45b93f54d74dcc7e81bd9b04f9734f832f72f (patch)
tree766c8aedc9843dd60ab666a1ce391251c3c4bea4
parent603632160ce039289adcabac2684febc649c535b (diff)
downloadtcl-12f45b93f54d74dcc7e81bd9b04f9734f832f72f.zip
tcl-12f45b93f54d74dcc7e81bd9b04f9734f832f72f.tar.gz
tcl-12f45b93f54d74dcc7e81bd9b04f9734f832f72f.tar.bz2
TCHAR-related fixes, making those files compile fine when TCHAR != char
Please see comments in [Freq 2965056] (2965056-1.patch).
-rw-r--r--ChangeLog6
-rw-r--r--win/tclWinNotify.c11
-rw-r--r--win/tclWinSock.c11
3 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a64eb7..f24c9e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinNotify.c TCHAR-related fixes, making those two
+ * win/tclWinSock.c files compile fine when TCHAR != char
+ Please see comments in [Freq 2965056] (2965056-1.patch).
+
2010-05-03 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclIORChan.c Use "tclIO.h" and "tclTomMathDecls.h"
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index 9e0db15..352379d 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinNotify.c,v 1.26 2009/11/18 21:59:49 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinNotify.c,v 1.27 2010/05/04 11:05:34 nijtmans Exp $
*/
#include "tclInt.h"
@@ -52,6 +52,7 @@ static Tcl_ThreadDataKey dataKey;
*/
static int notifierCount = 0;
+static const TCHAR classname[] = TEXT("TclNotifier");
TCL_DECLARE_MUTEX(notifierMutex)
/*
@@ -99,12 +100,12 @@ Tcl_InitNotifier(void)
class.hInstance = TclWinGetTclInstance();
class.hbrBackground = NULL;
class.lpszMenuName = NULL;
- class.lpszClassName = "TclNotifier";
+ class.lpszClassName = classname;
class.lpfnWndProc = NotifierProc;
class.hIcon = NULL;
class.hCursor = NULL;
- if (!RegisterClassA(&class)) {
+ if (!RegisterClass(&class)) {
Tcl_Panic("Unable to register TclNotifier window class");
}
}
@@ -187,7 +188,7 @@ Tcl_FinalizeNotifier(
Tcl_MutexLock(&notifierMutex);
notifierCount--;
if (notifierCount == 0) {
- UnregisterClassA("TclNotifier", TclWinGetTclInstance());
+ UnregisterClass(classname, TclWinGetTclInstance());
}
Tcl_MutexUnlock(&notifierMutex);
}
@@ -351,7 +352,7 @@ Tcl_ServiceModeHook(
*/
if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) {
- tsdPtr->hwnd = CreateWindowA("TclNotifier", "TclNotifier",
+ tsdPtr->hwnd = CreateWindow(classname, classname,
WS_TILED, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(),
NULL);
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 27f7245..63f5f0c 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.70 2010/03/07 14:39:25 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.71 2010/05/04 11:05:34 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -41,6 +41,7 @@
*/
static int initialized = 0;
+static const TCHAR classname[] = TEXT("TclSocket");
TCL_DECLARE_MUTEX(socketMutex)
/*
@@ -247,12 +248,12 @@ InitSockets(void)
windowClass.hInstance = TclWinGetTclInstance();
windowClass.hbrBackground = NULL;
windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = "TclSocket";
+ windowClass.lpszClassName = classname;
windowClass.lpfnWndProc = SocketProc;
windowClass.hIcon = NULL;
windowClass.hCursor = NULL;
- if (!RegisterClassA(&windowClass)) {
+ if (!RegisterClass(&windowClass)) {
TclWinConvertError(GetLastError());
goto initFailure;
}
@@ -394,7 +395,7 @@ SocketExitHandler(
*/
TclpFinalizeSockets();
- UnregisterClass("TclSocket", TclWinGetTclInstance());
+ UnregisterClass(classname, TclWinGetTclInstance());
WSACleanup();
initialized = 0;
Tcl_MutexUnlock(&socketMutex);
@@ -2192,7 +2193,7 @@ SocketThread(
* Create a dummy window receiving socket events.
*/
- tsdPtr->hwnd = CreateWindow("TclSocket", "TclSocket",
+ tsdPtr->hwnd = CreateWindow(classname, classname,
WS_TILED, 0, 0, 0, 0, NULL, NULL, windowClass.hInstance, arg);
/*