Subject: revert [8abba84224], and make sure that every source file that uses Tcl_StatBuf has an "#include <sys/stat.h>" before including tcl.h

From: "jan.nijtmans" <[email-masked]>
Date: Thu, 17 Jan 2013 08:28:41 +0000

---
 ChangeLog              | 5 -----
 generic/tclCmdAH.c     | 1 +
 generic/tclEncoding.c  | 1 +
 generic/tclFCmd.c      | 1 +
 generic/tclFileName.c  | 1 +
 generic/tclIOUtil.c    | 4 +---
 generic/tclPort.h      | 5 +++--
 generic/tclTest.c      | 1 +
 macosx/tclMacOSXFCmd.c | 1 +
 unix/tclUnixFCmd.c     | 1 +
 unix/tclUnixFile.c     | 1 +
 unix/tclUnixInit.c     | 1 +
 unix/tclUnixPort.h     | 4 +---
 win/tclWinFile.c       | 2 +-
 14 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09c88db..3cbdd1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,11 +6,6 @@
 	* generic/tclBasic.c: TCL_NO_DEPRECATED is defined, so Tk
 	can benefit from it too.
 
-2013-01-15  Jan Nijtmans  <[email-masked]>
-
-	* generic/tclPort.h: [Bug 3598300]: unix: tcl.h does not include
-	* unix/tclUnixPort.h: sys/stat.h
-
 2013-01-14  Jan Nijtmans  <[email-masked]>
 
 	* win/tcl.m4: More flexible search for win32 tclConfig.sh,
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 44f08a3..9b03eab 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -11,6 +11,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 #include <locale.h>
 
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index fb2f134..eb4950a 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -9,6 +9,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 
 typedef size_t (LengthProc)(const char *src);
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index c57a4ff..2a579c6 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -15,6 +15,7 @@
 #   define _USE_32BIT_TIME_T
 #endif
 
+#include <sys/stat.h>
 #include "tclInt.h"
 
 /*
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 07757d9..0f32d2b 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -11,6 +11,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 #include "tclRegexp.h"
 #include "tclFileSystem.h" /* For TclGetPathType() */
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index f90bf0d..488cbb8 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -18,9 +18,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
-#if defined(HAVE_SYS_STAT_H) && !defined _WIN32
-#   include <sys/stat.h>
-#endif
+#include <sys/stat.h>
 #include "tclInt.h"
 #ifdef __WIN32__
 #   include "tclWinInt.h"
diff --git a/generic/tclPort.h b/generic/tclPort.h
index 12a60db..7021b8d 100644
--- a/generic/tclPort.h
+++ b/generic/tclPort.h
@@ -19,10 +19,11 @@
 #endif
 #if defined(_WIN32)
 #   include "tclWinPort.h"
-#else
-#   include "tclUnixPort.h"
 #endif
 #include "tcl.h"
+#if !defined(_WIN32)
+#   include "tclUnixPort.h"
+#endif
 
 #if !defined(LLONG_MIN)
 #   ifdef TCL_WIDE_INT_IS_LONG
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 3c39a40..a96785a 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -21,6 +21,7 @@
 #endif
 
 #define TCL_TEST
+#include <sys/stat.h>
 #include "tclInt.h"
 
 #include <math.h>
diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c
index 09ee96d..d034886 100644
--- a/macosx/tclMacOSXFCmd.c
+++ b/macosx/tclMacOSXFCmd.c
@@ -10,6 +10,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 
 #ifdef HAVE_GETATTRLIST
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index a96a81a..79f115e 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -40,6 +40,7 @@
  * DAMAGE.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 #include <utime.h>
 #include <grp.h>
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 4a34b0b..40434a0 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -10,6 +10,7 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 #include "tclFileSystem.h"
 
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index f9015b7..8ebd069 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -8,6 +8,7 @@
  * All rights reserved.
  */
 
+#include <sys/stat.h>
 #include "tclInt.h"
 #include <stddef.h>
 #include <locale.h>
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 32d14e1..4668707 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -116,9 +116,7 @@ typedef off_t		Tcl_SeekOffset;
 #ifdef HAVE_SYS_SELECT_H
 #   include <sys/select.h>
 #endif
-#ifdef HAVE_SYS_STAT_H
-#   include <sys/stat.h>
-#endif
+#include <sys/stat.h>
 #if TIME_WITH_SYS_TIME
 #   include <sys/time.h>
 #   include <time.h>
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 7da19ce..7224345 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -12,10 +12,10 @@
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  */
 
+#include <sys/stat.h>
 #include "tclWinInt.h"
 #include "tclFileSystem.h"
 #include <winioctl.h>
-#include <sys/stat.h>
 #include <shlobj.h>
 #include <lmaccess.h>		/* For TclpGetUserHome(). */
 
-- 
cgit v0.12