Check-in [4ae3806806]
Overview
Comment:Merged console fixes in
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4ae3806806d16677e1347b9c5e04f99179e09c3b
User & Date: rkeene on 2014-03-03 21:58:29
Other Links: manifest | tags
Context
2014-03-09
04:35
KitCreator 0.8.0 check-in: e57ac649e3 user: rkeene tags: trunk, 0.8.0
2014-03-03
21:58
Merged console fixes in check-in: 4ae3806806 user: rkeene tags: trunk
2014-02-25
02:59
Updated to use single routine for initializing interpreters Closed-Leaf check-in: be67e6913f user: rkeene tags: tk-win32-noconsole-fix
2014-01-22
23:34
Updated to clean up additional projects check-in: d228cbfac5 user: rkeene tags: trunk
Changes

Modified kitsh/buildsrc/kitsh-0.0/kitInit.c from [9995cd87d7] to [8905d676cc].

    99     99   #      else
   100    100   int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow);
   101    101   #      endif /* _WIN32_WCE */
   102    102   #    endif /* KITSH_NEED_WINMAIN */
   103    103   int main(int argc, char **argv);
   104    104   #  endif /* HAVE_ACCEPTABLE_DLADDR */
   105    105   #endif /* !TCLKIT_DLL */
          106  +
          107  +#ifdef TCLKIT_DLL
          108  +void __attribute__((constructor)) _Tclkit_Init(void);
          109  +#else
          110  +static void _Tclkit_Init(void);
          111  +#endif
   106    112   
   107    113   #ifdef TCLKIT_REQUIRE_TCLEXECUTABLENAME
   108    114   char *tclExecutableName;
   109    115   #endif
   110    116   
   111    117   /*
   112    118    *  Attempt to load a "boot.tcl" entry from the embedded MetaKit file.
................................................................................
   139    145   	"catch { load {} vfs }\n"
   140    146   #ifdef KIT_INCLUDES_ZLIB
   141    147   	"catch { load {} zlib }\n"
   142    148   #endif
   143    149   #ifdef KIT_INCLUDES_MK4TCL
   144    150   	"catch { load {} Mk4tcl }\n"
   145    151   #endif
   146         -#ifdef TCLKIT_DLL
   147    152   	"load {} tclkit::init\n"
   148    153   	"::tclkit::init::initInterp\n"
   149    154   	"rename ::tclkit::init::initInterp {}\n"
   150         -#endif /* TCLKIT_DLL */
   151    155   	"set bootfile [file join " TCLKIT_MOUNTPOINT " boot.tcl]\n"
   152    156   	"if {[file exists $bootfile]} {\n"
   153    157   		"catch {\n"
   154    158   			"set f [open $bootfile]\n"
   155    159   			"set s [read $f]\n"
   156    160   			"close $f\n"
   157    161   		"}\n"
................................................................................
   392    396   #endif /* TCLKIT_CAN_SET_ENCODING */
   393    397   
   394    398   	/* Hack to get around Tcl bug 1224888.  This must be run here and
   395    399   	 * in LibraryPathObjCmd because this information is needed both
   396    400   	 * before and after that command is run. */
   397    401   	FindAndSetExecName(interp);
   398    402   
          403  +#if defined(_WIN32) && defined(KIT_INCLUDES_TK)
          404  +	/* Every interpreter needs this done */
          405  +	Tk_InitConsoleChannels(interp);
          406  +#endif /* _WIN32 and KIT_INCLUDES_TK */
          407  +
   399    408   	return;
   400    409   }
   401    410   
   402    411   #ifndef TCLKIT_DLL
   403    412   int TclKit_AppInit(Tcl_Interp *interp) {
   404    413   #ifdef KIT_INCLUDES_TK
   405    414   #  ifdef _WIN32
................................................................................
   406    415   #    ifndef _WIN32_WCE
   407    416   	char msgBuf[2049];
   408    417   #    endif /* !_WIN32_WCE */
   409    418   #  endif /* _WIN32 */
   410    419   #endif /* KIT_INCLUDES_TK */
   411    420   
   412    421   	/* Perform common initialization */
   413         -	_Tclkit_Generic_Init();
   414         -
   415         -	_Tclkit_Interp_Init(interp);
          422  +	_Tclkit_Init();
   416    423   
   417    424   	if (Tcl_Init(interp) == TCL_ERROR) {
   418    425   		goto error;
   419    426   	}
   420    427   
   421    428   #ifdef KIT_INCLUDES_TK
   422    429   #  ifdef _WIN32
................................................................................
   510    517   	if (gmfn_ret != 0) {
   511    518   		return(strdup(modulename));
   512    519   	}
   513    520   #endif /* _WIN32 */
   514    521   
   515    522   	return(NULL);
   516    523   }
          524  +#else
          525  +# define find_tclkit_dll_path() NULL
          526  +#endif
   517    527   
   518    528   /*
   519    529    * This function exists to allow C code to initialize a particular
   520    530    * interpreter.
   521    531    */
   522    532   static int tclkit_init_initinterp(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
   523    533   	char *kitdll_path;
................................................................................
   554    564   	return(tclPkgProv_ret);
   555    565   }
   556    566   
   557    567   /*
   558    568    * Initialize the Tcl system when we are loaded, that way Tcl functions
   559    569    * are ready to be used when invoked.
   560    570    */
          571  +#ifdef TCLKIT_DLL
   561    572   void __attribute__((constructor)) _Tclkit_Init(void) {
          573  +#else
          574  +static void _Tclkit_Init(void) {
          575  +#endif
   562    576   	Tcl_StaticPackage(0, "tclkit::init", Tclkit_init_Init, NULL);
   563    577   
   564    578   	_Tclkit_Generic_Init();
   565    579   
   566    580   	return;
   567    581   }
   568         -#endif