Skip to content

Commit e173bc0

Browse files
author
jan.nijtmans
committed
Fix g++ warnings, when compiling for Tcl 8.6
1 parent 90e5604 commit e173bc0

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

generic/tclDecls.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4133,7 +4133,8 @@ extern const TclStubs *tclStubsPtr;
41334133
# undef Tcl_UtfNcasecmp
41344134
# define Tcl_UtfNcasecmp TclUtfNcasecmp
41354135
#endif
4136-
#if defined(USE_TCL_STUBS)
4136+
#if TCL_MAJOR_VERSION > 8
4137+
# if defined(USE_TCL_STUBS)
41374138
# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \
41384139
? (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))tclStubsPtr->tcl_UniCharToUtfDString \
41394140
: (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_Char16ToUtfDString)
@@ -4146,7 +4147,7 @@ extern const TclStubs *tclStubsPtr;
41464147
# define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \
41474148
? (Tcl_Size (*)(wchar_t *))tclStubsPtr->tcl_UniCharLen \
41484149
: (Tcl_Size (*)(wchar_t *))Tcl_Char16Len)
4149-
#else
4150+
# else
41504151
# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \
41514152
? (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_UniCharToUtfDString \
41524153
: (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_Char16ToUtfDString)
@@ -4159,6 +4160,7 @@ extern const TclStubs *tclStubsPtr;
41594160
# define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \
41604161
? (Tcl_Size (*)(wchar_t *))Tcl_UniCharLen \
41614162
: (Tcl_Size (*)(wchar_t *))Tcl_Char16Len)
4163+
# endif
41624164
#endif
41634165

41644166
/*

win/tclWinDde.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ static int ddeIsServer = 0;
9090

9191
TCL_DECLARE_MUTEX(ddeMutex)
9292

93-
#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
93+
#if TCL_MAJOR_VERSION < 9
9494
# if TCL_UTF_MAX > 3
9595
# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c)
9696
# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c)
9797
# else
98-
# define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString
99-
# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString
98+
# define Tcl_WCharToUtfDString(a,b,c) Tcl_UniCharToUtfDString((Tcl_UniChar *)(a),b,c)
99+
# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_UtfToUniCharDString(a,b,c)
100100
# endif
101101
#ifndef Tcl_Size
102102
# define Tcl_Size int

win/tclWinReg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ static const char *const typeNames[] = {
8787

8888
static DWORD lastType = REG_RESOURCE_LIST;
8989

90-
#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
90+
#if TCL_MAJOR_VERSION < 9
9191
# if TCL_UTF_MAX > 3
9292
# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c)
9393
# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c)
9494
# else
95-
# define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString
96-
# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString
95+
# define Tcl_WCharToUtfDString(a,b,c) Tcl_UniCharToUtfDString((Tcl_UniChar *)(a),b,c)
96+
# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_UtfToUniCharDString(a,b,c)
9797
# endif
9898
#ifndef Tcl_Size
9999
# define Tcl_Size int

0 commit comments

Comments
 (0)