diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-31 04:53:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-31 04:53:04 (GMT) |
commit | a2b7afd83359a8b5149462e93b174ca5784d1e1a (patch) | |
tree | 0d86ddd173e57154f68d6c3505b9ceaa39a54676 /generic/tkMain.c | |
parent | da68cb938e2bec4280883c4052906b9811aadf7c (diff) | |
parent | 91ae12c773a03fe4533d19a6d115deb6a4c95351 (diff) | |
download | tk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.zip tk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.tar.gz tk-a2b7afd83359a8b5149462e93b174ca5784d1e1a.tar.bz2 |
Simpify determination whether we are running on cygwin.
Export Tk_GetHINSTANCE, TkSetPixmapColormap and TkpPrintWindowId on the Cygwin dll
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r-- | generic/tkMain.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c index a48ddd4..4932d36 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -102,6 +102,7 @@ static int WinIsTty(int fd) { * always claim to be running on a tty. This probably isn't the right way * to do it. */ + handle = GetStdHandle(STD_INPUT_HANDLE + fd); /* * If it's a bad or closed handle, then it's been connected to a wish @@ -181,6 +182,27 @@ Tk_MainEx( abort(); } +#if defined(__WIN32__) && !defined(STATIC_BUILD) + 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 libtk.dll, not this one. */ + if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { + loadCygwinTk: + Tcl_Panic("Should load libtk.dll now, not yet implemented"); + } else { + int i; + + for (i = 1; i < argc; ++i) { + if (!_tcscmp(argv[i], TEXT("-display"))) { + goto loadCygwinTk; + } + } + } + } +#endif + Tcl_InitMemory(interp); is.interp = interp; |