diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-11 07:58:01 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-11 07:58:01 (GMT) |
| commit | 52ce2fdeb0ea955e444a4c428450876e131d29c8 (patch) | |
| tree | 8c818c6541faf545fff407bc6b6633c6f8329bf9 | |
| parent | 7b43d03c2b4014c1c86d42f2e9a05eaf1dd1750c (diff) | |
| download | tcl-52ce2fdeb0ea955e444a4c428450876e131d29c8.zip tcl-52ce2fdeb0ea955e444a4c428450876e131d29c8.tar.gz tcl-52ce2fdeb0ea955e444a4c428450876e131d29c8.tar.bz2 | |
Improve compatibility detection for <time.h> and <sys/stat.h>:
- Move <time.h> before other includes on Windows, so we are sure the time_t definition being checked doesn't come from <sys/types.h>.
- Padding at the end of Tcl_StatBuf doesn't influcence binary compatibility, so relax panic check accordingly.
| -rw-r--r-- | generic/tclBasic.c | 7 | ||||
| -rw-r--r-- | win/tclWinPort.h | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5e6b500..4f24515 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -413,11 +413,12 @@ Tcl_CreateInterp(void) #if defined(_WIN32) && !defined(_WIN64) if (sizeof(time_t) != 4) { /*NOTREACHED*/ - Tcl_Panic("sys/time.h is not compatible with MSVC"); + Tcl_Panic("<time.h> is not compatible with MSVC"); } - if (sizeof(Tcl_StatBuf) != 48) { + if ((TclOffset(Tcl_StatBuf,st_atime) != 32) + || (TclOffset(Tcl_StatBuf,st_ctime) != 40)) { /*NOTREACHED*/ - Tcl_Panic("sys/stat.h is not compatible with MSVC"); + Tcl_Panic("<sys/stat.h> is not compatible with MSVC"); } #endif diff --git a/win/tclWinPort.h b/win/tclWinPort.h index f58014c..987d45b 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -51,6 +51,7 @@ typedef DWORD_PTR * PDWORD_PTR; *--------------------------------------------------------------------------- */ +#include <time.h> #include <io.h> #include <stdio.h> #include <stdlib.h> @@ -85,8 +86,6 @@ typedef DWORD_PTR * PDWORD_PTR; # endif /* __BORLANDC__ */ #endif /* __MWERKS__ */ -#include <time.h> - /* * Define EINPROGRESS in terms of WSAEINPROGRESS. */ |
