diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-06 11:46:46 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-06 11:46:46 (GMT) |
commit | 47a8d3de4e7b782b904446dcfe4897a631764254 (patch) | |
tree | c1541ee97ac9c28d4827cea430ca39735ffde4b9 /generic/tkMain.c | |
parent | 4f8905d6ca19cb6b104135bd1870de307a294aff (diff) | |
download | tk-47a8d3de4e7b782b904446dcfe4897a631764254.zip tk-47a8d3de4e7b782b904446dcfe4897a631764254.tar.gz tk-47a8d3de4e7b782b904446dcfe4897a631764254.tar.bz2 |
Fix [600b72bfbc789]: Unnecessary inclusion of tclInt.h in tkMain.c in Windows build
The only thing needed from tclInt.h is the definition of TclIntPlatStubs. Including just a tiny part of this struct is enough to make it compile, without the need for tclInt.h
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r-- | generic/tkMain.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c index f6f4013..1b21223 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -55,7 +55,16 @@ extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); * to strcmp here. */ #ifdef _WIN32 -# include "tclInt.h" +/* Little hack to eliminate the need for "tclInt.h" here: + Just copy a small portion of TclIntPlatStubs, just + enough to make it work. See [600b72bfbc] */ +typedef struct { + int magic; + void *hooks; + void (*dummy[16]) (void); /* dummy entries 0-15, not used */ + int (*tclpIsAtty) (int fd); /* 16 */ +} TclIntPlatStubs; +extern const TclIntPlatStubs *tclIntPlatStubsPtr; # include "tkWinInt.h" #else # define TCHAR char @@ -108,9 +117,9 @@ static int WinIsTty(int fd) { */ #if !defined(STATIC_BUILD) - if (tclStubsPtr->reserved9 && TclpIsAtty) { + if (tclStubsPtr->reserved9 && tclIntPlatStubsPtr->tclpIsAtty) { /* We are running on Cygwin */ - return TclpIsAtty(fd); + return tclIntPlatStubsPtr->tclpIsAtty(fd); } #endif handle = GetStdHandle(STD_INPUT_HANDLE + fd); |