summaryrefslogtreecommitdiffstats
path: root/generic/tkMain.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 09:30:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 09:30:22 (GMT)
commit0ad4cbd7bd60324dc875c7d8f472096589c2b024 (patch)
tree3ab0f8a9d922f9c36c5579ff2ee94478091498c8 /generic/tkMain.c
parenta2b7afd83359a8b5149462e93b174ca5784d1e1a (diff)
downloadtk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.zip
tk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.tar.gz
tk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.tar.bz2
Implement XFlush and various others for win32 as stubs, so win32 extensions using those can run under CYGWIN as well.
Allow tk86.dll to cooperate with the cygwin console.
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r--generic/tkMain.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 4932d36..03e74b0 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -53,6 +53,7 @@
* to strcmp here.
*/
#ifdef __WIN32__
+# include "tclInt.h"
# include "tkWinInt.h"
#else
# define TCHAR char
@@ -92,10 +93,11 @@
* it will conflict with a declaration elsewhere on some systems.
*/
-#if defined(_WIN32)
+#if defined(__WIN32__) || defined(_WIN32)
#define isatty WinIsTty
static int WinIsTty(int fd) {
HANDLE handle;
+
/*
* For now, under Windows, we assume we are not running as a console mode
* app, so we need to use the GUI console. In order to enable this, we
@@ -103,6 +105,12 @@ static int WinIsTty(int fd) {
* to do it.
*/
+#if !defined(STATIC_BUILD)
+ if (tclStubsPtr->reserved9 && TclpIsAtty) {
+ /* We are running on Cygwin */
+ return TclpIsAtty(fd);
+ }
+#endif
handle = GetStdHandle(STD_INPUT_HANDLE + fd);
/*
* If it's a bad or closed handle, then it's been connected to a wish