diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-11 08:12:09 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-11 08:12:09 (GMT) |
commit | 70891d45411fa4695f4620b26dda06e94143967e (patch) | |
tree | 465341a4d90ea79b98a48ffbfbb87cf40715659b | |
parent | 94412474c1700b886d93941b7a424c8e2de9e893 (diff) | |
parent | a9614d87b805cb106c4876c73858300e3c4359a3 (diff) | |
download | tcl-70891d45411fa4695f4620b26dda06e94143967e.zip tcl-70891d45411fa4695f4620b26dda06e94143967e.tar.gz tcl-70891d45411fa4695f4620b26dda06e94143967e.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 aafbe71..b2a505a 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -489,11 +489,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 48f7894..457c838 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -82,6 +82,7 @@ typedef DWORD_PTR * PDWORD_PTR; *--------------------------------------------------------------------------- */ +#include <time.h> #include <wchar.h> #include <io.h> #include <errno.h> @@ -114,8 +115,6 @@ typedef DWORD_PTR * PDWORD_PTR; # endif /* __BORLANDC__ */ #endif /* __MWERKS__ */ -#include <time.h> - /* * The following defines redefine the Windows Socket errors as * BSD errors so Tcl_PosixError can do the right thing. |