summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-03 20:25:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-03 20:25:14 (GMT)
commitee3826893da771c3254ecf2aa2da59790d1d0541 (patch)
tree4dde8a27dc8ba84476dbd8eaf698329ee7ba75fe /win/tclWin32Dll.c
parent474d95712ea623f7cccf704be60d713aa2ebe309 (diff)
parente74974e6cddc887a442d6134824509aeeb1ce0f7 (diff)
downloadtcl-ee3826893da771c3254ecf2aa2da59790d1d0541.zip
tcl-ee3826893da771c3254ecf2aa2da59790d1d0541.tar.gz
tcl-ee3826893da771c3254ecf2aa2da59790d1d0541.tar.bz2
Merge tip-548 (since using the *WChar* functions leads to less type-casts in c++)
Als finish implementaton for MacOSX
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 989d547..ebd0e24 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -463,6 +463,8 @@ TclWinDriveLetterForVolMountPoint(
*---------------------------------------------------------------------------
*/
+#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+#undef Tcl_WinUtfToTChar
WCHAR *
Tcl_WinUtfToTChar(
const char *string, /* Source string in UTF-8. */
@@ -472,12 +474,9 @@ Tcl_WinUtfToTChar(
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- if (!string) {
- return NULL;
- }
- return (WCHAR *)TclUtfToWCharDString(string, len, dsPtr);
+ return Tcl_UtfToWCharDString(string, len, dsPtr);
}
-
+#undef Tcl_WinTCharToUtf
char *
Tcl_WinTCharToUtf(
const WCHAR *string, /* Source string in Unicode. */
@@ -487,16 +486,9 @@ Tcl_WinTCharToUtf(
* converted string is stored. */
{
Tcl_DStringInit(dsPtr);
- if (!string) {
- return NULL;
- }
- if (len < 0) {
- len = wcslen((WCHAR *)string);
- } else {
- len /= 2;
- }
- return TclWCharToUtfDString((unsigned short *)string, len, dsPtr);
+ return Tcl_WCharToUtfDString(string, len >> 1, dsPtr);
}
+#endif /* !defined(TCL_NO_DEPRECATED) */
/*
*------------------------------------------------------------------------