1 # stdlib_h.m4 serial 52
2 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_STDLIB_H],
9 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
10 gl_NEXT_HEADERS([stdlib.h])
12 dnl Check for declarations of anything we want to poison if the
13 dnl corresponding gnulib module is not in use, and which is not
14 dnl guaranteed by C89.
15 gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
16 #if HAVE_SYS_LOADAVG_H
17 /* OpenIndiana has a bug: <sys/time.h> must be included before
19 # include <sys/time.h>
20 # include <sys/loadavg.h>
25 ]], [_Exit aligned_alloc atoll canonicalize_file_name
26 getloadavg getsubopt grantpt
27 initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
28 posix_memalign posix_openpt ptsname ptsname_r qsort_r
29 random random_r reallocarray realpath rpmatch secure_getenv setenv
30 setstate setstate_r srandom srandom_r
31 strtod strtold strtoll strtoull unlockpt unsetenv])
33 AC_REQUIRE([AC_C_RESTRICT])
35 AC_CHECK_DECLS_ONCE([ecvt])
36 if test $ac_cv_have_decl_ecvt = no; then
39 AC_CHECK_DECLS_ONCE([fcvt])
40 if test $ac_cv_have_decl_fcvt = no; then
43 AC_CHECK_DECLS_ONCE([gcvt])
44 if test $ac_cv_have_decl_gcvt = no; then
49 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
51 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
52 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
53 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
54 dnl Define it also as a C macro, for the benefit of the unit tests.
55 gl_MODULE_INDICATOR_FOR_TESTS([$1])
58 AC_DEFUN([gl_STDLIB_H_DEFAULTS],
60 GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT])
61 GNULIB_ALIGNED_ALLOC=0; AC_SUBST([GNULIB_ALIGNED_ALLOC])
62 GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
63 GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
64 GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
65 GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG])
66 GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
67 GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT])
68 GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
69 GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC])
70 GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
71 GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP])
72 GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS])
73 GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
74 GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS])
75 GNULIB_POSIX_MEMALIGN=0;AC_SUBST([GNULIB_POSIX_MEMALIGN])
76 GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT])
77 GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME])
78 GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R])
79 GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
80 GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R])
81 GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM])
82 GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
83 GNULIB_REALLOCARRAY=0; AC_SUBST([GNULIB_REALLOCARRAY])
84 GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
85 GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
86 GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
87 GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
88 GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
89 GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
90 GNULIB_STRTOLD=0; AC_SUBST([GNULIB_STRTOLD])
91 GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
92 GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
93 GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX])
94 GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT])
95 GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
96 GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB])
97 dnl Assume proper GNU behavior unless another module says otherwise.
98 HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
99 HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC])
100 HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
101 HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
102 HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT])
103 HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
104 HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
105 HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
106 HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
107 HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
108 HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
109 HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
110 HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC])
111 HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
112 HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
113 HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
114 HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
115 HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
116 HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN])
117 HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
118 HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
119 HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
120 HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R])
121 HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
122 HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
123 HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
124 HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY])
125 HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
126 HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
127 HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
128 HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
129 HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
130 HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
131 HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
132 HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
133 HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
134 HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
135 HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
136 HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
137 HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
138 HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
139 HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
140 REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
141 REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
142 REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
143 REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
144 REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
145 REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
146 REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
147 REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
148 REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
149 REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
150 REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
151 REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
152 REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
153 REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
154 REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
155 REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
156 REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
157 REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
158 REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
159 REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
160 REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
161 REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])