vasnwprintf tests: Add test of huge %ls arguments.
[gnulib.git] / m4 / random_r.m4
blobb2464fdab94c9649d19b4311e6d02e442330d137
1 # random_r.m4
2 # serial 5
3 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_RANDOM_R],
10   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
11   AC_REQUIRE([AC_CANONICAL_HOST])
13   AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
14   if test $ac_cv_header_random_h = no; then
15     HAVE_RANDOM_H=0
16   fi
18   AC_CHECK_TYPES([struct random_data],
19     [], [HAVE_STRUCT_RANDOM_DATA=0],
20     [[#include <stdlib.h>
21       #if HAVE_RANDOM_H
22       # include <random.h>
23       #endif
24     ]])
26   dnl On AIX and OSF/1, these functions exist, but with different declarations.
27   dnl Override them all.
28   case "$host_os" in
29     aix* | osf*)
30       REPLACE_RANDOM_R=1
31       ;;
32     *)
33       AC_CHECK_FUNCS([random_r])
34       if test $ac_cv_func_random_r = no; then
35         HAVE_RANDOM_R=0
36       fi
37       ;;
38   esac
41 # Prerequisites of lib/random_r.c.
42 AC_DEFUN([gl_PREREQ_RANDOM_R], [
43   :