summaryrefslogtreecommitdiffstats
path: root/win/tclWinReg.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-19 11:58:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-19 11:58:58 (GMT)
commit67e3f2064bffa1c3b92cde8ab9e703e8362d37ee (patch)
treeb60cac94f49d85f59905728841fb9d50b29c1736 /win/tclWinReg.c
parentbccf168ae55a2c314248ee8e3a2369efba47f317 (diff)
downloadtcl-67e3f2064bffa1c3b92cde8ab9e703e8362d37ee.zip
tcl-67e3f2064bffa1c3b92cde8ab9e703e8362d37ee.tar.gz
tcl-67e3f2064bffa1c3b92cde8ab9e703e8362d37ee.tar.bz2
make tclWinReg.c compile/run without UNICODE (suggested in bug #3362446)
Diffstat (limited to 'win/tclWinReg.c')
-rw-r--r--win/tclWinReg.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 937089c..aa06e44 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -22,6 +22,13 @@
#endif
#include <stdlib.h>
+#ifndef UNICODE
+# undef Tcl_WinTCharToUtf
+# define Tcl_WinTCharToUtf(a,b,c) Tcl_ExternalToUtfDString(NULL,a,b,c)
+# undef Tcl_WinUtfToTChar
+# define Tcl_WinUtfToTChar(a,b,c) Tcl_UtfToExternalDString(NULL,a,b,c)
+#endif
+
/*
* Ensure that we can say which registry is being accessed.
*/
@@ -611,7 +618,7 @@ GetKeyNames(
result = TCL_ERROR;
break;
}
- Tcl_WinTCharToUtf(buffer, bufSize * sizeof(WCHAR), &ds);
+ Tcl_WinTCharToUtf(buffer, bufSize * sizeof(TCHAR), &ds);
name = Tcl_DStringValue(&ds);
if (pattern && !Tcl_StringMatch(name, pattern)) {
Tcl_DStringFree(&ds);
@@ -898,7 +905,7 @@ GetValueNames(
resultPtr = Tcl_NewObj();
Tcl_DStringInit(&buffer);
Tcl_DStringSetLength(&buffer,
- (int) (maxSize*sizeof(WCHAR)));
+ (int) (maxSize*sizeof(TCHAR)));
index = 0;
result = TCL_OK;
@@ -1209,7 +1216,7 @@ RecursiveDeleteKey(
Tcl_DStringInit(&subkey);
Tcl_DStringSetLength(&subkey,
- (int) (maxSize * sizeof(WCHAR)));
+ (int) (maxSize * sizeof(TCHAR)));
mode = saveMode;
while (result == ERROR_SUCCESS) {