Tcl Source Code

Artifact [d64bc43396]
Login

Artifact d64bc433960f4abf9ecebeacf23b77b0f9572a44:

Attachment "1001325.patch" to ticket [1001325fff] added by kennykb 2004-11-25 01:13:50.
Index: unix/tcl.m4
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
retrieving revision 1.128
diff -u -u -r1.128 tcl.m4
--- unix/tcl.m4	22 Nov 2004 22:59:07 -0000	1.128
+++ unix/tcl.m4	24 Nov 2004 18:08:13 -0000
@@ -512,19 +512,24 @@
 	LIBS=$ac_saved_libs
 	AC_CHECK_FUNCS(readdir_r)
 	if test "x$ac_cv_func_readdir_r" = "xyes"; then
+            AC_MSG_CHECKING([how many args readdir_r takes])
 	    # IRIX 5.3 has a 2 arg version of readdir_r
 	    # while other systems have a 3 arg version.
 	    AC_CACHE_VAL(tcl_cv_two_arg_readdir_r,
-	        AC_TRY_COMPILE([#include <sys/types.h>
+	        AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/types.h>
 #include <sys/dir.h>], [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 <sys/types.h>
+	        AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/types.h>
 #include <sys/dir.h>], [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])
 	        AC_DEFINE(HAVE_TWO_ARG_READDIR_R)
 	    elif test "x$tcl_cv_three_arg_readdir_r" = "xyes" ; then
+                AC_MSG_RESULT([3])
 	        AC_DEFINE(HAVE_THREE_ARG_READDIR_R)
 	    else
 	        AC_MSG_ERROR([unknown number of args for readdir_r])