Skip to content

Commit

Permalink
Adapt Tk to TIP #628, so it can be compiled for Tcl 8 in a Tcl 9 buil…
Browse files Browse the repository at this point in the history
…d environment
  • Loading branch information
jan.nijtmans committed Aug 15, 2024
1 parent f632a06 commit 972e0f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generic/tk.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define _TK

#include <tcl.h>
#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7)
#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
# error Tk 9.0 must be compiled with tcl.h from Tcl 8.7 or better
#endif

Expand Down
2 changes: 1 addition & 1 deletion generic/tkInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ MODULE_SCOPE void TkpCopyRegion(TkRegion dst, TkRegion src);
# define c_class class
#endif

#if defined(_WIN32) && !defined(STATIC_BUILD) && TCL_MAJOR_VERSION < 9
#if defined(_WIN32) && !defined(STATIC_BUILD) && (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION)
# define tcl_CreateFileHandler reserved9
#endif

Expand Down
4 changes: 2 additions & 2 deletions unix/tkAppInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#undef STATIC_BUILD
#include "tk.h"
#include "tkPort.h"
#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
#endif
Expand Down Expand Up @@ -107,7 +107,7 @@ main(
{
#ifdef TK_LOCAL_MAIN_HOOK
TK_LOCAL_MAIN_HOOK(&argc, &argv);
#elif (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 6)
#elif TCL_MAJOR_VERSION > 8 || !defined(TCL_MINOR_VERSION) || TCL_MINOR_VERSION > 6
/* This doesn't work with Tcl 8.6 */
TclZipfs_AppHook(&argc, &argv);
#endif
Expand Down
6 changes: 3 additions & 3 deletions win/winMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <locale.h>
#include <stdlib.h>
#include <tchar.h>
#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
#endif
Expand All @@ -56,7 +56,7 @@ extern Tcl_LibraryInitProc Tktest_Init;
#endif /* TK_TEST */

#if !defined(TCL_USE_STATIC_PACKAGES)
# if TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
# if TCL_MAJOR_VERSION > 8 || !defined(TCL_MINOR_VERSION) || TCL_MINOR_VERSION > 6
# define TCL_USE_STATIC_PACKAGES 1
# else
# define TCL_USE_STATIC_PACKAGES 0
Expand Down Expand Up @@ -191,7 +191,7 @@ _tWinMain(

#ifdef TK_LOCAL_MAIN_HOOK
TK_LOCAL_MAIN_HOOK(&argc, &argv);
#elif defined(UNICODE) && ((TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 6))
#elif defined(UNICODE) && ((TCL_MAJOR_VERSION > 8) || !defined(TCL_MINOR_VERSION) || (TCL_MINOR_VERSION > 6))
/* This doesn't work on Windows without UNICODE, neither does it work with Tcl 8.6 */
TclZipfs_AppHook(&argc, &argv);
#endif
Expand Down

0 comments on commit 972e0f0

Please sign in to comment.