summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/tclWinChan.c2
-rw-r--r--win/tclWinConsole.c2
-rw-r--r--win/tclWinInt.h6
-rw-r--r--win/tclWinPipe.c2
-rw-r--r--win/tclWinSerial.c2
-rw-r--r--win/tclWinSock.c8
6 files changed, 14 insertions, 8 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 0f17834..a20cb8f 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -1337,7 +1337,7 @@ TclWinOpenFileChannel(
infoPtr->flags = appendMode;
infoPtr->handle = handle;
infoPtr->dirty = 0;
- wsprintfA(channelName, "file%lx", PTR2INT(infoPtr));
+ sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr);
infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName,
(ClientData) infoPtr, permissions);
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 8be8e09..a86608c 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -1362,7 +1362,7 @@ TclWinOpenConsoleChannel(
* for instance).
*/
- wsprintfA(channelName, "file%lx", PTR2INT(infoPtr));
+ sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr);
infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName,
(ClientData) infoPtr, permissions);
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index a76865d..2f6659c 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -35,6 +35,12 @@
#define VER_PLATFORM_WIN32_CE 3
#endif
+#ifdef _WIN64
+# define TCL_I_MODIFIER "I"
+#else
+# define TCL_I_MODIFIER ""
+#endif
+
/*
* The following structure keeps track of whether we are using the
* multi-byte or the wide-character interfaces to the operating system.
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 0ef8d19..9a529d2 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -1707,7 +1707,7 @@ TclpCreateCommandChannel(
* unique, in case channels share handles (stdin/stdout).
*/
- wsprintfA(channelName, "file%lx", infoPtr);
+ sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr);
infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName,
(ClientData) infoPtr, infoPtr->validMask);
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index fb092ff..1417c9c 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1499,7 +1499,7 @@ TclWinOpenSerialChannel(
* are shared between multiple channels (stdin/stdout).
*/
- wsprintfA(channelName, "file%lx", PTR2INT(infoPtr));
+ sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr);
infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName,
(ClientData) infoPtr, permissions);
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 9591163..0560bbe 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -1273,7 +1273,7 @@ Tcl_OpenTcpClient(
return NULL;
}
- wsprintfA(channelName, "sock%d", infoPtr->socket);
+ sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket);
infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
(ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE));
@@ -1338,7 +1338,7 @@ Tcl_MakeTcpClientChannel(
SendMessage(tsdPtr->hwnd, SOCKET_SELECT,
(WPARAM) SELECT, (LPARAM) infoPtr);
- wsprintfA(channelName, "sock%d", infoPtr->socket);
+ sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket);
infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
(ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE));
Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto crlf");
@@ -1391,7 +1391,7 @@ Tcl_OpenTcpServer(
infoPtr->acceptProc = acceptProc;
infoPtr->acceptProcData = acceptProcData;
- wsprintfA(channelName, "sock%d", infoPtr->socket);
+ sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket);
infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
(ClientData) infoPtr, 0);
@@ -1497,7 +1497,7 @@ TcpAccept(
SendMessage(tsdPtr->hwnd, SOCKET_SELECT,
(WPARAM) SELECT, (LPARAM) newInfoPtr);
- wsprintfA(channelName, "sock%d", newInfoPtr->socket);
+ sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)newInfoPtr->socket);
newInfoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
(ClientData) newInfoPtr, (TCL_READABLE | TCL_WRITABLE));
if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-translation",