summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xunix/configure64
-rw-r--r--unix/tcl.m411
-rw-r--r--unix/tclConfig.h.in3
-rw-r--r--unix/tclUnixPort.h13
4 files changed, 85 insertions, 6 deletions
diff --git a/unix/configure b/unix/configure
index cb3116d..2f5f72d 100755
--- a/unix/configure
+++ b/unix/configure
@@ -6868,6 +6868,70 @@ $as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
fi
+ echo "$as_me:$LINENO: checking for DIR64" >&5
+echo $ECHO_N "checking for DIR64... $ECHO_C" >&6
+if test "${tcl_cv_DIR64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+struct dirent64 *p; DIR64 d = opendir64(".");
+ p = readdir64(d); rewinddir64(d); closedir64(d);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_DIR64=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_DIR64=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_DIR64" >&5
+echo "${ECHO_T}$tcl_cv_DIR64" >&6
+ if test "x${tcl_cv_DIR64}" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DIR64 1
+_ACEOF
+
+ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
$as_echo_n "checking for struct stat64... " >&6; }
if ${tcl_cv_struct_stat64+:} false; then :
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index aaf5835..cf6345f 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2412,7 +2412,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
-# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_DIRENT64, HAVE_DIR64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
@@ -2448,6 +2448,15 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
fi
+ AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <dirent.h>],[struct dirent64 *p; DIR64 d = opendir64(".");
+ p = readdir64(d); rewinddir64(d); closedir64(d);],
+ tcl_cv_DIR64=yes,tcl_cv_DIR64=no)])
+ if test "x${tcl_cv_DIR64}" = "xyes" ; then
+ AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
+ fi
+
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
],
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index b9d0059..21c3bef 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -196,6 +196,9 @@
/* Is 'struct dirent64' in <sys/types.h>? */
#undef HAVE_STRUCT_DIRENT64
+/* Is 'DIR64' in <sys/types.h>? */
+#undef HAVE_DIR64
+
/* Define to 1 if the system has the type `struct in6_addr'. */
#undef HAVE_STRUCT_IN6_ADDR
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index e4277a3..a90b471 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -57,16 +57,19 @@
*/
#ifdef HAVE_STRUCT_DIRENT64
-typedef DIR64 TclDIR;
-typedef struct dirent64 Tcl_DirEntry;
+typedef struct dirent64 Tcl_DirEntry;
# define TclOSreaddir readdir64
+#else
+typedef struct dirent Tcl_DirEntry;
+# define TclOSreaddir readdir
+#endif
+#ifdef HAVE_DIR64
+typedef DIR64 TclDIR;
# define TclOSopendir opendir64
# define TclOSrewinddir rewinddir64
# define TclOSclosedir closedir64
#else
-typedef DIR TclDIR;
-typedef struct dirent Tcl_DirEntry;
-# define TclOSreaddir readdir
+typedef DIR TclDIR;
# define TclOSopendir opendir
# define TclOSrewinddir rewinddir
# define TclOSclosedir closedir