Quick hack to get Cygwin/xfree version of Tcl/Tk 8.3.4. This patch is against the *official* release tree. 2002-06-10 Mumit Khan * generic/tcl.h: Don't define _WIN32 for Cygwin, let -mwin32 do it instead. * generic/tclClock.c (timezone): Cygwin specific hack. * unix/tclUnixChan.c (TclpGetDefaultStdChannel): Work around Cygwin lseek bug. Index: generic/tcl.h =================================================================== RCS file: /home/cvsroot/tcltk8.3/tcl/generic/tcl.h,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 tcl.h --- generic/tcl.h 2002/04/02 03:49:23 1.1.1.1 +++ generic/tcl.h 2002/06/11 03:52:24 @@ -70,7 +70,7 @@ extern "C" { */ #ifndef __WIN32__ -# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) +# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__) # define __WIN32__ # ifndef WIN32 # define WIN32 Index: generic/tclClock.c =================================================================== RCS file: /home/cvsroot/tcltk8.3/tcl/generic/tclClock.c,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 tclClock.c --- generic/tclClock.c 2002/04/02 03:49:23 1.1.1.1 +++ generic/tclClock.c 2002/06/11 03:52:25 @@ -18,6 +18,10 @@ #include "tclInt.h" #include "tclPort.h" +#ifdef __CYGWIN__ +# define timezone _timezone +#endif + /* * The date parsing stuff uses lexx and has tons o statics. */ Index: unix/tclUnixChan.c =================================================================== RCS file: /home/cvsroot/tcltk8.3/tcl/unix/tclUnixChan.c,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 tclUnixChan.c --- unix/tclUnixChan.c 2002/04/02 03:49:22 1.1.1.1 +++ unix/tclUnixChan.c 2002/06/11 03:52:36 @@ -2452,10 +2452,17 @@ TclpGetDefaultStdChannel(type) int fd = 0; /* Initializations needed to prevent */ int mode = 0; /* compiler warning (used before set). */ char *bufMode = NULL; +#ifdef __CYGWIN__ + struct stat statBuf; +#endif switch (type) { case TCL_STDIN: +#ifdef __CYGWIN__ + if ((fstat(0, &statBuf) == -1) && +#else if ((lseek(0, (off_t) 0, SEEK_CUR) == -1) && +#endif (errno == EBADF)) { return (Tcl_Channel) NULL; } @@ -2464,7 +2471,11 @@ TclpGetDefaultStdChannel(type) bufMode = "line"; break; case TCL_STDOUT: +#ifdef __CYGWIN__ + if ((fstat(1, &statBuf) == -1) && +#else if ((lseek(1, (off_t) 0, SEEK_CUR) == -1) && +#endif (errno == EBADF)) { return (Tcl_Channel) NULL; } @@ -2473,7 +2484,11 @@ TclpGetDefaultStdChannel(type) bufMode = "line"; break; case TCL_STDERR: +#ifdef __CYGWIN__ + if ((fstat(2, &statBuf) == -1) && +#else if ((lseek(2, (off_t) 0, SEEK_CUR) == -1) && +#endif (errno == EBADF)) { return (Tcl_Channel) NULL; }