AC_CHECK_HEADER(alloca.h, glib_have_alloca_h=yes, glib_have_alloca_h=no)
# Check for some functions
-AC_CHECK_FUNCS(localtime_r lstat strerror strsignal memmove vsnprintf vasprintf strcasecmp strncasecmp poll)
+AC_CHECK_FUNCS(localtime_r rand_r lstat strerror strsignal memmove vsnprintf vasprintf strcasecmp strncasecmp poll)
# Check for sys_errlist
AC_MSG_CHECKING(for sys_errlist)
AC_CHECK_LIB(pthreads, pthread_attr_init, have_threads=posix)
fi
if test "x$have_threads" = xnone; then
+ AC_CHECK_LIB(c_r, pthread_attr_init, have_threads=posix)
+ fi
+ if test "x$have_threads" = xnone; then
AC_CHECK_FUNC(pthread_attr_init, have_threads=posix)
fi
fi
G_THREAD_LIBS="-lpthreads")
fi
if test "x$G_THREAD_LIBS" = xerror; then
+ AC_CHECK_LIB(c_r, pthread_attr_init,
+ G_THREAD_LIBS="-lc_r")
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
AC_CHECK_FUNC(pthread_attr_init, G_THREAD_LIBS="")
fi
mutex_has_default=yes
+#include "config.h"
+
#include <stdlib.h>
#define main testglib_main
wait_thread (1);
while (i < TEST_PRIVATE_ROUNDS)
{
+#ifdef HAVE_RAND_R
guint random_value = rand_r (&seed) % 10000;
+#else
+ guint random_value = rand() % 10000;
+#endif
guint *data = g_static_private_get (&private_key);
if (!data)
{