summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-19 18:50:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-19 18:50:56 (GMT)
commit26fbe75faf5700e8814f5fb45e9386f828402a33 (patch)
treee9207cf89660769cf2ca8cc0b0d6aa6ef8646831
parent85545145a0037e04583982f27e58ce2137783f62 (diff)
downloadtcl-26fbe75faf5700e8814f5fb45e9386f828402a33.zip
tcl-26fbe75faf5700e8814f5fb45e9386f828402a33.tar.gz
tcl-26fbe75faf5700e8814f5fb45e9386f828402a33.tar.bz2
Attempt for better approach fixing bug 3598300 on OSX. It is binary incompatible, so it can only be done on novem: it lets OSX use stat64. Is this a good approach?
The correct approach is to get Tcl_StatBuf out of the interface altogether.
-rw-r--r--generic/tcl.h7
-rwxr-xr-xunix/configure4
-rw-r--r--unix/tcl.m46
-rw-r--r--unix/tclConfig.h.in4
-rw-r--r--unix/tclUnixFCmd.c2
-rw-r--r--unix/tclUnixPort.h8
6 files changed, 15 insertions, 16 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 7bab11b..c9a69c0 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -240,7 +240,6 @@ typedef void *ClientData;
# undef TCL_WIDE_INT_IS_LONG
# undef TCL_CFG_DO64BIT
# endif /* __LP64__ */
-# undef HAVE_STRUCT_STAT64
#endif /* __APPLE__ */
/*
@@ -349,10 +348,10 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
struct {long tv_sec;} st_ctim;
/* Here is a 4-byte gap */
} Tcl_StatBuf;
-#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
- typedef struct stat64 Tcl_StatBuf;
-#else
+#elif defined(HAVE_NO_STRUCT_STAT64)
typedef struct stat Tcl_StatBuf;
+#else
+ typedef struct stat64 Tcl_StatBuf;
#endif
/*
diff --git a/unix/configure b/unix/configure
index 82ca9df..f9d9d98 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9974,10 +9974,10 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5
echo "${ECHO_T}$tcl_cv_struct_stat64" >&6
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ if test "x${tcl_cv_struct_stat64}" != "xyes" ; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_STAT64 1
+#define HAVE_NO_STRUCT_STAT64 1
_ACEOF
fi
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index b13fddd..2cd822b 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2776,7 +2776,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
# HAVE_STRUCT_DIRENT64
-# HAVE_STRUCT_STAT64
+# HAVE_NO_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
#--------------------------------------------------------------------
@@ -2815,8 +2815,8 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
],
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
- AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
+ if test "x${tcl_cv_struct_stat64}" != "xyes" ; then
+ AC_DEFINE(HAVE_NO_STRUCT_STAT64, 1, [Is 'struct stat64' missing from <sys/stat.h>?])
fi
AC_CHECK_FUNCS(open64 lseek64)
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index f171cce..a104bae 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -208,8 +208,8 @@
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE
-/* Is 'struct stat64' in <sys/stat.h>? */
-#undef HAVE_STRUCT_STAT64
+/* Is 'struct stat64' missing from <sys/stat.h>? */
+#undef HAVE_NO_STRUCT_STAT64
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index d9952b9..96ce4b8 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -242,7 +242,7 @@ MODULE_SCOPE long tclMacOSXDarwinRelease;
#endif /* NO_REALPATH */
#ifdef HAVE_FTS
-#if defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
+#if !defined(HAVE_NO_STRUCT_STAT64)
/* fts doesn't do stat64 */
# define noFtsStat 1
#elif defined(__APPLE__) && defined(__LP64__) && \
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 59a35ba..44ace74 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -104,12 +104,12 @@ typedef off_t Tcl_SeekOffset;
extern char **__cygwin_environ;
extern int TclOSstat(const char *name, void *statBuf);
extern int TclOSlstat(const char *name, void *statBuf);
-#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
-# define TclOSstat stat64
-# define TclOSlstat lstat64
-#else
+#elif defined(HAVE_NO_STRUCT_STAT64)
# define TclOSstat stat
# define TclOSlstat lstat
+#else
+# define TclOSstat stat64
+# define TclOSlstat lstat64
#endif
/*