Tcl Source Code

Artifact [f38ad7e7dc]
Login

Artifact f38ad7e7dcb42d065e9b6ae1320610f0f17158a4:

Attachment "readdir.patch" to ticket [1071701fff] added by mdejong 2004-11-25 06:04:40.
? cabin.txt
? pass
? p
? pass.zip
? readdir.patch
? irix_build.patch
? tcl_config.patch
? unix/largetest.c
Index: unix/configure
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/configure,v
retrieving revision 1.129
diff -u -r1.129 configure
--- unix/configure	24 Nov 2004 20:12:18 -0000	1.129
+++ unix/configure	24 Nov 2004 23:02:35 -0000
@@ -4982,7 +4982,13 @@
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <sys/types.h>
-#include <sys/dir.h>
+#ifdef NO_DIRENT_H
+# include <sys/dir.h>  /* logic from tcl/compat/dirent.h *
+# define dirent direct  *                                */
+#else
+# include <dirent.h>
+#endif
+
 int
 main ()
 {
@@ -5025,7 +5031,13 @@
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <sys/types.h>
-#include <sys/dir.h>
+#ifdef NO_DIRENT_H
+# include <sys/dir.h>  /* logic from tcl/compat/dirent.h *
+# define dirent direct  *                                */
+#else
+# include <dirent.h>
+#endif
+
 int
 main ()
 {
Index: unix/tcl.m4
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
retrieving revision 1.129
diff -u -r1.129 tcl.m4
--- unix/tcl.m4	24 Nov 2004 20:12:19 -0000	1.129
+++ unix/tcl.m4	24 Nov 2004 23:02:36 -0000
@@ -518,12 +518,24 @@
 	    AC_CACHE_VAL(tcl_cv_two_arg_readdir_r,
 	        AC_TRY_COMPILE([#include <stdlib.h>
 #include <sys/types.h>
-#include <sys/dir.h>], [readdir_r(NULL, NULL);],
+#ifdef NO_DIRENT_H
+# include <sys/dir.h>  /* logic from tcl/compat/dirent.h *
+# define dirent direct  *                                */
+#else
+# include <dirent.h>
+#endif
+], [readdir_r(NULL, NULL);],
 	        tcl_cv_two_arg_readdir_r=yes, tcl_cv_two_arg_readdir_r=no))
 	    AC_CACHE_VAL(tcl_cv_three_arg_readdir_r,
 	        AC_TRY_COMPILE([#include <stdlib.h>
 #include <sys/types.h>
-#include <sys/dir.h>], [readdir_r(NULL, NULL, NULL);],
+#ifdef NO_DIRENT_H
+# include <sys/dir.h>  /* logic from tcl/compat/dirent.h *
+# define dirent direct  *                                */
+#else
+# include <dirent.h>
+#endif
+], [readdir_r(NULL, NULL, NULL);],
 	        tcl_cv_three_arg_readdir_r=yes, tcl_cv_three_arg_readdir_r=no))
 	    if test "x$tcl_cv_two_arg_readdir_r" = "xyes" ; then
                 AC_MSG_RESULT([2])