1# math_h.m4 serial 114
2dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_MATH_H],
8[
9  AC_REQUIRE([gl_MATH_H_DEFAULTS])
10  gl_CHECK_NEXT_HEADERS([math.h])
11
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.  */
17         float f = 1.0f;
18#ifdef NAN
19         f = NAN;
20#endif
21         return f == 0;]])],
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
25    REPLACE_NAN=1
26  fi
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.  */
30         double d = HUGE_VAL;
31         return d == 0;]])],
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
35    REPLACE_HUGE_VAL=1
36  fi
37
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
46     ilogb ilogbf ilogbl
47     ldexpf ldexpl
48     log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
49     logb logbf logbl
50     modf modff modfl powf
51     remainder remainderf remainderl
52     rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
53     tanf tanl tanhf trunc truncf truncl])
54])
55
56AC_DEFUN([gl_MATH_MODULE_INDICATOR],
57[
58  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
59  AC_REQUIRE([gl_MATH_H_DEFAULTS])
60  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
61  dnl Define it also as a C macro, for the benefit of the unit tests.
62  gl_MODULE_INDICATOR_FOR_TESTS([$1])
63])
64
65AC_DEFUN([gl_MATH_H_DEFAULTS],
66[
67  GNULIB_ACOSF=0;      AC_SUBST([GNULIB_ACOSF])
68  GNULIB_ACOSL=0;      AC_SUBST([GNULIB_ACOSL])
69  GNULIB_ASINF=0;      AC_SUBST([GNULIB_ASINF])
70  GNULIB_ASINL=0;      AC_SUBST([GNULIB_ASINL])
71  GNULIB_ATANF=0;      AC_SUBST([GNULIB_ATANF])
72  GNULIB_ATANL=0;      AC_SUBST([GNULIB_ATANL])
73  GNULIB_ATAN2F=0;     AC_SUBST([GNULIB_ATAN2F])
74  GNULIB_CBRT=0;       AC_SUBST([GNULIB_CBRT])
75  GNULIB_CBRTF=0;      AC_SUBST([GNULIB_CBRTF])
76  GNULIB_CBRTL=0;      AC_SUBST([GNULIB_CBRTL])
77  GNULIB_CEIL=0;       AC_SUBST([GNULIB_CEIL])
78  GNULIB_CEILF=0;      AC_SUBST([GNULIB_CEILF])
79  GNULIB_CEILL=0;      AC_SUBST([GNULIB_CEILL])
80  GNULIB_COPYSIGN=0;   AC_SUBST([GNULIB_COPYSIGN])
81  GNULIB_COPYSIGNF=0;  AC_SUBST([GNULIB_COPYSIGNF])
82  GNULIB_COPYSIGNL=0;  AC_SUBST([GNULIB_COPYSIGNL])
83  GNULIB_COSF=0;       AC_SUBST([GNULIB_COSF])
84  GNULIB_COSL=0;       AC_SUBST([GNULIB_COSL])
85  GNULIB_COSHF=0;      AC_SUBST([GNULIB_COSHF])
86  GNULIB_EXPF=0;       AC_SUBST([GNULIB_EXPF])
87  GNULIB_EXPL=0;       AC_SUBST([GNULIB_EXPL])
88  GNULIB_EXP2=0;       AC_SUBST([GNULIB_EXP2])
89  GNULIB_EXP2F=0;      AC_SUBST([GNULIB_EXP2F])
90  GNULIB_EXP2L=0;      AC_SUBST([GNULIB_EXP2L])
91  GNULIB_EXPM1=0;      AC_SUBST([GNULIB_EXPM1])
92  GNULIB_EXPM1F=0;     AC_SUBST([GNULIB_EXPM1F])
93  GNULIB_EXPM1L=0;     AC_SUBST([GNULIB_EXPM1L])
94  GNULIB_FABSF=0;      AC_SUBST([GNULIB_FABSF])
95  GNULIB_FABSL=0;      AC_SUBST([GNULIB_FABSL])
96  GNULIB_FLOOR=0;      AC_SUBST([GNULIB_FLOOR])
97  GNULIB_FLOORF=0;     AC_SUBST([GNULIB_FLOORF])
98  GNULIB_FLOORL=0;     AC_SUBST([GNULIB_FLOORL])
99  GNULIB_FMA=0;        AC_SUBST([GNULIB_FMA])
100  GNULIB_FMAF=0;       AC_SUBST([GNULIB_FMAF])
101  GNULIB_FMAL=0;       AC_SUBST([GNULIB_FMAL])
102  GNULIB_FMOD=0;       AC_SUBST([GNULIB_FMOD])
103  GNULIB_FMODF=0;      AC_SUBST([GNULIB_FMODF])
104  GNULIB_FMODL=0;      AC_SUBST([GNULIB_FMODL])
105  GNULIB_FREXPF=0;     AC_SUBST([GNULIB_FREXPF])
106  GNULIB_FREXP=0;      AC_SUBST([GNULIB_FREXP])
107  GNULIB_FREXPL=0;     AC_SUBST([GNULIB_FREXPL])
108  GNULIB_HYPOT=0;      AC_SUBST([GNULIB_HYPOT])
109  GNULIB_HYPOTF=0;     AC_SUBST([GNULIB_HYPOTF])
110  GNULIB_HYPOTL=0;     AC_SUBST([GNULIB_HYPOTL])
111  GNULIB_ILOGB=0;      AC_SUBST([GNULIB_ILOGB])
112  GNULIB_ILOGBF=0;     AC_SUBST([GNULIB_ILOGBF])
113  GNULIB_ILOGBL=0;     AC_SUBST([GNULIB_ILOGBL])
114  GNULIB_ISFINITE=0;   AC_SUBST([GNULIB_ISFINITE])
115  GNULIB_ISINF=0;      AC_SUBST([GNULIB_ISINF])
116  GNULIB_ISNAN=0;      AC_SUBST([GNULIB_ISNAN])
117  GNULIB_ISNANF=0;     AC_SUBST([GNULIB_ISNANF])
118  GNULIB_ISNAND=0;     AC_SUBST([GNULIB_ISNAND])
119  GNULIB_ISNANL=0;     AC_SUBST([GNULIB_ISNANL])
120  GNULIB_LDEXPF=0;     AC_SUBST([GNULIB_LDEXPF])
121  GNULIB_LDEXPL=0;     AC_SUBST([GNULIB_LDEXPL])
122  GNULIB_LOG=0;        AC_SUBST([GNULIB_LOG])
123  GNULIB_LOGF=0;       AC_SUBST([GNULIB_LOGF])
124  GNULIB_LOGL=0;       AC_SUBST([GNULIB_LOGL])
125  GNULIB_LOG10=0;      AC_SUBST([GNULIB_LOG10])
126  GNULIB_LOG10F=0;     AC_SUBST([GNULIB_LOG10F])
127  GNULIB_LOG10L=0;     AC_SUBST([GNULIB_LOG10L])
128  GNULIB_LOG1P=0;      AC_SUBST([GNULIB_LOG1P])
129  GNULIB_LOG1PF=0;     AC_SUBST([GNULIB_LOG1PF])
130  GNULIB_LOG1PL=0;     AC_SUBST([GNULIB_LOG1PL])
131  GNULIB_LOG2=0;       AC_SUBST([GNULIB_LOG2])
132  GNULIB_LOG2F=0;      AC_SUBST([GNULIB_LOG2F])
133  GNULIB_LOG2L=0;      AC_SUBST([GNULIB_LOG2L])
134  GNULIB_LOGB=0;       AC_SUBST([GNULIB_LOGB])
135  GNULIB_LOGBF=0;      AC_SUBST([GNULIB_LOGBF])
136  GNULIB_LOGBL=0;      AC_SUBST([GNULIB_LOGBL])
137  GNULIB_MODF=0;       AC_SUBST([GNULIB_MODF])
138  GNULIB_MODFF=0;      AC_SUBST([GNULIB_MODFF])
139  GNULIB_MODFL=0;      AC_SUBST([GNULIB_MODFL])
140  GNULIB_POWF=0;       AC_SUBST([GNULIB_POWF])
141  GNULIB_REMAINDER=0;  AC_SUBST([GNULIB_REMAINDER])
142  GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
143  GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
144  GNULIB_RINT=0;       AC_SUBST([GNULIB_RINT])
145  GNULIB_RINTF=0;      AC_SUBST([GNULIB_RINTF])
146  GNULIB_RINTL=0;      AC_SUBST([GNULIB_RINTL])
147  GNULIB_ROUND=0;      AC_SUBST([GNULIB_ROUND])
148  GNULIB_ROUNDF=0;     AC_SUBST([GNULIB_ROUNDF])
149  GNULIB_ROUNDL=0;     AC_SUBST([GNULIB_ROUNDL])
150  GNULIB_SIGNBIT=0;    AC_SUBST([GNULIB_SIGNBIT])
151  GNULIB_SINF=0;       AC_SUBST([GNULIB_SINF])
152  GNULIB_SINL=0;       AC_SUBST([GNULIB_SINL])
153  GNULIB_SINHF=0;      AC_SUBST([GNULIB_SINHF])
154  GNULIB_SQRTF=0;      AC_SUBST([GNULIB_SQRTF])
155  GNULIB_SQRTL=0;      AC_SUBST([GNULIB_SQRTL])
156  GNULIB_TANF=0;       AC_SUBST([GNULIB_TANF])
157  GNULIB_TANL=0;       AC_SUBST([GNULIB_TANL])
158  GNULIB_TANHF=0;      AC_SUBST([GNULIB_TANHF])
159  GNULIB_TRUNC=0;      AC_SUBST([GNULIB_TRUNC])
160  GNULIB_TRUNCF=0;     AC_SUBST([GNULIB_TRUNCF])
161  GNULIB_TRUNCL=0;     AC_SUBST([GNULIB_TRUNCL])
162  dnl Assume proper GNU behavior unless another module says otherwise.
163  HAVE_ACOSF=1;                AC_SUBST([HAVE_ACOSF])
164  HAVE_ACOSL=1;                AC_SUBST([HAVE_ACOSL])
165  HAVE_ASINF=1;                AC_SUBST([HAVE_ASINF])
166  HAVE_ASINL=1;                AC_SUBST([HAVE_ASINL])
167  HAVE_ATANF=1;                AC_SUBST([HAVE_ATANF])
168  HAVE_ATANL=1;                AC_SUBST([HAVE_ATANL])
169  HAVE_ATAN2F=1;               AC_SUBST([HAVE_ATAN2F])
170  HAVE_CBRT=1;                 AC_SUBST([HAVE_CBRT])
171  HAVE_CBRTF=1;                AC_SUBST([HAVE_CBRTF])
172  HAVE_CBRTL=1;                AC_SUBST([HAVE_CBRTL])
173  HAVE_COPYSIGN=1;             AC_SUBST([HAVE_COPYSIGN])
174  HAVE_COPYSIGNL=1;            AC_SUBST([HAVE_COPYSIGNL])
175  HAVE_COSF=1;                 AC_SUBST([HAVE_COSF])
176  HAVE_COSL=1;                 AC_SUBST([HAVE_COSL])
177  HAVE_COSHF=1;                AC_SUBST([HAVE_COSHF])
178  HAVE_EXPF=1;                 AC_SUBST([HAVE_EXPF])
179  HAVE_EXPL=1;                 AC_SUBST([HAVE_EXPL])
180  HAVE_EXPM1=1;                AC_SUBST([HAVE_EXPM1])
181  HAVE_EXPM1F=1;               AC_SUBST([HAVE_EXPM1F])
182  HAVE_FABSF=1;                AC_SUBST([HAVE_FABSF])
183  HAVE_FABSL=1;                AC_SUBST([HAVE_FABSL])
184  HAVE_FMA=1;                  AC_SUBST([HAVE_FMA])
185  HAVE_FMAF=1;                 AC_SUBST([HAVE_FMAF])
186  HAVE_FMAL=1;                 AC_SUBST([HAVE_FMAL])
187  HAVE_FMODF=1;                AC_SUBST([HAVE_FMODF])
188  HAVE_FMODL=1;                AC_SUBST([HAVE_FMODL])
189  HAVE_FREXPF=1;               AC_SUBST([HAVE_FREXPF])
190  HAVE_HYPOTF=1;               AC_SUBST([HAVE_HYPOTF])
191  HAVE_HYPOTL=1;               AC_SUBST([HAVE_HYPOTL])
192  HAVE_ILOGB=1;                AC_SUBST([HAVE_ILOGB])
193  HAVE_ILOGBF=1;               AC_SUBST([HAVE_ILOGBF])
194  HAVE_ILOGBL=1;               AC_SUBST([HAVE_ILOGBL])
195  HAVE_ISNANF=1;               AC_SUBST([HAVE_ISNANF])
196  HAVE_ISNAND=1;               AC_SUBST([HAVE_ISNAND])
197  HAVE_ISNANL=1;               AC_SUBST([HAVE_ISNANL])
198  HAVE_LDEXPF=1;               AC_SUBST([HAVE_LDEXPF])
199  HAVE_LOGF=1;                 AC_SUBST([HAVE_LOGF])
200  HAVE_LOGL=1;                 AC_SUBST([HAVE_LOGL])
201  HAVE_LOG10F=1;               AC_SUBST([HAVE_LOG10F])
202  HAVE_LOG10L=1;               AC_SUBST([HAVE_LOG10L])
203  HAVE_LOG1P=1;                AC_SUBST([HAVE_LOG1P])
204  HAVE_LOG1PF=1;               AC_SUBST([HAVE_LOG1PF])
205  HAVE_LOG1PL=1;               AC_SUBST([HAVE_LOG1PL])
206  HAVE_LOGBF=1;                AC_SUBST([HAVE_LOGBF])
207  HAVE_LOGBL=1;                AC_SUBST([HAVE_LOGBL])
208  HAVE_MODFF=1;                AC_SUBST([HAVE_MODFF])
209  HAVE_MODFL=1;                AC_SUBST([HAVE_MODFL])
210  HAVE_POWF=1;                 AC_SUBST([HAVE_POWF])
211  HAVE_REMAINDER=1;            AC_SUBST([HAVE_REMAINDER])
212  HAVE_REMAINDERF=1;           AC_SUBST([HAVE_REMAINDERF])
213  HAVE_RINT=1;                 AC_SUBST([HAVE_RINT])
214  HAVE_RINTL=1;                AC_SUBST([HAVE_RINTL])
215  HAVE_SINF=1;                 AC_SUBST([HAVE_SINF])
216  HAVE_SINL=1;                 AC_SUBST([HAVE_SINL])
217  HAVE_SINHF=1;                AC_SUBST([HAVE_SINHF])
218  HAVE_SQRTF=1;                AC_SUBST([HAVE_SQRTF])
219  HAVE_SQRTL=1;                AC_SUBST([HAVE_SQRTL])
220  HAVE_TANF=1;                 AC_SUBST([HAVE_TANF])
221  HAVE_TANL=1;                 AC_SUBST([HAVE_TANL])
222  HAVE_TANHF=1;                AC_SUBST([HAVE_TANHF])
223  HAVE_DECL_ACOSL=1;           AC_SUBST([HAVE_DECL_ACOSL])
224  HAVE_DECL_ASINL=1;           AC_SUBST([HAVE_DECL_ASINL])
225  HAVE_DECL_ATANL=1;           AC_SUBST([HAVE_DECL_ATANL])
226  HAVE_DECL_CBRTF=1;           AC_SUBST([HAVE_DECL_CBRTF])
227  HAVE_DECL_CBRTL=1;           AC_SUBST([HAVE_DECL_CBRTL])
228  HAVE_DECL_CEILF=1;           AC_SUBST([HAVE_DECL_CEILF])
229  HAVE_DECL_CEILL=1;           AC_SUBST([HAVE_DECL_CEILL])
230  HAVE_DECL_COPYSIGNF=1;       AC_SUBST([HAVE_DECL_COPYSIGNF])
231  HAVE_DECL_COSL=1;            AC_SUBST([HAVE_DECL_COSL])
232  HAVE_DECL_EXPL=1;            AC_SUBST([HAVE_DECL_EXPL])
233  HAVE_DECL_EXP2=1;            AC_SUBST([HAVE_DECL_EXP2])
234  HAVE_DECL_EXP2F=1;           AC_SUBST([HAVE_DECL_EXP2F])
235  HAVE_DECL_EXP2L=1;           AC_SUBST([HAVE_DECL_EXP2L])
236  HAVE_DECL_EXPM1L=1;          AC_SUBST([HAVE_DECL_EXPM1L])
237  HAVE_DECL_FLOORF=1;          AC_SUBST([HAVE_DECL_FLOORF])
238  HAVE_DECL_FLOORL=1;          AC_SUBST([HAVE_DECL_FLOORL])
239  HAVE_DECL_FREXPL=1;          AC_SUBST([HAVE_DECL_FREXPL])
240  HAVE_DECL_LDEXPL=1;          AC_SUBST([HAVE_DECL_LDEXPL])
241  HAVE_DECL_LOGL=1;            AC_SUBST([HAVE_DECL_LOGL])
242  HAVE_DECL_LOG10L=1;          AC_SUBST([HAVE_DECL_LOG10L])
243  HAVE_DECL_LOG2=1;            AC_SUBST([HAVE_DECL_LOG2])
244  HAVE_DECL_LOG2F=1;           AC_SUBST([HAVE_DECL_LOG2F])
245  HAVE_DECL_LOG2L=1;           AC_SUBST([HAVE_DECL_LOG2L])
246  HAVE_DECL_LOGB=1;            AC_SUBST([HAVE_DECL_LOGB])
247  HAVE_DECL_REMAINDER=1;       AC_SUBST([HAVE_DECL_REMAINDER])
248  HAVE_DECL_REMAINDERL=1;      AC_SUBST([HAVE_DECL_REMAINDERL])
249  HAVE_DECL_RINTF=1;           AC_SUBST([HAVE_DECL_RINTF])
250  HAVE_DECL_ROUND=1;           AC_SUBST([HAVE_DECL_ROUND])
251  HAVE_DECL_ROUNDF=1;          AC_SUBST([HAVE_DECL_ROUNDF])
252  HAVE_DECL_ROUNDL=1;          AC_SUBST([HAVE_DECL_ROUNDL])
253  HAVE_DECL_SINL=1;            AC_SUBST([HAVE_DECL_SINL])
254  HAVE_DECL_SQRTL=1;           AC_SUBST([HAVE_DECL_SQRTL])
255  HAVE_DECL_TANL=1;            AC_SUBST([HAVE_DECL_TANL])
256  HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
257  HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
258  HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
259  REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
260  REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
261  REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
262  REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
263  REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
264  REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
265  REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
266  REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
267  REPLACE_EXP2L=0;             AC_SUBST([REPLACE_EXP2L])
268  REPLACE_FABSL=0;             AC_SUBST([REPLACE_FABSL])
269  REPLACE_FLOOR=0;             AC_SUBST([REPLACE_FLOOR])
270  REPLACE_FLOORF=0;            AC_SUBST([REPLACE_FLOORF])
271  REPLACE_FLOORL=0;            AC_SUBST([REPLACE_FLOORL])
272  REPLACE_FMA=0;               AC_SUBST([REPLACE_FMA])
273  REPLACE_FMAF=0;              AC_SUBST([REPLACE_FMAF])
274  REPLACE_FMAL=0;              AC_SUBST([REPLACE_FMAL])
275  REPLACE_FMOD=0;              AC_SUBST([REPLACE_FMOD])
276  REPLACE_FMODF=0;             AC_SUBST([REPLACE_FMODF])
277  REPLACE_FMODL=0;             AC_SUBST([REPLACE_FMODL])
278  REPLACE_FREXPF=0;            AC_SUBST([REPLACE_FREXPF])
279  REPLACE_FREXP=0;             AC_SUBST([REPLACE_FREXP])
280  REPLACE_FREXPL=0;            AC_SUBST([REPLACE_FREXPL])
281  REPLACE_HUGE_VAL=0;          AC_SUBST([REPLACE_HUGE_VAL])
282  REPLACE_HYPOT=0;             AC_SUBST([REPLACE_HYPOT])
283  REPLACE_HYPOTF=0;            AC_SUBST([REPLACE_HYPOTF])
284  REPLACE_HYPOTL=0;            AC_SUBST([REPLACE_HYPOTL])
285  REPLACE_ILOGB=0;             AC_SUBST([REPLACE_ILOGB])
286  REPLACE_ILOGBF=0;            AC_SUBST([REPLACE_ILOGBF])
287  REPLACE_ISFINITE=0;          AC_SUBST([REPLACE_ISFINITE])
288  REPLACE_ISINF=0;             AC_SUBST([REPLACE_ISINF])
289  REPLACE_ISNAN=0;             AC_SUBST([REPLACE_ISNAN])
290  REPLACE_LDEXPL=0;            AC_SUBST([REPLACE_LDEXPL])
291  REPLACE_LOG=0;               AC_SUBST([REPLACE_LOG])
292  REPLACE_LOGF=0;              AC_SUBST([REPLACE_LOGF])
293  REPLACE_LOGL=0;              AC_SUBST([REPLACE_LOGL])
294  REPLACE_LOG10=0;             AC_SUBST([REPLACE_LOG10])
295  REPLACE_LOG10F=0;            AC_SUBST([REPLACE_LOG10F])
296  REPLACE_LOG10L=0;            AC_SUBST([REPLACE_LOG10L])
297  REPLACE_LOG1P=0;             AC_SUBST([REPLACE_LOG1P])
298  REPLACE_LOG1PF=0;            AC_SUBST([REPLACE_LOG1PF])
299  REPLACE_LOG1PL=0;            AC_SUBST([REPLACE_LOG1PL])
300  REPLACE_LOG2=0;              AC_SUBST([REPLACE_LOG2])
301  REPLACE_LOG2F=0;             AC_SUBST([REPLACE_LOG2F])
302  REPLACE_LOG2L=0;             AC_SUBST([REPLACE_LOG2L])
303  REPLACE_LOGB=0;              AC_SUBST([REPLACE_LOGB])
304  REPLACE_LOGBF=0;             AC_SUBST([REPLACE_LOGBF])
305  REPLACE_LOGBL=0;             AC_SUBST([REPLACE_LOGBL])
306  REPLACE_MODF=0;              AC_SUBST([REPLACE_MODF])
307  REPLACE_MODFF=0;             AC_SUBST([REPLACE_MODFF])
308  REPLACE_MODFL=0;             AC_SUBST([REPLACE_MODFL])
309  REPLACE_NAN=0;               AC_SUBST([REPLACE_NAN])
310  REPLACE_REMAINDER=0;         AC_SUBST([REPLACE_REMAINDER])
311  REPLACE_REMAINDERF=0;        AC_SUBST([REPLACE_REMAINDERF])
312  REPLACE_REMAINDERL=0;        AC_SUBST([REPLACE_REMAINDERL])
313  REPLACE_ROUND=0;             AC_SUBST([REPLACE_ROUND])
314  REPLACE_ROUNDF=0;            AC_SUBST([REPLACE_ROUNDF])
315  REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
316  REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
317  REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
318  REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
319  REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
320  REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
321  REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
322])
323
324# gl_LONG_DOUBLE_VS_DOUBLE
325# determines whether 'long double' and 'double' have the same representation.
326# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
327# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
328# The currently known platforms where this is the case are:
329# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
330AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
331[
332  AC_CACHE_CHECK([whether long double and double are the same],
333    [gl_cv_long_double_equals_double],
334    [AC_COMPILE_IFELSE(
335       [AC_LANG_PROGRAM([[#include <float.h>]],
336          [[typedef int check[sizeof (long double) == sizeof (double)
337                              && LDBL_MANT_DIG == DBL_MANT_DIG
338                              && LDBL_MAX_EXP == DBL_MAX_EXP
339                              && LDBL_MIN_EXP == DBL_MIN_EXP
340                              ? 1 : -1];
341          ]])],
342       [gl_cv_long_double_equals_double=yes],
343       [gl_cv_long_double_equals_double=no])
344    ])
345  if test $gl_cv_long_double_equals_double = yes; then
346    AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
347      [Define to 1 if 'long double' and 'double' have the same representation.])
348    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
349  else
350    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
351  fi
352  AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
353])
354