summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-07 21:56:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-07 21:56:39 (GMT)
commit71b4090ae02441f5b4d00e4dbc2f1bcde3450673 (patch)
treec7eec21ad0a6f5318082759b6c2f365484128120
parentd67302e94fb352aa9ccd2937dedc696214a279ae (diff)
downloadtcl-71b4090ae02441f5b4d00e4dbc2f1bcde3450673.zip
tcl-71b4090ae02441f5b4d00e4dbc2f1bcde3450673.tar.gz
tcl-71b4090ae02441f5b4d00e4dbc2f1bcde3450673.tar.bz2
MSVC 6 does not have the %I modifier in sprintf
-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
5 files changed, 10 insertions, 4 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 090eaea..bbf7c92 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -1336,7 +1336,7 @@ TclWinOpenFileChannel(
infoPtr->flags = appendMode;
infoPtr->handle = handle;
infoPtr->dirty = 0;
- sprintf(channelName, "file%Ix", (size_t) infoPtr);
+ sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t) infoPtr);
infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName,
infoPtr, permissions);
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index f02b535..a056040 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -1360,7 +1360,7 @@ TclWinOpenConsoleChannel(
* for instance).
*/
- sprintf(channelName, "file%Ix", (size_t) infoPtr);
+ sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t) infoPtr);
infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName,
infoPtr, permissions);
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index 5e28d19..c75084a 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -27,6 +27,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 7fece95..8706f23 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -1630,7 +1630,7 @@ TclpCreateCommandChannel(
* unique, in case channels share handles (stdin/stdout).
*/
- sprintf(channelName, "file%Ix", (size_t) infoPtr);
+ sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t) infoPtr);
infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName,
infoPtr, infoPtr->validMask);
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index 3e766f3..819d866 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1501,7 +1501,7 @@ TclWinOpenSerialChannel(
* are shared between multiple channels (stdin/stdout).
*/
- sprintf(channelName, "file%Ix", (size_t) infoPtr);
+ sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t) infoPtr);
infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName,
infoPtr, permissions);