Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Simplify TkCygwinMainEx (int -> void return). Fix --disable-shared build on Windows (broken by previous commit) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-6-branch |
Files: | files | file ages | folders |
SHA3-256: |
86e1195eb70113370d7fee45282345ff |
User & Date: | jan.nijtmans 2024-04-30 09:52:44 |
Context
2024-04-30
| ||
19:36 | Backport argx_rejig branch from Tk 8.7 check-in: 48bd62cb user: jan.nijtmans tags: core-8-6-branch | |
09:57 | Fix --disable-shared build on Windows. Eliminate warning in tkWinTest.c check-in: 87938e1f user: jan.nijtmans tags: core-8-branch | |
09:52 | Simplify TkCygwinMainEx (int -> void return). Fix --disable-shared build on Windows (broken by previous commit) check-in: 86e1195e user: jan.nijtmans tags: core-8-6-branch | |
2024-04-29
| ||
21:51 | Make tkWinTest.c warning-free, when compiled with Tcl 8.7 headers check-in: 3d793297 user: jan.nijtmans tags: core-8-6-branch | |
Changes
Changes to generic/tkMain.c.
︙ | ︙ | |||
13 14 15 16 17 18 19 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" #if defined(_WIN32) && !defined(UNICODE) && !defined(STATIC_BUILD) | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" #if defined(_WIN32) && !defined(UNICODE) && !defined(STATIC_BUILD) MODULE_SCOPE void TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); #endif /* * The default prompt used when the user has not overridden it. */ static const char DEFAULT_PRIMARY_PROMPT[] = "% "; |
︙ | ︙ | |||
193 194 195 196 197 198 199 | if (tclStubsPtr->reserved9) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the * Tk_MainEx function of libtk8.?.dll, not this one. */ if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: | | < < < | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | if (tclStubsPtr->reserved9) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the * Tk_MainEx function of libtk8.?.dll, not this one. */ if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: TkCygwinMainEx(argc, argv, appInitProc, interp); } else { int i; for (i = 1; i < argc; ++i) { if (!_tcscmp(argv[i], TEXT("-display"))) { goto loadCygwinTk; } |
︙ | ︙ |
Changes to generic/tkWindow.c.
︙ | ︙ | |||
2936 2937 2938 2939 2940 2941 2942 | * Run Tk_MainEx from libtk8.?.dll * * This function is only ever called from wish8.?.exe, the cygwin port of Tcl. * This means that the system encoding is utf-8, so we don't have to do any * encoding conversions. */ | | | 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 | * Run Tk_MainEx from libtk8.?.dll * * This function is only ever called from wish8.?.exe, the cygwin port of Tcl. * This means that the system encoding is utf-8, so we don't have to do any * encoding conversions. */ MODULE_SCOPE void TkCygwinMainEx( int argc, /* Number of arguments. */ char **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization * procedure to call after most initialization * but before starting to execute commands. */ |
︙ | ︙ | |||
2958 2959 2960 2961 2962 2963 2964 | len = GetModuleFileNameW((HINSTANCE)Tk_GetHINSTANCE(), name, MAX_PATH); name[len-2] = '.'; name[len-1] = name[len-5]; wcscpy(name+len, L".dll"); memcpy(name+len-8, L"libtk8", 6 * sizeof(WCHAR)); tkcygwindll = LoadLibraryW(name); | | < < < | | | < < | < > > | 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 | len = GetModuleFileNameW((HINSTANCE)Tk_GetHINSTANCE(), name, MAX_PATH); name[len-2] = '.'; name[len-1] = name[len-5]; wcscpy(name+len, L".dll"); memcpy(name+len-8, L"libtk8", 6 * sizeof(WCHAR)); tkcygwindll = LoadLibraryW(name); if (tkcygwindll) { tkmainex = (void (*)(int, char **, Tcl_AppInitProc *, Tcl_Interp *)) (void *)GetProcAddress(tkcygwindll, "Tk_MainEx"); if (tkmainex) { tkmainex(argc, argv, appInitProc, interp); } } } #endif /* _WIN32 */ /* *---------------------------------------------------------------------- * * Tk_Init -- |
︙ | ︙ | |||
2999 3000 3001 3002 3003 3004 3005 | *---------------------------------------------------------------------- */ int Tk_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { | | | 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 | *---------------------------------------------------------------------- */ int Tk_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { #if defined(_WIN32) && !defined(STATIC_BUILD) if (tkcygwindll) { int (*tkinit)(Tcl_Interp *); tkinit = (int(*)(Tcl_Interp *))(void *)GetProcAddress(tkcygwindll,"Tk_Init"); if (tkinit) { return tkinit(interp); } |
︙ | ︙ | |||
3072 3073 3074 3075 3076 3077 3078 | * - No CPU time limit, no memory allocation limits, no color limits. * CPU time limits can be imposed by an unsafe parent interpreter. * * The actual code called is the same as Tk_Init but Tcl_IsSafe() is * checked at several places to differentiate the two initialisations. */ | | | 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 | * - No CPU time limit, no memory allocation limits, no color limits. * CPU time limits can be imposed by an unsafe parent interpreter. * * The actual code called is the same as Tk_Init but Tcl_IsSafe() is * checked at several places to differentiate the two initialisations. */ #if defined(_WIN32) && !defined(STATIC_BUILD) if (tkcygwindll) { int (*tksafeinit)(Tcl_Interp *); tksafeinit = (int (*)(Tcl_Interp *)) (void *)GetProcAddress(tkcygwindll, "Tk_SafeInit"); if (tksafeinit) { return tksafeinit(interp); |
︙ | ︙ |