2 dnl Copyright (C) 2007-2022 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_ONCE([gl_MATH_H],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 gl_CHECK_NEXT_HEADERS([math.h])
12 AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
13 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
14 [[/* Solaris 10 has a broken definition of NAN. Other platforms
15 fail to provide NAN, or provide it only in C99 mode; this
16 test only needs to fail when NAN is provided but wrong. */
22 [gl_cv_header_math_nan_works=yes],
23 [gl_cv_header_math_nan_works=no])])
24 if test $gl_cv_header_math_nan_works = no; then
27 AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
28 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
29 [[/* Solaris 10 has a broken definition of HUGE_VAL. */
32 [gl_cv_header_math_huge_val_works=yes],
33 [gl_cv_header_math_huge_val_works=no])])
34 if test $gl_cv_header_math_huge_val_works = no; then
38 dnl Check for declarations of anything we want to poison if the
39 dnl corresponding gnulib module is not in use.
40 gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
41 [acosf acosl asinf asinl atanf atanl
42 cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
43 expf expl exp2 exp2f exp2l expm1 expm1f expm1l
44 fabsf fabsl floorf floorl fma fmaf fmal
45 fmod fmodf fmodl frexpf frexpl hypotf hypotl
48 log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
51 remainder remainderf remainderl
52 rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
53 tanf tanl tanhf trunc truncf truncl])
56 # gl_MATH_MODULE_INDICATOR([modulename])
57 # sets the shell variable that indicates the presence of the given module
58 # to a C preprocessor expression that will evaluate to 1.
59 # This macro invocation must not occur in macros that are AC_REQUIREd.
60 AC_DEFUN([gl_MATH_MODULE_INDICATOR],
62 dnl Ensure to expand the default settings once only.
63 gl_MATH_H_REQUIRE_DEFAULTS
64 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
65 dnl Define it also as a C macro, for the benefit of the unit tests.
66 gl_MODULE_INDICATOR_FOR_TESTS([$1])
69 # Initializes the default values for AC_SUBSTed shell variables.
70 # This macro must not be AC_REQUIREd. It must only be invoked, and only
71 # outside of macros or in macros that are not AC_REQUIREd.
72 AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
74 m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
75 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
76 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
77 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
78 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
79 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
80 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
81 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
82 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
83 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
84 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
85 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
86 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
87 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
88 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
89 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
90 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
91 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
92 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
93 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
94 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
95 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
96 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
97 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
98 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
99 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
100 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
101 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
102 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
103 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
104 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
105 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
106 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
107 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
108 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
109 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
110 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
111 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
112 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
113 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
114 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
115 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
116 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
117 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
118 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
119 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
120 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
121 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
122 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
123 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
124 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
125 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
126 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
127 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
128 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
129 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
130 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
131 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
132 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
133 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
134 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
135 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
136 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
142 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
143 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
144 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
145 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
146 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
147 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
148 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
149 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
150 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
151 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
152 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
153 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
154 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
159 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
160 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
161 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
162 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
163 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
164 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
165 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
166 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
167 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
168 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
169 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
170 dnl Support Microsoft deprecated alias function names by default.
171 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
172 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
173 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
174 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
175 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
176 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
178 m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
179 AC_REQUIRE([gl_MATH_H_DEFAULTS])
182 AC_DEFUN([gl_MATH_H_DEFAULTS],
184 dnl Assume proper GNU behavior unless another module says otherwise.
185 HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
186 HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
187 HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
188 HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
189 HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
190 HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
191 HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
192 HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
193 HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
194 HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
195 HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
196 HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
197 HAVE_COSF=1; AC_SUBST([HAVE_COSF])
198 HAVE_COSL=1; AC_SUBST([HAVE_COSL])
199 HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
200 HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
201 HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
202 HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
203 HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
204 HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
205 HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
206 HAVE_FMA=1; AC_SUBST([HAVE_FMA])
207 HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
208 HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
209 HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
210 HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
211 HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
212 HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
213 HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
214 HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
215 HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
216 HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
217 HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
218 HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
219 HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
220 HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
221 HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
222 HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
223 HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
224 HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
225 HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
226 HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
227 HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
228 HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
229 HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
230 HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
231 HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
232 HAVE_POWF=1; AC_SUBST([HAVE_POWF])
233 HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
234 HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
235 HAVE_RINT=1; AC_SUBST([HAVE_RINT])
236 HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
237 HAVE_SINF=1; AC_SUBST([HAVE_SINF])
238 HAVE_SINL=1; AC_SUBST([HAVE_SINL])
239 HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
240 HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
241 HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
242 HAVE_TANF=1; AC_SUBST([HAVE_TANF])
243 HAVE_TANL=1; AC_SUBST([HAVE_TANL])
244 HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
245 HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
246 HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
247 HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
248 HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
249 HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
250 HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
251 HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
252 HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
253 HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
254 HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
255 HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
256 HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
257 HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
258 HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
259 HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
260 HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
261 HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
262 HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
263 HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
264 HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
265 HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
266 HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
267 HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
268 HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
269 HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
270 HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
271 HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
272 HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
273 HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
274 HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
275 HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
276 HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
277 HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
278 HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
279 HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
280 HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
281 REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
282 REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
283 REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
284 REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
285 REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
286 REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
287 REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
288 REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
289 REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
290 REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
291 REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
292 REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
293 REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
294 REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
295 REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
296 REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
297 REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
298 REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
299 REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
300 REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
301 REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
302 REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
303 REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
304 REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
305 REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
306 REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
307 REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
308 REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
309 REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
310 REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
311 REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
312 REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
313 REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
314 REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
315 REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
316 REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
317 REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
318 REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
319 REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
320 REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
321 REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
322 REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
323 REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
324 REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
325 REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
326 REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
327 REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
328 REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
329 REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
330 REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
331 REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
332 REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
333 REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
334 REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
335 REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
336 REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
337 REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
338 REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
339 REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
340 REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
341 REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
342 REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
343 REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
344 REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
345 REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
346 REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
347 REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
348 REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
349 REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
350 REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
351 REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
352 REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
353 REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
354 REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
355 REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
356 REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
357 REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
358 REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
359 REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
362 # gl_LONG_DOUBLE_VS_DOUBLE
363 # determines whether 'long double' and 'double' have the same representation.
364 # Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
365 # HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
366 # The currently known platforms where this is the case are:
367 # Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
368 AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
370 AC_CACHE_CHECK([whether long double and double are the same],
371 [gl_cv_long_double_equals_double],
373 [AC_LANG_PROGRAM([[#include <float.h>]],
374 [[typedef int check[sizeof (long double) == sizeof (double)
375 && LDBL_MANT_DIG == DBL_MANT_DIG
376 && LDBL_MAX_EXP == DBL_MAX_EXP
377 && LDBL_MIN_EXP == DBL_MIN_EXP
380 [gl_cv_long_double_equals_double=yes],
381 [gl_cv_long_double_equals_double=no])
383 if test $gl_cv_long_double_equals_double = yes; then
384 AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
385 [Define to 1 if 'long double' and 'double' have the same representation.])
386 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
388 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
390 AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])