diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-01 12:03:54 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-01 12:03:54 (GMT) |
commit | 3311ca7d306a1bf7de8e03bac9eac81d63677899 (patch) | |
tree | 3bd406bb8a0ba1d2386c4385bf56a61991823dfb /unix/tclAppInit.c | |
parent | 5d9db7d9acbe609d68bb6f81daeaa5abeea212aa (diff) | |
download | tcl-3311ca7d306a1bf7de8e03bac9eac81d63677899.zip tcl-3311ca7d306a1bf7de8e03bac9eac81d63677899.tar.gz tcl-3311ca7d306a1bf7de8e03bac9eac81d63677899.tar.bz2 |
Code cleanup in tclMain.c and tclAppInit.c: Make them Tcl-8.7-aware, usable as more generic examples for extensions.
Diffstat (limited to 'unix/tclAppInit.c')
-rw-r--r-- | unix/tclAppInit.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 9bbc88b..552f9e4 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -15,15 +15,19 @@ #undef BUILD_tcl #undef STATIC_BUILD #include "tcl.h" +#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 +# define Tcl_LibraryInitProc Tcl_PackageInitProc +# define Tcl_StaticLibrary Tcl_StaticPackage +#endif #ifdef TCL_TEST -extern Tcl_PackageInitProc Tcltest_Init; -extern Tcl_PackageInitProc Tcltest_SafeInit; +extern Tcl_LibraryInitProc Tcltest_Init; +extern Tcl_LibraryInitProc Tcltest_SafeInit; #endif /* TCL_TEST */ #ifdef TCL_XT_TEST extern void XtToolkitInitialize(void); -extern Tcl_PackageInitProc Tclxttest_Init; +extern Tcl_LibraryInitProc Tclxttest_Init; #endif /* TCL_XT_TEST */ /* @@ -79,6 +83,9 @@ main( #ifdef TCL_LOCAL_MAIN_HOOK TCL_LOCAL_MAIN_HOOK(&argc, &argv); +#elif (TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6) && (!defined(_WIN32) || defined(UNICODE)) + /* New in Tcl 8.7. This doesn't work on Windows without UNICODE */ + TclZipfs_AppHook(&argc, &argv); #endif Tcl_Main(argc, argv, TCL_LOCAL_APPINIT); @@ -122,7 +129,7 @@ Tcl_AppInit( if (Tcltest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init, Tcltest_SafeInit); + Tcl_StaticLibrary(interp, "Tcltest", Tcltest_Init, Tcltest_SafeInit); #endif /* TCL_TEST */ /* |