diff options
-rw-r--r-- | unix/tkUnixFont.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index e30c07a..ccb9b30 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -238,6 +238,7 @@ static unsigned RankAttributes(FontAttributes *wantPtr, static void ReleaseFont(UnixFont *fontPtr); static void ReleaseSubFont(Display *display, SubFont *subFontPtr); static int SeenName(const char *name, Tcl_DString *dsPtr); +#if TCL_MAJOR_VERSION < 9 static int Ucs2beToUtfProc(void *clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, @@ -246,6 +247,7 @@ static int UtfToUcs2beProc(void *clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); +#endif /* *------------------------------------------------------------------------- @@ -312,7 +314,9 @@ TkpFontPkgInit( Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; +#if TCL_MAJOR_VERSION < 9 Tcl_Encoding ucs2; +#endif if (tsdPtr->controlFamily.encoding == NULL) { @@ -333,6 +337,7 @@ TkpFontPkgInit( * if it doesn't exist yet. It is used in iso10646 fonts. */ +#if TCL_MAJOR_VERSION < 9 ucs2 = Tcl_GetEncoding(NULL, "ucs-2be"); if (ucs2 == NULL) { Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2}; @@ -340,6 +345,7 @@ TkpFontPkgInit( } else { Tcl_FreeEncoding(ucs2); } +#endif Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL); } } @@ -458,6 +464,7 @@ ControlUtfProc( *------------------------------------------------------------------------- */ +#if TCL_MAJOR_VERSION < 9 static int Ucs2beToUtfProc( TCL_UNUSED(void *), /* Not used. */ @@ -554,6 +561,14 @@ Ucs2beToUtfProc( *------------------------------------------------------------------------- */ +#if defined(USE_TCL_STUBS) +/* Since the UCS-2BE encoding is only used when Tk 8.7 is dynamically loaded in Tcl 8.6, + * make sure that Tcl_UtfCharComplete is ALWAYS the pre-TIP #575 version, + * even though Tk 8.7 is being compiled with -DTCL_NO_DEPRECATED! */ +# undef Tcl_UtfCharComplete +# define Tcl_UtfCharComplete ((int (*)(const char *, int))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[326])) +#endif + static int UtfToUcs2beProc( TCL_UNUSED(void *), /* TableEncodingData that specifies @@ -627,6 +642,7 @@ UtfToUcs2beProc( *dstCharsPtr = numChars; return result; } +#endif /* *--------------------------------------------------------------------------- |