From 41b261aae5f9f726006673e5ecd3cf162eb37c27 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 4 Apr 2021 14:53:28 +0000 Subject: Tcl_StaticPackage -> Tcl_StaticLibrary --- unix/tkAppInit.c | 13 ++++++++----- win/winMain.c | 20 ++++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 6cf3d42..1a2421c 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -16,12 +16,16 @@ #undef STATIC_BUILD #include "tk.h" #include "tkPort.h" +#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 +# define Tcl_LibraryInitProc Tcl_PackageInitProc +# define Tcl_StaticLibrary Tcl_StaticPackage +#endif #ifdef TK_TEST #ifdef __cplusplus extern "C" { #endif -extern Tcl_PackageInitProc Tktest_Init; +extern Tcl_LibraryInitProc Tktest_Init; #ifdef __cplusplus } #endif @@ -120,12 +124,11 @@ Tcl_AppInit( if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); + Tcl_StaticLibrary(interp, "Tk", Tk_Init, Tk_SafeInit); #if defined(USE_CUSTOM_EXIT_PROC) if (TkpWantsExitProc()) { - /* The cast below avoids warnings from old gcc compilers. */ - Tcl_SetExitProc((void *)TkpExitProc); + Tcl_SetExitProc(TkpExitProc); } #endif @@ -133,7 +136,7 @@ Tcl_AppInit( if (Tktest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0); + Tcl_StaticLibrary(interp, "Tktest", Tktest_Init, 0); #endif /* TK_TEST */ /* diff --git a/win/winMain.c b/win/winMain.c index f072f78..3920801 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -19,6 +19,10 @@ #include #include #include +#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 +# define Tcl_LibraryInitProc Tcl_PackageInitProc +# define Tcl_StaticLibrary Tcl_StaticPackage +#endif #if defined(__GNUC__) int _CRT_glob = 0; @@ -28,7 +32,7 @@ int _CRT_glob = 0; #ifdef __cplusplus extern "C" { #endif -extern Tcl_PackageInitProc Tktest_Init; +extern Tcl_LibraryInitProc Tktest_Init; #endif /* TK_TEST */ #if !defined(TCL_USE_STATIC_PACKAGES) @@ -40,9 +44,9 @@ extern Tcl_PackageInitProc Tktest_Init; #endif #if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES -extern Tcl_PackageInitProc Registry_Init; -extern Tcl_PackageInitProc Dde_Init; -extern Tcl_PackageInitProc Dde_SafeInit; +extern Tcl_LibraryInitProc Registry_Init; +extern Tcl_LibraryInitProc Dde_Init; +extern Tcl_LibraryInitProc Dde_SafeInit; #endif #ifdef __cplusplus @@ -202,7 +206,7 @@ Tcl_AppInit( if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); + Tcl_StaticLibrary(interp, "Tk", Tk_Init, Tk_SafeInit); /* * Initialize the console only if we are running as an interactive @@ -218,19 +222,19 @@ Tcl_AppInit( if (Registry_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Registry", Registry_Init, 0); + Tcl_StaticLibrary(interp, "Registry", Registry_Init, 0); if (Dde_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Dde", Dde_Init, Dde_SafeInit); + Tcl_StaticLibrary(interp, "Dde", Dde_Init, Dde_SafeInit); #endif #ifdef TK_TEST if (Tktest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0); + Tcl_StaticLibrary(interp, "Tktest", Tktest_Init, 0); #endif /* TK_TEST */ /* -- cgit v0.12