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)
commit57fb5ba114ed97565902021bff8a777ca334f0dc (patch)
tree4dde8a27dc8ba84476dbd8eaf698329ee7ba75fe /win/tclWin32Dll.c
parent6a8628c8af8dc575b5564b03945c6a6a470d18aa (diff)
parent7e21e8e6c672bf953b657e9f6d47ce1e2775491a (diff)
downloadtcl-57fb5ba114ed97565902021bff8a777ca334f0dc.zip
tcl-57fb5ba114ed97565902021bff8a777ca334f0dc.tar.gz
tcl-57fb5ba114ed97565902021bff8a777ca334f0dc.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) */
/*
*------------------------------------------------------------------------