defsubst
[bpt/guile.git] / lib / math.in.h
CommitLineData
2e65b52f
LC
1/* A GNU-like <math.h>.
2
5e69ceb7 3 Copyright (C) 2002-2003, 2007-2014 Free Software Foundation, Inc.
2e65b52f
LC
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
3d458a81 18#ifndef _@GUARD_PREFIX@_MATH_H
2e65b52f
LC
19
20#if __GNUC__ >= 3
21@PRAGMA_SYSTEM_HEADER@
22#endif
0f00f2c3 23@PRAGMA_COLUMNS@
2e65b52f
LC
24
25/* The include_next requires a split double-inclusion guard. */
26#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
27
3d458a81
AW
28#ifndef _@GUARD_PREFIX@_MATH_H
29#define _@GUARD_PREFIX@_MATH_H
2e65b52f 30
5e69ceb7
MW
31#ifndef _GL_INLINE_HEADER_BEGIN
32 #error "Please include config.h first."
33#endif
af07e104
AW
34_GL_INLINE_HEADER_BEGIN
35#ifndef _GL_MATH_INLINE
36# define _GL_MATH_INLINE _GL_INLINE
37#endif
2e65b52f
LC
38
39/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
40
41/* The definition of _GL_ARG_NONNULL is copied here. */
42
43/* The definition of _GL_WARN_ON_USE is copied here. */
44
35428fb6
LC
45#ifdef __cplusplus
46/* Helper macros to define type-generic function FUNC as overloaded functions,
47 rather than as macros like in C. POSIX declares these with an argument of
48 real-floating (that is, one of float, double, or long double). */
49# define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
50static inline int \
51_gl_cxx_ ## func ## f (float f) \
52{ \
53 return func (f); \
54} \
55static inline int \
56_gl_cxx_ ## func ## d (double d) \
57{ \
58 return func (d); \
59} \
60static inline int \
61_gl_cxx_ ## func ## l (long double l) \
62{ \
63 return func (l); \
64}
65# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
66inline int \
67func (float f) \
68{ \
69 return _gl_cxx_ ## func ## f (f); \
70} \
71inline int \
72func (double d) \
73{ \
74 return _gl_cxx_ ## func ## d (d); \
75} \
76inline int \
77func (long double l) \
78{ \
79 return _gl_cxx_ ## func ## l (l); \
80}
81#endif
82
2e65b52f
LC
83/* Helper macros to define a portability warning for the
84 classification macro FUNC called with VALUE. POSIX declares the
85 classification macros with an argument of real-floating (that is,
86 one of float, double, or long double). */
87#define _GL_WARN_REAL_FLOATING_DECL(func) \
af07e104 88_GL_MATH_INLINE int \
2e65b52f
LC
89rpl_ ## func ## f (float f) \
90{ \
91 return func (f); \
92} \
af07e104 93_GL_MATH_INLINE int \
2e65b52f
LC
94rpl_ ## func ## d (double d) \
95{ \
96 return func (d); \
97} \
af07e104 98_GL_MATH_INLINE int \
2e65b52f
LC
99rpl_ ## func ## l (long double l) \
100{ \
101 return func (l); \
102} \
103_GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - " \
104 "use gnulib module " #func " for portability"); \
105_GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - " \
106 "use gnulib module " #func " for portability"); \
107_GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - " \
108 "use gnulib module " #func " for portability")
109#define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
110 (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
111 : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
112 : rpl_ ## func ## l (value))
113
114
35428fb6
LC
115#if @REPLACE_ITOLD@
116/* Pull in a function that fixes the 'int' to 'long double' conversion
117 of glibc 2.7. */
118_GL_EXTERN_C void _Qp_itoq (long double *, int);
119static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
120#endif
121
122
2e65b52f
LC
123/* POSIX allows platforms that don't support NAN. But all major
124 machines in the past 15 years have supported something close to
125 IEEE NaN, so we define this unconditionally. We also must define
126 it on platforms like Solaris 10, where NAN is present but defined
127 as a function pointer rather than a floating point constant. */
128#if !defined NAN || @REPLACE_NAN@
49114fd4
LC
129# if !GNULIB_defined_NAN
130# undef NAN
35428fb6
LC
131 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
132 choke on the expression 0.0 / 0.0. */
133# if defined __DECC || defined _MSC_VER
af07e104 134_GL_MATH_INLINE float
2e65b52f
LC
135_NaN ()
136{
137 static float zero = 0.0f;
138 return zero / zero;
139}
49114fd4
LC
140# define NAN (_NaN())
141# else
142# define NAN (0.0f / 0.0f)
143# endif
144# define GNULIB_defined_NAN 1
2e65b52f
LC
145# endif
146#endif
147
148/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
149 than a floating point constant. */
150#if @REPLACE_HUGE_VAL@
005de2e8
LC
151# undef HUGE_VALF
152# define HUGE_VALF (1.0f / 0.0f)
2e65b52f
LC
153# undef HUGE_VAL
154# define HUGE_VAL (1.0 / 0.0)
005de2e8
LC
155# undef HUGE_VALL
156# define HUGE_VALL (1.0L / 0.0L)
157#endif
158
159/* HUGE_VALF is a 'float' Infinity. */
160#ifndef HUGE_VALF
161# if defined _MSC_VER
162/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */
163# define HUGE_VALF (1e25f * 1e25f)
164# else
165# define HUGE_VALF (1.0f / 0.0f)
166# endif
167#endif
168
169/* HUGE_VAL is a 'double' Infinity. */
170#ifndef HUGE_VAL
171# if defined _MSC_VER
172/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
173# define HUGE_VAL (1e250 * 1e250)
174# else
175# define HUGE_VAL (1.0 / 0.0)
176# endif
177#endif
178
179/* HUGE_VALL is a 'long double' Infinity. */
180#ifndef HUGE_VALL
181# if defined _MSC_VER
182/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */
183# define HUGE_VALL (1e250L * 1e250L)
184# else
185# define HUGE_VALL (1.0L / 0.0L)
186# endif
187#endif
188
189
190/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */
191#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
192# if defined __NetBSD__ || defined __sgi
193 /* NetBSD, IRIX 6.5: match what ilogb() does */
194# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
195# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
196# elif defined _AIX
197 /* AIX 5.1: match what ilogb() does in AIX >= 5.2 */
198# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
199# define FP_ILOGBNAN 2147483647 /* INT_MAX */
200# elif defined __sun
201 /* Solaris 9: match what ilogb() does */
202# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
203# define FP_ILOGBNAN 2147483647 /* INT_MAX */
204# else
205 /* Gnulib defined values. */
206# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
207# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
208# endif
2e65b52f
LC
209#endif
210
211
35428fb6
LC
212#if @GNULIB_ACOSF@
213# if !@HAVE_ACOSF@
214# undef acosf
215_GL_FUNCDECL_SYS (acosf, float, (float x));
2e65b52f 216# endif
35428fb6
LC
217_GL_CXXALIAS_SYS (acosf, float, (float x));
218_GL_CXXALIASWARN (acosf);
2e65b52f 219#elif defined GNULIB_POSIXCHECK
35428fb6
LC
220# undef acosf
221# if HAVE_RAW_DECL_ACOSF
222_GL_WARN_ON_USE (acosf, "acosf is unportable - "
223 "use gnulib module acosf for portability");
2e65b52f
LC
224# endif
225#endif
226
2e65b52f
LC
227#if @GNULIB_ACOSL@
228# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
005de2e8 229# undef acosl
2e65b52f
LC
230_GL_FUNCDECL_SYS (acosl, long double, (long double x));
231# endif
232_GL_CXXALIAS_SYS (acosl, long double, (long double x));
233_GL_CXXALIASWARN (acosl);
234#elif defined GNULIB_POSIXCHECK
235# undef acosl
236# if HAVE_RAW_DECL_ACOSL
237_GL_WARN_ON_USE (acosl, "acosl is unportable - "
005de2e8 238 "use gnulib module acosl for portability");
2e65b52f
LC
239# endif
240#endif
241
242
35428fb6
LC
243#if @GNULIB_ASINF@
244# if !@HAVE_ASINF@
245# undef asinf
246_GL_FUNCDECL_SYS (asinf, float, (float x));
247# endif
248_GL_CXXALIAS_SYS (asinf, float, (float x));
249_GL_CXXALIASWARN (asinf);
250#elif defined GNULIB_POSIXCHECK
251# undef asinf
252# if HAVE_RAW_DECL_ASINF
253_GL_WARN_ON_USE (asinf, "asinf is unportable - "
254 "use gnulib module asinf for portability");
255# endif
256#endif
257
2e65b52f
LC
258#if @GNULIB_ASINL@
259# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
005de2e8 260# undef asinl
2e65b52f
LC
261_GL_FUNCDECL_SYS (asinl, long double, (long double x));
262# endif
263_GL_CXXALIAS_SYS (asinl, long double, (long double x));
264_GL_CXXALIASWARN (asinl);
265#elif defined GNULIB_POSIXCHECK
266# undef asinl
267# if HAVE_RAW_DECL_ASINL
268_GL_WARN_ON_USE (asinl, "asinl is unportable - "
005de2e8 269 "use gnulib module asinl for portability");
2e65b52f
LC
270# endif
271#endif
272
273
35428fb6
LC
274#if @GNULIB_ATANF@
275# if !@HAVE_ATANF@
276# undef atanf
277_GL_FUNCDECL_SYS (atanf, float, (float x));
278# endif
279_GL_CXXALIAS_SYS (atanf, float, (float x));
280_GL_CXXALIASWARN (atanf);
281#elif defined GNULIB_POSIXCHECK
282# undef atanf
283# if HAVE_RAW_DECL_ATANF
284_GL_WARN_ON_USE (atanf, "atanf is unportable - "
285 "use gnulib module atanf for portability");
286# endif
287#endif
288
2e65b52f
LC
289#if @GNULIB_ATANL@
290# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
005de2e8 291# undef atanl
2e65b52f
LC
292_GL_FUNCDECL_SYS (atanl, long double, (long double x));
293# endif
294_GL_CXXALIAS_SYS (atanl, long double, (long double x));
295_GL_CXXALIASWARN (atanl);
296#elif defined GNULIB_POSIXCHECK
297# undef atanl
298# if HAVE_RAW_DECL_ATANL
299_GL_WARN_ON_USE (atanl, "atanl is unportable - "
005de2e8 300 "use gnulib module atanl for portability");
2e65b52f
LC
301# endif
302#endif
303
304
35428fb6
LC
305#if @GNULIB_ATAN2F@
306# if !@HAVE_ATAN2F@
307# undef atan2f
308_GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
309# endif
310_GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
311_GL_CXXALIASWARN (atan2f);
312#elif defined GNULIB_POSIXCHECK
313# undef atan2f
314# if HAVE_RAW_DECL_ATAN2F
315_GL_WARN_ON_USE (atan2f, "atan2f is unportable - "
316 "use gnulib module atan2f for portability");
317# endif
318#endif
319
320
005de2e8
LC
321#if @GNULIB_CBRTF@
322# if @REPLACE_CBRTF@
323# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
324# undef cbrtf
325# define cbrtf rpl_cbrtf
326# endif
327_GL_FUNCDECL_RPL (cbrtf, float, (float x));
328_GL_CXXALIAS_RPL (cbrtf, float, (float x));
329# else
330# if !@HAVE_DECL_CBRTF@
331_GL_FUNCDECL_SYS (cbrtf, float, (float x));
332# endif
333_GL_CXXALIAS_SYS (cbrtf, float, (float x));
334# endif
335_GL_CXXALIASWARN (cbrtf);
336#elif defined GNULIB_POSIXCHECK
337# undef cbrtf
338# if HAVE_RAW_DECL_CBRTF
339_GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - "
340 "use gnulib module cbrtf for portability");
341# endif
342#endif
343
344#if @GNULIB_CBRT@
345# if !@HAVE_CBRT@
346_GL_FUNCDECL_SYS (cbrt, double, (double x));
347# endif
348_GL_CXXALIAS_SYS (cbrt, double, (double x));
349_GL_CXXALIASWARN (cbrt);
350#elif defined GNULIB_POSIXCHECK
351# undef cbrt
352# if HAVE_RAW_DECL_CBRT
353_GL_WARN_ON_USE (cbrt, "cbrt is unportable - "
354 "use gnulib module cbrt for portability");
355# endif
356#endif
357
358#if @GNULIB_CBRTL@
359# if @REPLACE_CBRTL@
360# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
361# undef cbrtl
362# define cbrtl rpl_cbrtl
363# endif
364_GL_FUNCDECL_RPL (cbrtl, long double, (long double x));
365_GL_CXXALIAS_RPL (cbrtl, long double, (long double x));
366# else
367# if !@HAVE_DECL_CBRTL@
368_GL_FUNCDECL_SYS (cbrtl, long double, (long double x));
369# endif
370_GL_CXXALIAS_SYS (cbrtl, long double, (long double x));
371# endif
372_GL_CXXALIASWARN (cbrtl);
373#elif defined GNULIB_POSIXCHECK
374# undef cbrtl
375# if HAVE_RAW_DECL_CBRTL
376_GL_WARN_ON_USE (cbrtl, "cbrtl is unportable - "
377 "use gnulib module cbrtl for portability");
378# endif
379#endif
380
381
2e65b52f
LC
382#if @GNULIB_CEILF@
383# if @REPLACE_CEILF@
384# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 385# undef ceilf
2e65b52f
LC
386# define ceilf rpl_ceilf
387# endif
388_GL_FUNCDECL_RPL (ceilf, float, (float x));
389_GL_CXXALIAS_RPL (ceilf, float, (float x));
390# else
391# if !@HAVE_DECL_CEILF@
005de2e8 392# undef ceilf
2e65b52f
LC
393_GL_FUNCDECL_SYS (ceilf, float, (float x));
394# endif
395_GL_CXXALIAS_SYS (ceilf, float, (float x));
396# endif
397_GL_CXXALIASWARN (ceilf);
398#elif defined GNULIB_POSIXCHECK
399# undef ceilf
400# if HAVE_RAW_DECL_CEILF
401_GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
402 "use gnulib module ceilf for portability");
403# endif
404#endif
405
49114fd4
LC
406#if @GNULIB_CEIL@
407# if @REPLACE_CEIL@
408# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
409# define ceil rpl_ceil
410# endif
411_GL_FUNCDECL_RPL (ceil, double, (double x));
412_GL_CXXALIAS_RPL (ceil, double, (double x));
413# else
414_GL_CXXALIAS_SYS (ceil, double, (double x));
415# endif
416_GL_CXXALIASWARN (ceil);
417#endif
418
2e65b52f
LC
419#if @GNULIB_CEILL@
420# if @REPLACE_CEILL@
421# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 422# undef ceill
2e65b52f
LC
423# define ceill rpl_ceill
424# endif
425_GL_FUNCDECL_RPL (ceill, long double, (long double x));
426_GL_CXXALIAS_RPL (ceill, long double, (long double x));
427# else
428# if !@HAVE_DECL_CEILL@
005de2e8 429# undef ceill
2e65b52f
LC
430_GL_FUNCDECL_SYS (ceill, long double, (long double x));
431# endif
432_GL_CXXALIAS_SYS (ceill, long double, (long double x));
433# endif
434_GL_CXXALIASWARN (ceill);
435#elif defined GNULIB_POSIXCHECK
436# undef ceill
437# if HAVE_RAW_DECL_CEILL
438_GL_WARN_ON_USE (ceill, "ceill is unportable - "
439 "use gnulib module ceill for portability");
440# endif
441#endif
442
443
35428fb6 444#if @GNULIB_COPYSIGNF@
005de2e8 445# if !@HAVE_DECL_COPYSIGNF@
35428fb6
LC
446_GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
447# endif
448_GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
449_GL_CXXALIASWARN (copysignf);
450#elif defined GNULIB_POSIXCHECK
451# undef copysignf
452# if HAVE_RAW_DECL_COPYSIGNF
453_GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
454 "use gnulib module copysignf for portability");
455# endif
456#endif
457
458#if @GNULIB_COPYSIGN@
459# if !@HAVE_COPYSIGN@
460_GL_FUNCDECL_SYS (copysign, double, (double x, double y));
461# endif
462_GL_CXXALIAS_SYS (copysign, double, (double x, double y));
463_GL_CXXALIASWARN (copysign);
464#elif defined GNULIB_POSIXCHECK
465# undef copysign
466# if HAVE_RAW_DECL_COPYSIGN
467_GL_WARN_ON_USE (copysign, "copysign is unportable - "
468 "use gnulib module copysign for portability");
469# endif
470#endif
471
472#if @GNULIB_COPYSIGNL@
473# if !@HAVE_COPYSIGNL@
474_GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
475# endif
476_GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
477_GL_CXXALIASWARN (copysignl);
478#elif defined GNULIB_POSIXCHECK
479# undef copysignl
480# if HAVE_RAW_DECL_COPYSIGNL
481_GL_WARN_ON_USE (copysign, "copysignl is unportable - "
482 "use gnulib module copysignl for portability");
483# endif
484#endif
485
486
487#if @GNULIB_COSF@
488# if !@HAVE_COSF@
489# undef cosf
490_GL_FUNCDECL_SYS (cosf, float, (float x));
491# endif
492_GL_CXXALIAS_SYS (cosf, float, (float x));
493_GL_CXXALIASWARN (cosf);
494#elif defined GNULIB_POSIXCHECK
495# undef cosf
496# if HAVE_RAW_DECL_COSF
497_GL_WARN_ON_USE (cosf, "cosf is unportable - "
498 "use gnulib module cosf for portability");
499# endif
500#endif
501
2e65b52f
LC
502#if @GNULIB_COSL@
503# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
005de2e8 504# undef cosl
2e65b52f
LC
505_GL_FUNCDECL_SYS (cosl, long double, (long double x));
506# endif
507_GL_CXXALIAS_SYS (cosl, long double, (long double x));
508_GL_CXXALIASWARN (cosl);
509#elif defined GNULIB_POSIXCHECK
510# undef cosl
511# if HAVE_RAW_DECL_COSL
512_GL_WARN_ON_USE (cosl, "cosl is unportable - "
005de2e8 513 "use gnulib module cosl for portability");
2e65b52f
LC
514# endif
515#endif
516
517
35428fb6
LC
518#if @GNULIB_COSHF@
519# if !@HAVE_COSHF@
520# undef coshf
521_GL_FUNCDECL_SYS (coshf, float, (float x));
522# endif
523_GL_CXXALIAS_SYS (coshf, float, (float x));
524_GL_CXXALIASWARN (coshf);
525#elif defined GNULIB_POSIXCHECK
526# undef coshf
527# if HAVE_RAW_DECL_COSHF
528_GL_WARN_ON_USE (coshf, "coshf is unportable - "
529 "use gnulib module coshf for portability");
530# endif
531#endif
532
533
534#if @GNULIB_EXPF@
535# if !@HAVE_EXPF@
536# undef expf
537_GL_FUNCDECL_SYS (expf, float, (float x));
538# endif
539_GL_CXXALIAS_SYS (expf, float, (float x));
540_GL_CXXALIASWARN (expf);
541#elif defined GNULIB_POSIXCHECK
542# undef expf
543# if HAVE_RAW_DECL_EXPF
544_GL_WARN_ON_USE (expf, "expf is unportable - "
545 "use gnulib module expf for portability");
546# endif
547#endif
548
2e65b52f
LC
549#if @GNULIB_EXPL@
550# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
005de2e8 551# undef expl
2e65b52f
LC
552_GL_FUNCDECL_SYS (expl, long double, (long double x));
553# endif
554_GL_CXXALIAS_SYS (expl, long double, (long double x));
555_GL_CXXALIASWARN (expl);
556#elif defined GNULIB_POSIXCHECK
557# undef expl
558# if HAVE_RAW_DECL_EXPL
559_GL_WARN_ON_USE (expl, "expl is unportable - "
005de2e8
LC
560 "use gnulib module expl for portability");
561# endif
562#endif
563
564
565#if @GNULIB_EXP2F@
566# if !@HAVE_DECL_EXP2F@
567_GL_FUNCDECL_SYS (exp2f, float, (float x));
568# endif
569_GL_CXXALIAS_SYS (exp2f, float, (float x));
570_GL_CXXALIASWARN (exp2f);
571#elif defined GNULIB_POSIXCHECK
572# undef exp2f
573# if HAVE_RAW_DECL_EXP2F
574_GL_WARN_ON_USE (exp2f, "exp2f is unportable - "
575 "use gnulib module exp2f for portability");
576# endif
577#endif
578
579#if @GNULIB_EXP2@
580# if @REPLACE_EXP2@
581# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
582# undef exp2
583# define exp2 rpl_exp2
584# endif
585_GL_FUNCDECL_RPL (exp2, double, (double x));
586_GL_CXXALIAS_RPL (exp2, double, (double x));
587# else
588# if !@HAVE_DECL_EXP2@
589_GL_FUNCDECL_SYS (exp2, double, (double x));
590# endif
591_GL_CXXALIAS_SYS (exp2, double, (double x));
592# endif
593_GL_CXXALIASWARN (exp2);
594#elif defined GNULIB_POSIXCHECK
595# undef exp2
596# if HAVE_RAW_DECL_EXP2
597_GL_WARN_ON_USE (exp2, "exp2 is unportable - "
598 "use gnulib module exp2 for portability");
599# endif
600#endif
601
602#if @GNULIB_EXP2L@
603# if @REPLACE_EXP2L@
604# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
605# undef exp2l
606# define exp2l rpl_exp2l
607# endif
608_GL_FUNCDECL_RPL (exp2l, long double, (long double x));
609_GL_CXXALIAS_RPL (exp2l, long double, (long double x));
610# else
611# if !@HAVE_DECL_EXP2L@
612# undef exp2l
613_GL_FUNCDECL_SYS (exp2l, long double, (long double x));
614# endif
615_GL_CXXALIAS_SYS (exp2l, long double, (long double x));
616# endif
617_GL_CXXALIASWARN (exp2l);
618#elif defined GNULIB_POSIXCHECK
619# undef exp2l
620# if HAVE_RAW_DECL_EXP2L
621_GL_WARN_ON_USE (exp2l, "exp2l is unportable - "
622 "use gnulib module exp2l for portability");
623# endif
624#endif
625
626
627#if @GNULIB_EXPM1F@
628# if @REPLACE_EXPM1F@
629# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
630# undef expm1f
631# define expm1f rpl_expm1f
632# endif
633_GL_FUNCDECL_RPL (expm1f, float, (float x));
634_GL_CXXALIAS_RPL (expm1f, float, (float x));
635# else
636# if !@HAVE_EXPM1F@
637_GL_FUNCDECL_SYS (expm1f, float, (float x));
638# endif
639_GL_CXXALIAS_SYS (expm1f, float, (float x));
640# endif
641_GL_CXXALIASWARN (expm1f);
642#elif defined GNULIB_POSIXCHECK
643# undef expm1f
644# if HAVE_RAW_DECL_EXPM1F
645_GL_WARN_ON_USE (expm1f, "expm1f is unportable - "
646 "use gnulib module expm1f for portability");
647# endif
648#endif
649
650#if @GNULIB_EXPM1@
651# if @REPLACE_EXPM1@
652# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
653# undef expm1
654# define expm1 rpl_expm1
655# endif
656_GL_FUNCDECL_RPL (expm1, double, (double x));
657_GL_CXXALIAS_RPL (expm1, double, (double x));
658# else
659# if !@HAVE_EXPM1@
660_GL_FUNCDECL_SYS (expm1, double, (double x));
661# endif
662_GL_CXXALIAS_SYS (expm1, double, (double x));
663# endif
664_GL_CXXALIASWARN (expm1);
665#elif defined GNULIB_POSIXCHECK
666# undef expm1
667# if HAVE_RAW_DECL_EXPM1
668_GL_WARN_ON_USE (expm1, "expm1 is unportable - "
669 "use gnulib module expm1 for portability");
670# endif
671#endif
672
673#if @GNULIB_EXPM1L@
674# if !@HAVE_DECL_EXPM1L@
675# undef expm1l
676_GL_FUNCDECL_SYS (expm1l, long double, (long double x));
677# endif
678_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
679_GL_CXXALIASWARN (expm1l);
680#elif defined GNULIB_POSIXCHECK
681# undef expm1l
682# if HAVE_RAW_DECL_EXPM1L
683_GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
684 "use gnulib module expm1l for portability");
2e65b52f
LC
685# endif
686#endif
687
688
35428fb6
LC
689#if @GNULIB_FABSF@
690# if !@HAVE_FABSF@
691# undef fabsf
692_GL_FUNCDECL_SYS (fabsf, float, (float x));
693# endif
694_GL_CXXALIAS_SYS (fabsf, float, (float x));
695_GL_CXXALIASWARN (fabsf);
696#elif defined GNULIB_POSIXCHECK
697# undef fabsf
698# if HAVE_RAW_DECL_FABSF
699_GL_WARN_ON_USE (fabsf, "fabsf is unportable - "
700 "use gnulib module fabsf for portability");
701# endif
702#endif
703
005de2e8
LC
704#if @GNULIB_FABSL@
705# if @REPLACE_FABSL@
706# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
707# undef fabsl
708# define fabsl rpl_fabsl
709# endif
710_GL_FUNCDECL_RPL (fabsl, long double, (long double x));
711_GL_CXXALIAS_RPL (fabsl, long double, (long double x));
712# else
713# if !@HAVE_FABSL@
714# undef fabsl
715_GL_FUNCDECL_SYS (fabsl, long double, (long double x));
716# endif
717_GL_CXXALIAS_SYS (fabsl, long double, (long double x));
718# endif
719_GL_CXXALIASWARN (fabsl);
720#elif defined GNULIB_POSIXCHECK
721# undef fabsl
722# if HAVE_RAW_DECL_FABSL
723_GL_WARN_ON_USE (fabsl, "fabsl is unportable - "
724 "use gnulib module fabsl for portability");
725# endif
726#endif
727
35428fb6 728
2e65b52f
LC
729#if @GNULIB_FLOORF@
730# if @REPLACE_FLOORF@
731# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 732# undef floorf
2e65b52f
LC
733# define floorf rpl_floorf
734# endif
735_GL_FUNCDECL_RPL (floorf, float, (float x));
736_GL_CXXALIAS_RPL (floorf, float, (float x));
49114fd4 737# else
2e65b52f 738# if !@HAVE_DECL_FLOORF@
005de2e8 739# undef floorf
2e65b52f
LC
740_GL_FUNCDECL_SYS (floorf, float, (float x));
741# endif
742_GL_CXXALIAS_SYS (floorf, float, (float x));
743# endif
744_GL_CXXALIASWARN (floorf);
745#elif defined GNULIB_POSIXCHECK
746# undef floorf
747# if HAVE_RAW_DECL_FLOORF
748_GL_WARN_ON_USE (floorf, "floorf is unportable - "
749 "use gnulib module floorf for portability");
750# endif
751#endif
752
49114fd4
LC
753#if @GNULIB_FLOOR@
754# if @REPLACE_FLOOR@
755# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
756# define floor rpl_floor
757# endif
758_GL_FUNCDECL_RPL (floor, double, (double x));
759_GL_CXXALIAS_RPL (floor, double, (double x));
760# else
761_GL_CXXALIAS_SYS (floor, double, (double x));
762# endif
763_GL_CXXALIASWARN (floor);
764#endif
765
2e65b52f
LC
766#if @GNULIB_FLOORL@
767# if @REPLACE_FLOORL@
768# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 769# undef floorl
2e65b52f
LC
770# define floorl rpl_floorl
771# endif
772_GL_FUNCDECL_RPL (floorl, long double, (long double x));
773_GL_CXXALIAS_RPL (floorl, long double, (long double x));
774# else
775# if !@HAVE_DECL_FLOORL@
005de2e8 776# undef floorl
2e65b52f
LC
777_GL_FUNCDECL_SYS (floorl, long double, (long double x));
778# endif
779_GL_CXXALIAS_SYS (floorl, long double, (long double x));
780# endif
781_GL_CXXALIASWARN (floorl);
782#elif defined GNULIB_POSIXCHECK
783# undef floorl
784# if HAVE_RAW_DECL_FLOORL
785_GL_WARN_ON_USE (floorl, "floorl is unportable - "
786 "use gnulib module floorl for portability");
787# endif
788#endif
789
790
7f1ea859
LC
791#if @GNULIB_FMAF@
792# if @REPLACE_FMAF@
793# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
794# undef fmaf
795# define fmaf rpl_fmaf
796# endif
797_GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
798_GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
799# else
800# if !@HAVE_FMAF@
801_GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
802# endif
803_GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
804# endif
805_GL_CXXALIASWARN (fmaf);
806#elif defined GNULIB_POSIXCHECK
807# undef fmaf
808# if HAVE_RAW_DECL_FMAF
809_GL_WARN_ON_USE (fmaf, "fmaf is unportable - "
810 "use gnulib module fmaf for portability");
811# endif
812#endif
813
814#if @GNULIB_FMA@
815# if @REPLACE_FMA@
816# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
817# undef fma
818# define fma rpl_fma
819# endif
820_GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
821_GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
822# else
823# if !@HAVE_FMA@
824_GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
825# endif
826_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
827# endif
828_GL_CXXALIASWARN (fma);
829#elif defined GNULIB_POSIXCHECK
830# undef fma
831# if HAVE_RAW_DECL_FMA
832_GL_WARN_ON_USE (fma, "fma is unportable - "
833 "use gnulib module fma for portability");
834# endif
835#endif
836
837#if @GNULIB_FMAL@
838# if @REPLACE_FMAL@
839# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
840# undef fmal
841# define fmal rpl_fmal
842# endif
843_GL_FUNCDECL_RPL (fmal, long double,
844 (long double x, long double y, long double z));
845_GL_CXXALIAS_RPL (fmal, long double,
846 (long double x, long double y, long double z));
847# else
848# if !@HAVE_FMAL@
005de2e8 849# undef fmal
7f1ea859
LC
850_GL_FUNCDECL_SYS (fmal, long double,
851 (long double x, long double y, long double z));
852# endif
853_GL_CXXALIAS_SYS (fmal, long double,
854 (long double x, long double y, long double z));
855# endif
856_GL_CXXALIASWARN (fmal);
857#elif defined GNULIB_POSIXCHECK
858# undef fmal
859# if HAVE_RAW_DECL_FMAL
860_GL_WARN_ON_USE (fmal, "fmal is unportable - "
861 "use gnulib module fmal for portability");
862# endif
863#endif
864
865
35428fb6 866#if @GNULIB_FMODF@
005de2e8
LC
867# if @REPLACE_FMODF@
868# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
869# undef fmodf
870# define fmodf rpl_fmodf
871# endif
872_GL_FUNCDECL_RPL (fmodf, float, (float x, float y));
873_GL_CXXALIAS_RPL (fmodf, float, (float x, float y));
874# else
875# if !@HAVE_FMODF@
876# undef fmodf
35428fb6 877_GL_FUNCDECL_SYS (fmodf, float, (float x, float y));
005de2e8 878# endif
35428fb6 879_GL_CXXALIAS_SYS (fmodf, float, (float x, float y));
005de2e8 880# endif
35428fb6
LC
881_GL_CXXALIASWARN (fmodf);
882#elif defined GNULIB_POSIXCHECK
883# undef fmodf
884# if HAVE_RAW_DECL_FMODF
885_GL_WARN_ON_USE (fmodf, "fmodf is unportable - "
886 "use gnulib module fmodf for portability");
887# endif
888#endif
889
005de2e8
LC
890#if @GNULIB_FMOD@
891# if @REPLACE_FMOD@
892# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
893# undef fmod
894# define fmod rpl_fmod
895# endif
896_GL_FUNCDECL_RPL (fmod, double, (double x, double y));
897_GL_CXXALIAS_RPL (fmod, double, (double x, double y));
898# else
899_GL_CXXALIAS_SYS (fmod, double, (double x, double y));
900# endif
901_GL_CXXALIASWARN (fmod);
902#elif defined GNULIB_POSIXCHECK
903# undef fmod
904# if HAVE_RAW_DECL_FMOD
905_GL_WARN_ON_USE (fmod, "fmod has portability problems - "
906 "use gnulib module fmod for portability");
907# endif
908#endif
909
910#if @GNULIB_FMODL@
911# if @REPLACE_FMODL@
912# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
913# undef fmodl
914# define fmodl rpl_fmodl
915# endif
916_GL_FUNCDECL_RPL (fmodl, long double, (long double x, long double y));
917_GL_CXXALIAS_RPL (fmodl, long double, (long double x, long double y));
918# else
919# if !@HAVE_FMODL@
920# undef fmodl
921_GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
922# endif
923_GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
924# endif
925_GL_CXXALIASWARN (fmodl);
926#elif defined GNULIB_POSIXCHECK
927# undef fmodl
928# if HAVE_RAW_DECL_FMODL
929_GL_WARN_ON_USE (fmodl, "fmodl is unportable - "
930 "use gnulib module fmodl for portability");
931# endif
932#endif
933
35428fb6
LC
934
935/* Write x as
936 x = mantissa * 2^exp
937 where
938 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
939 If x is zero: mantissa = x, exp = 0.
940 If x is infinite or NaN: mantissa = x, exp unspecified.
941 Store exp in *EXPPTR and return mantissa. */
942#if @GNULIB_FREXPF@
943# if @REPLACE_FREXPF@
944# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
945# undef frexpf
946# define frexpf rpl_frexpf
947# endif
948_GL_FUNCDECL_RPL (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
949_GL_CXXALIAS_RPL (frexpf, float, (float x, int *expptr));
950# else
951# if !@HAVE_FREXPF@
952# undef frexpf
953_GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
954# endif
955_GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
956# endif
957_GL_CXXALIASWARN (frexpf);
958#elif defined GNULIB_POSIXCHECK
959# undef frexpf
960# if HAVE_RAW_DECL_FREXPF
961_GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
962 "use gnulib module frexpf for portability");
963# endif
964#endif
965
966/* Write x as
967 x = mantissa * 2^exp
968 where
969 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
970 If x is zero: mantissa = x, exp = 0.
971 If x is infinite or NaN: mantissa = x, exp unspecified.
972 Store exp in *EXPPTR and return mantissa. */
973#if @GNULIB_FREXP@
974# if @REPLACE_FREXP@
975# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
976# define frexp rpl_frexp
977# endif
978_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
979_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
980# else
981_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
982# endif
983_GL_CXXALIASWARN (frexp);
984#elif defined GNULIB_POSIXCHECK
985# undef frexp
986/* Assume frexp is always declared. */
987_GL_WARN_ON_USE (frexp, "frexp is unportable - "
988 "use gnulib module frexp for portability");
989#endif
990
2e65b52f
LC
991/* Write x as
992 x = mantissa * 2^exp
993 where
994 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
995 If x is zero: mantissa = x, exp = 0.
996 If x is infinite or NaN: mantissa = x, exp unspecified.
997 Store exp in *EXPPTR and return mantissa. */
998#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
999# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 1000# undef frexpl
2e65b52f
LC
1001# define frexpl rpl_frexpl
1002# endif
1003_GL_FUNCDECL_RPL (frexpl, long double,
1004 (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
1005_GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
1006#else
1007# if !@HAVE_DECL_FREXPL@
1008_GL_FUNCDECL_SYS (frexpl, long double,
1009 (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
1010# endif
1011# if @GNULIB_FREXPL@
1012_GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
1013# endif
1014#endif
1015#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
1016_GL_CXXALIASWARN (frexpl);
1017#endif
1018#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
1019# undef frexpl
1020# if HAVE_RAW_DECL_FREXPL
1021_GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
1022 "use gnulib module frexpl for portability");
1023# endif
1024#endif
1025
1026
005de2e8
LC
1027/* Return sqrt(x^2+y^2). */
1028#if @GNULIB_HYPOTF@
1029# if @REPLACE_HYPOTF@
1030# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1031# undef hypotf
1032# define hypotf rpl_hypotf
1033# endif
1034_GL_FUNCDECL_RPL (hypotf, float, (float x, float y));
1035_GL_CXXALIAS_RPL (hypotf, float, (float x, float y));
1036# else
1037# if !@HAVE_HYPOTF@
1038_GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
1039# endif
1040_GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
1041# endif
1042_GL_CXXALIASWARN (hypotf);
1043#elif defined GNULIB_POSIXCHECK
1044# undef hypotf
1045# if HAVE_RAW_DECL_HYPOTF
1046_GL_WARN_ON_USE (hypotf, "hypotf is unportable - "
1047 "use gnulib module hypotf for portability");
1048# endif
1049#endif
1050
1051/* Return sqrt(x^2+y^2). */
1052#if @GNULIB_HYPOT@
1053# if @REPLACE_HYPOT@
1054# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1055# undef hypot
1056# define hypot rpl_hypot
1057# endif
1058_GL_FUNCDECL_RPL (hypot, double, (double x, double y));
1059_GL_CXXALIAS_RPL (hypot, double, (double x, double y));
1060# else
1061_GL_CXXALIAS_SYS (hypot, double, (double x, double y));
1062# endif
1063_GL_CXXALIASWARN (hypot);
1064#elif defined GNULIB_POSIXCHECK
1065# undef hypot
1066# if HAVE_RAW_DECL_HYPOT
1067_GL_WARN_ON_USE (hypotf, "hypot has portability problems - "
1068 "use gnulib module hypot for portability");
1069# endif
1070#endif
1071
1072/* Return sqrt(x^2+y^2). */
1073#if @GNULIB_HYPOTL@
1074# if @REPLACE_HYPOTL@
1075# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1076# undef hypotl
1077# define hypotl rpl_hypotl
1078# endif
1079_GL_FUNCDECL_RPL (hypotl, long double, (long double x, long double y));
1080_GL_CXXALIAS_RPL (hypotl, long double, (long double x, long double y));
1081# else
1082# if !@HAVE_HYPOTL@
1083_GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
1084# endif
1085_GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
1086# endif
1087_GL_CXXALIASWARN (hypotl);
1088#elif defined GNULIB_POSIXCHECK
1089# undef hypotl
1090# if HAVE_RAW_DECL_HYPOTL
1091_GL_WARN_ON_USE (hypotl, "hypotl is unportable - "
1092 "use gnulib module hypotl for portability");
1093# endif
1094#endif
1095
1096
1097#if @GNULIB_ILOGBF@
1098# if @REPLACE_ILOGBF@
1099# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1100# undef ilogbf
1101# define ilogbf rpl_ilogbf
1102# endif
1103_GL_FUNCDECL_RPL (ilogbf, int, (float x));
1104_GL_CXXALIAS_RPL (ilogbf, int, (float x));
1105# else
1106# if !@HAVE_ILOGBF@
1107_GL_FUNCDECL_SYS (ilogbf, int, (float x));
1108# endif
1109_GL_CXXALIAS_SYS (ilogbf, int, (float x));
1110# endif
1111_GL_CXXALIASWARN (ilogbf);
1112#elif defined GNULIB_POSIXCHECK
1113# undef ilogbf
1114# if HAVE_RAW_DECL_ILOGBF
1115_GL_WARN_ON_USE (ilogbf, "ilogbf is unportable - "
1116 "use gnulib module ilogbf for portability");
1117# endif
1118#endif
1119
1120#if @GNULIB_ILOGB@
1121# if @REPLACE_ILOGB@
1122# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1123# undef ilogb
1124# define ilogb rpl_ilogb
1125# endif
1126_GL_FUNCDECL_RPL (ilogb, int, (double x));
1127_GL_CXXALIAS_RPL (ilogb, int, (double x));
1128# else
1129# if !@HAVE_ILOGB@
1130_GL_FUNCDECL_SYS (ilogb, int, (double x));
1131# endif
1132_GL_CXXALIAS_SYS (ilogb, int, (double x));
1133# endif
1134_GL_CXXALIASWARN (ilogb);
1135#elif defined GNULIB_POSIXCHECK
1136# undef ilogb
1137# if HAVE_RAW_DECL_ILOGB
1138_GL_WARN_ON_USE (ilogb, "ilogb is unportable - "
1139 "use gnulib module ilogb for portability");
1140# endif
1141#endif
1142
1143#if @GNULIB_ILOGBL@
1144# if !@HAVE_ILOGBL@
1145_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
1146# endif
1147_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
1148_GL_CXXALIASWARN (ilogbl);
1149#elif defined GNULIB_POSIXCHECK
1150# undef ilogbl
1151# if HAVE_RAW_DECL_ILOGBL
1152_GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
1153 "use gnulib module ilogbl for portability");
1154# endif
1155#endif
1156
1157
35428fb6
LC
1158/* Return x * 2^exp. */
1159#if @GNULIB_LDEXPF@
1160# if !@HAVE_LDEXPF@
1161# undef ldexpf
1162_GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
1163# endif
1164_GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
1165_GL_CXXALIASWARN (ldexpf);
1166#elif defined GNULIB_POSIXCHECK
1167# undef ldexpf
1168# if HAVE_RAW_DECL_LDEXPF
1169_GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - "
1170 "use gnulib module ldexpf for portability");
1171# endif
1172#endif
1173
2e65b52f
LC
1174/* Return x * 2^exp. */
1175#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
1176# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
35428fb6 1177# undef ldexpl
2e65b52f
LC
1178# define ldexpl rpl_ldexpl
1179# endif
1180_GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
1181_GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
1182#else
1183# if !@HAVE_DECL_LDEXPL@
1184_GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
1185# endif
1186# if @GNULIB_LDEXPL@
1187_GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
1188# endif
1189#endif
1190#if @GNULIB_LDEXPL@
1191_GL_CXXALIASWARN (ldexpl);
1192#endif
1193#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
1194# undef ldexpl
1195# if HAVE_RAW_DECL_LDEXPL
1196_GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
1197 "use gnulib module ldexpl for portability");
1198# endif
1199#endif
1200
1201
35428fb6 1202#if @GNULIB_LOGF@
005de2e8
LC
1203# if @REPLACE_LOGF@
1204# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1205# undef logf
1206# define logf rpl_logf
1207# endif
1208_GL_FUNCDECL_RPL (logf, float, (float x));
1209_GL_CXXALIAS_RPL (logf, float, (float x));
1210# else
1211# if !@HAVE_LOGF@
1212# undef logf
35428fb6 1213_GL_FUNCDECL_SYS (logf, float, (float x));
005de2e8 1214# endif
35428fb6 1215_GL_CXXALIAS_SYS (logf, float, (float x));
005de2e8 1216# endif
35428fb6
LC
1217_GL_CXXALIASWARN (logf);
1218#elif defined GNULIB_POSIXCHECK
1219# undef logf
1220# if HAVE_RAW_DECL_LOGF
1221_GL_WARN_ON_USE (logf, "logf is unportable - "
1222 "use gnulib module logf for portability");
1223# endif
1224#endif
1225
005de2e8
LC
1226#if @GNULIB_LOG@
1227# if @REPLACE_LOG@
1228# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1229# undef log
1230# define log rpl_log
1231# endif
1232_GL_FUNCDECL_RPL (log, double, (double x));
1233_GL_CXXALIAS_RPL (log, double, (double x));
1234# else
1235_GL_CXXALIAS_SYS (log, double, (double x));
1236# endif
1237_GL_CXXALIASWARN (log);
1238#elif defined GNULIB_POSIXCHECK
1239# undef log
1240# if HAVE_RAW_DECL_LOG
1241_GL_WARN_ON_USE (log, "log has portability problems - "
1242 "use gnulib module log for portability");
1243# endif
1244#endif
1245
2e65b52f 1246#if @GNULIB_LOGL@
005de2e8
LC
1247# if @REPLACE_LOGL@
1248# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1249# undef logl
1250# define logl rpl_logl
1251# endif
1252_GL_FUNCDECL_RPL (logl, long double, (long double x));
1253_GL_CXXALIAS_RPL (logl, long double, (long double x));
1254# else
1255# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
1256# undef logl
2e65b52f 1257_GL_FUNCDECL_SYS (logl, long double, (long double x));
005de2e8 1258# endif
2e65b52f 1259_GL_CXXALIAS_SYS (logl, long double, (long double x));
005de2e8 1260# endif
2e65b52f
LC
1261_GL_CXXALIASWARN (logl);
1262#elif defined GNULIB_POSIXCHECK
1263# undef logl
1264# if HAVE_RAW_DECL_LOGL
1265_GL_WARN_ON_USE (logl, "logl is unportable - "
005de2e8 1266 "use gnulib module logl for portability");
2e65b52f
LC
1267# endif
1268#endif
1269
1270
35428fb6 1271#if @GNULIB_LOG10F@
005de2e8
LC
1272# if @REPLACE_LOG10F@
1273# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1274# undef log10f
1275# define log10f rpl_log10f
1276# endif
1277_GL_FUNCDECL_RPL (log10f, float, (float x));
1278_GL_CXXALIAS_RPL (log10f, float, (float x));
1279# else
1280# if !@HAVE_LOG10F@
1281# undef log10f
35428fb6 1282_GL_FUNCDECL_SYS (log10f, float, (float x));
005de2e8 1283# endif
35428fb6 1284_GL_CXXALIAS_SYS (log10f, float, (float x));
005de2e8 1285# endif
35428fb6
LC
1286_GL_CXXALIASWARN (log10f);
1287#elif defined GNULIB_POSIXCHECK
1288# undef log10f
1289# if HAVE_RAW_DECL_LOG10F
1290_GL_WARN_ON_USE (log10f, "log10f is unportable - "
1291 "use gnulib module log10f for portability");
1292# endif
1293#endif
1294
005de2e8
LC
1295#if @GNULIB_LOG10@
1296# if @REPLACE_LOG10@
1297# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1298# undef log10
1299# define log10 rpl_log10
1300# endif
1301_GL_FUNCDECL_RPL (log10, double, (double x));
1302_GL_CXXALIAS_RPL (log10, double, (double x));
1303# else
1304_GL_CXXALIAS_SYS (log10, double, (double x));
1305# endif
1306_GL_CXXALIASWARN (log10);
1307#elif defined GNULIB_POSIXCHECK
1308# undef log10
1309# if HAVE_RAW_DECL_LOG10
1310_GL_WARN_ON_USE (log10, "log10 has portability problems - "
1311 "use gnulib module log10 for portability");
1312# endif
1313#endif
1314
1315#if @GNULIB_LOG10L@
1316# if @REPLACE_LOG10L@
1317# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1318# undef log10l
1319# define log10l rpl_log10l
1320# endif
1321_GL_FUNCDECL_RPL (log10l, long double, (long double x));
1322_GL_CXXALIAS_RPL (log10l, long double, (long double x));
1323# else
1324# if !@HAVE_LOG10L@ || !@HAVE_DECL_LOG10L@
1325# undef log10l
1326_GL_FUNCDECL_SYS (log10l, long double, (long double x));
1327# endif
1328_GL_CXXALIAS_SYS (log10l, long double, (long double x));
1329# endif
1330_GL_CXXALIASWARN (log10l);
1331#elif defined GNULIB_POSIXCHECK
1332# undef log10l
1333# if HAVE_RAW_DECL_LOG10L
1334_GL_WARN_ON_USE (log10l, "log10l is unportable - "
1335 "use gnulib module log10l for portability");
1336# endif
1337#endif
1338
1339
1340#if @GNULIB_LOG1PF@
1341# if @REPLACE_LOG1PF@
1342# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1343# undef log1pf
1344# define log1pf rpl_log1pf
1345# endif
1346_GL_FUNCDECL_RPL (log1pf, float, (float x));
1347_GL_CXXALIAS_RPL (log1pf, float, (float x));
1348# else
1349# if !@HAVE_LOG1PF@
1350_GL_FUNCDECL_SYS (log1pf, float, (float x));
1351# endif
1352_GL_CXXALIAS_SYS (log1pf, float, (float x));
1353# endif
1354_GL_CXXALIASWARN (log1pf);
1355#elif defined GNULIB_POSIXCHECK
1356# undef log1pf
1357# if HAVE_RAW_DECL_LOG1PF
1358_GL_WARN_ON_USE (log1pf, "log1pf is unportable - "
1359 "use gnulib module log1pf for portability");
1360# endif
1361#endif
1362
1363#if @GNULIB_LOG1P@
1364# if @REPLACE_LOG1P@
1365# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1366# undef log1p
1367# define log1p rpl_log1p
1368# endif
1369_GL_FUNCDECL_RPL (log1p, double, (double x));
1370_GL_CXXALIAS_RPL (log1p, double, (double x));
1371# else
1372# if !@HAVE_LOG1P@
1373_GL_FUNCDECL_SYS (log1p, double, (double x));
1374# endif
1375_GL_CXXALIAS_SYS (log1p, double, (double x));
1376# endif
1377_GL_CXXALIASWARN (log1p);
1378#elif defined GNULIB_POSIXCHECK
1379# undef log1p
1380# if HAVE_RAW_DECL_LOG1P
1381_GL_WARN_ON_USE (log1p, "log1p has portability problems - "
1382 "use gnulib module log1p for portability");
1383# endif
1384#endif
1385
1386#if @GNULIB_LOG1PL@
1387# if @REPLACE_LOG1PL@
1388# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1389# undef log1pl
1390# define log1pl rpl_log1pl
1391# endif
1392_GL_FUNCDECL_RPL (log1pl, long double, (long double x));
1393_GL_CXXALIAS_RPL (log1pl, long double, (long double x));
1394# else
1395# if !@HAVE_LOG1PL@
1396_GL_FUNCDECL_SYS (log1pl, long double, (long double x));
1397# endif
1398_GL_CXXALIAS_SYS (log1pl, long double, (long double x));
1399# endif
1400_GL_CXXALIASWARN (log1pl);
1401#elif defined GNULIB_POSIXCHECK
1402# undef log1pl
1403# if HAVE_RAW_DECL_LOG1PL
1404_GL_WARN_ON_USE (log1pl, "log1pl has portability problems - "
1405 "use gnulib module log1pl for portability");
1406# endif
1407#endif
1408
1409
1410#if @GNULIB_LOG2F@
1411# if @REPLACE_LOG2F@
1412# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1413# undef log2f
1414# define log2f rpl_log2f
1415# endif
1416_GL_FUNCDECL_RPL (log2f, float, (float x));
1417_GL_CXXALIAS_RPL (log2f, float, (float x));
1418# else
1419# if !@HAVE_DECL_LOG2F@
1420# undef log2f
1421_GL_FUNCDECL_SYS (log2f, float, (float x));
1422# endif
1423_GL_CXXALIAS_SYS (log2f, float, (float x));
1424# endif
1425_GL_CXXALIASWARN (log2f);
1426#elif defined GNULIB_POSIXCHECK
1427# undef log2f
1428# if HAVE_RAW_DECL_LOG2F
1429_GL_WARN_ON_USE (log2f, "log2f is unportable - "
1430 "use gnulib module log2f for portability");
1431# endif
1432#endif
1433
1434#if @GNULIB_LOG2@
1435# if @REPLACE_LOG2@
1436# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1437# undef log2
1438# define log2 rpl_log2
1439# endif
1440_GL_FUNCDECL_RPL (log2, double, (double x));
1441_GL_CXXALIAS_RPL (log2, double, (double x));
1442# else
1443# if !@HAVE_DECL_LOG2@
1444# undef log2
1445_GL_FUNCDECL_SYS (log2, double, (double x));
1446# endif
1447_GL_CXXALIAS_SYS (log2, double, (double x));
1448# endif
1449_GL_CXXALIASWARN (log2);
1450#elif defined GNULIB_POSIXCHECK
1451# undef log2
1452# if HAVE_RAW_DECL_LOG2
1453_GL_WARN_ON_USE (log2, "log2 is unportable - "
1454 "use gnulib module log2 for portability");
1455# endif
1456#endif
1457
1458#if @GNULIB_LOG2L@
1459# if @REPLACE_LOG2L@
1460# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1461# undef log2l
1462# define log2l rpl_log2l
1463# endif
1464_GL_FUNCDECL_RPL (log2l, long double, (long double x));
1465_GL_CXXALIAS_RPL (log2l, long double, (long double x));
1466# else
1467# if !@HAVE_DECL_LOG2L@
1468_GL_FUNCDECL_SYS (log2l, long double, (long double x));
1469# endif
1470_GL_CXXALIAS_SYS (log2l, long double, (long double x));
1471# endif
1472_GL_CXXALIASWARN (log2l);
1473#elif defined GNULIB_POSIXCHECK
1474# undef log2l
1475# if HAVE_RAW_DECL_LOG2L
1476_GL_WARN_ON_USE (log2l, "log2l is unportable - "
1477 "use gnulib module log2l for portability");
1478# endif
1479#endif
1480
1481
1482#if @GNULIB_LOGBF@
1483# if @REPLACE_LOGBF@
1484# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1485# undef logbf
1486# define logbf rpl_logbf
1487# endif
1488_GL_FUNCDECL_RPL (logbf, float, (float x));
1489_GL_CXXALIAS_RPL (logbf, float, (float x));
1490# else
1491# if !@HAVE_LOGBF@
1492_GL_FUNCDECL_SYS (logbf, float, (float x));
1493# endif
1494_GL_CXXALIAS_SYS (logbf, float, (float x));
1495# endif
1496_GL_CXXALIASWARN (logbf);
1497#elif defined GNULIB_POSIXCHECK
1498# undef logbf
1499# if HAVE_RAW_DECL_LOGBF
1500_GL_WARN_ON_USE (logbf, "logbf is unportable - "
1501 "use gnulib module logbf for portability");
1502# endif
1503#endif
1504
1505#if @GNULIB_LOGB@
1506# if @REPLACE_LOGB@
1507# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1508# undef logb
1509# define logb rpl_logb
1510# endif
1511_GL_FUNCDECL_RPL (logb, double, (double x));
1512_GL_CXXALIAS_RPL (logb, double, (double x));
1513# else
1514# if !@HAVE_DECL_LOGB@
1515_GL_FUNCDECL_SYS (logb, double, (double x));
1516# endif
1517_GL_CXXALIAS_SYS (logb, double, (double x));
1518# endif
1519_GL_CXXALIASWARN (logb);
1520#elif defined GNULIB_POSIXCHECK
1521# undef logb
1522# if HAVE_RAW_DECL_LOGB
1523_GL_WARN_ON_USE (logb, "logb is unportable - "
1524 "use gnulib module logb for portability");
1525# endif
1526#endif
1527
1528#if @GNULIB_LOGBL@
1529# if @REPLACE_LOGBL@
1530# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1531# undef logbl
1532# define logbl rpl_logbl
1533# endif
1534_GL_FUNCDECL_RPL (logbl, long double, (long double x));
1535_GL_CXXALIAS_RPL (logbl, long double, (long double x));
1536# else
1537# if !@HAVE_LOGBL@
1538_GL_FUNCDECL_SYS (logbl, long double, (long double x));
1539# endif
1540_GL_CXXALIAS_SYS (logbl, long double, (long double x));
1541# endif
1542_GL_CXXALIASWARN (logbl);
1543#elif defined GNULIB_POSIXCHECK
1544# undef logbl
1545# if HAVE_RAW_DECL_LOGBL
1546_GL_WARN_ON_USE (logbl, "logbl is unportable - "
1547 "use gnulib module logbl for portability");
1548# endif
1549#endif
1550
35428fb6
LC
1551
1552#if @GNULIB_MODFF@
005de2e8
LC
1553# if @REPLACE_MODFF@
1554# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1555# undef modff
1556# define modff rpl_modff
1557# endif
1558_GL_FUNCDECL_RPL (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
1559_GL_CXXALIAS_RPL (modff, float, (float x, float *iptr));
1560# else
1561# if !@HAVE_MODFF@
1562# undef modff
35428fb6 1563_GL_FUNCDECL_SYS (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
005de2e8 1564# endif
35428fb6 1565_GL_CXXALIAS_SYS (modff, float, (float x, float *iptr));
005de2e8 1566# endif
35428fb6
LC
1567_GL_CXXALIASWARN (modff);
1568#elif defined GNULIB_POSIXCHECK
1569# undef modff
1570# if HAVE_RAW_DECL_MODFF
1571_GL_WARN_ON_USE (modff, "modff is unportable - "
1572 "use gnulib module modff for portability");
1573# endif
1574#endif
1575
005de2e8
LC
1576#if @GNULIB_MODF@
1577# if @REPLACE_MODF@
1578# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1579# undef modf
1580# define modf rpl_modf
1581# endif
1582_GL_FUNCDECL_RPL (modf, double, (double x, double *iptr) _GL_ARG_NONNULL ((2)));
1583_GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
1584# else
1585_GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
1586# endif
1587_GL_CXXALIASWARN (modf);
1588#elif defined GNULIB_POSIXCHECK
1589# undef modf
1590# if HAVE_RAW_DECL_MODF
1591_GL_WARN_ON_USE (modf, "modf has portability problems - "
1592 "use gnulib module modf for portability");
1593# endif
1594#endif
1595
1596#if @GNULIB_MODFL@
1597# if @REPLACE_MODFL@
1598# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1599# undef modfl
1600# define modfl rpl_modfl
1601# endif
1602_GL_FUNCDECL_RPL (modfl, long double, (long double x, long double *iptr)
1603 _GL_ARG_NONNULL ((2)));
1604_GL_CXXALIAS_RPL (modfl, long double, (long double x, long double *iptr));
1605# else
1606# if !@HAVE_MODFL@
1607# undef modfl
1608_GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
1609 _GL_ARG_NONNULL ((2)));
1610# endif
1611_GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
1612# endif
1613_GL_CXXALIASWARN (modfl);
1614#elif defined GNULIB_POSIXCHECK
1615# undef modfl
1616# if HAVE_RAW_DECL_MODFL
1617_GL_WARN_ON_USE (modfl, "modfl is unportable - "
1618 "use gnulib module modfl for portability");
1619# endif
1620#endif
1621
35428fb6
LC
1622
1623#if @GNULIB_POWF@
1624# if !@HAVE_POWF@
1625# undef powf
1626_GL_FUNCDECL_SYS (powf, float, (float x, float y));
1627# endif
1628_GL_CXXALIAS_SYS (powf, float, (float x, float y));
1629_GL_CXXALIASWARN (powf);
1630#elif defined GNULIB_POSIXCHECK
1631# undef powf
1632# if HAVE_RAW_DECL_POWF
1633_GL_WARN_ON_USE (powf, "powf is unportable - "
1634 "use gnulib module powf for portability");
1635# endif
1636#endif
1637
1638
005de2e8
LC
1639#if @GNULIB_REMAINDERF@
1640# if @REPLACE_REMAINDERF@
1641# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1642# undef remainderf
1643# define remainderf rpl_remainderf
1644# endif
1645_GL_FUNCDECL_RPL (remainderf, float, (float x, float y));
1646_GL_CXXALIAS_RPL (remainderf, float, (float x, float y));
1647# else
1648# if !@HAVE_REMAINDERF@
1649_GL_FUNCDECL_SYS (remainderf, float, (float x, float y));
1650# endif
1651_GL_CXXALIAS_SYS (remainderf, float, (float x, float y));
1652# endif
1653_GL_CXXALIASWARN (remainderf);
1654#elif defined GNULIB_POSIXCHECK
1655# undef remainderf
1656# if HAVE_RAW_DECL_REMAINDERF
1657_GL_WARN_ON_USE (remainderf, "remainderf is unportable - "
1658 "use gnulib module remainderf for portability");
1659# endif
1660#endif
1661
1662#if @GNULIB_REMAINDER@
1663# if @REPLACE_REMAINDER@
1664# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1665# undef remainder
1666# define remainder rpl_remainder
1667# endif
1668_GL_FUNCDECL_RPL (remainder, double, (double x, double y));
1669_GL_CXXALIAS_RPL (remainder, double, (double x, double y));
1670# else
1671# if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@
1672_GL_FUNCDECL_SYS (remainder, double, (double x, double y));
1673# endif
1674_GL_CXXALIAS_SYS (remainder, double, (double x, double y));
1675# endif
1676_GL_CXXALIASWARN (remainder);
1677#elif defined GNULIB_POSIXCHECK
1678# undef remainder
1679# if HAVE_RAW_DECL_REMAINDER
1680_GL_WARN_ON_USE (remainder, "remainder is unportable - "
1681 "use gnulib module remainder for portability");
1682# endif
1683#endif
1684
1685#if @GNULIB_REMAINDERL@
1686# if @REPLACE_REMAINDERL@
1687# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1688# undef remainderl
1689# define remainderl rpl_remainderl
1690# endif
1691_GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y));
1692_GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y));
1693# else
1694# if !@HAVE_DECL_REMAINDERL@
1695# undef remainderl
1696_GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
1697# endif
1698_GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
1699# endif
1700_GL_CXXALIASWARN (remainderl);
1701#elif defined GNULIB_POSIXCHECK
1702# undef remainderl
1703# if HAVE_RAW_DECL_REMAINDERL
1704_GL_WARN_ON_USE (remainderl, "remainderl is unportable - "
1705 "use gnulib module remainderl for portability");
1706# endif
1707#endif
1708
1709
35428fb6 1710#if @GNULIB_RINTF@
005de2e8 1711# if !@HAVE_DECL_RINTF@
35428fb6
LC
1712_GL_FUNCDECL_SYS (rintf, float, (float x));
1713# endif
1714_GL_CXXALIAS_SYS (rintf, float, (float x));
1715_GL_CXXALIASWARN (rintf);
1716#elif defined GNULIB_POSIXCHECK
1717# undef rintf
1718# if HAVE_RAW_DECL_RINTF
1719_GL_WARN_ON_USE (rintf, "rintf is unportable - "
1720 "use gnulib module rintf for portability");
1721# endif
1722#endif
1723
1724#if @GNULIB_RINT@
1725# if !@HAVE_RINT@
1726_GL_FUNCDECL_SYS (rint, double, (double x));
1727# endif
1728_GL_CXXALIAS_SYS (rint, double, (double x));
1729_GL_CXXALIASWARN (rint);
1730#elif defined GNULIB_POSIXCHECK
1731# undef rint
1732# if HAVE_RAW_DECL_RINT
1733_GL_WARN_ON_USE (rint, "rint is unportable - "
1734 "use gnulib module rint for portability");
1735# endif
1736#endif
1737
1738#if @GNULIB_RINTL@
1739# if !@HAVE_RINTL@
1740_GL_FUNCDECL_SYS (rintl, long double, (long double x));
1741# endif
1742_GL_CXXALIAS_SYS (rintl, long double, (long double x));
1743_GL_CXXALIASWARN (rintl);
1744#elif defined GNULIB_POSIXCHECK
1745# undef rintl
1746# if HAVE_RAW_DECL_RINTL
1747_GL_WARN_ON_USE (rintl, "rintl is unportable - "
1748 "use gnulib module rintl for portability");
1749# endif
1750#endif
1751
1752
2e65b52f
LC
1753#if @GNULIB_ROUNDF@
1754# if @REPLACE_ROUNDF@
1755# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1756# undef roundf
1757# define roundf rpl_roundf
1758# endif
1759_GL_FUNCDECL_RPL (roundf, float, (float x));
1760_GL_CXXALIAS_RPL (roundf, float, (float x));
1761# else
1762# if !@HAVE_DECL_ROUNDF@
1763_GL_FUNCDECL_SYS (roundf, float, (float x));
1764# endif
1765_GL_CXXALIAS_SYS (roundf, float, (float x));
1766# endif
1767_GL_CXXALIASWARN (roundf);
1768#elif defined GNULIB_POSIXCHECK
1769# undef roundf
1770# if HAVE_RAW_DECL_ROUNDF
1771_GL_WARN_ON_USE (roundf, "roundf is unportable - "
1772 "use gnulib module roundf for portability");
1773# endif
1774#endif
1775
1776#if @GNULIB_ROUND@
1777# if @REPLACE_ROUND@
1778# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1779# undef round
1780# define round rpl_round
1781# endif
1782_GL_FUNCDECL_RPL (round, double, (double x));
1783_GL_CXXALIAS_RPL (round, double, (double x));
1784# else
1785# if !@HAVE_DECL_ROUND@
1786_GL_FUNCDECL_SYS (round, double, (double x));
1787# endif
1788_GL_CXXALIAS_SYS (round, double, (double x));
1789# endif
1790_GL_CXXALIASWARN (round);
1791#elif defined GNULIB_POSIXCHECK
1792# undef round
1793# if HAVE_RAW_DECL_ROUND
1794_GL_WARN_ON_USE (round, "round is unportable - "
1795 "use gnulib module round for portability");
1796# endif
1797#endif
1798
1799#if @GNULIB_ROUNDL@
1800# if @REPLACE_ROUNDL@
1801# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1802# undef roundl
1803# define roundl rpl_roundl
1804# endif
1805_GL_FUNCDECL_RPL (roundl, long double, (long double x));
1806_GL_CXXALIAS_RPL (roundl, long double, (long double x));
1807# else
1808# if !@HAVE_DECL_ROUNDL@
005de2e8 1809# undef roundl
2e65b52f
LC
1810_GL_FUNCDECL_SYS (roundl, long double, (long double x));
1811# endif
1812_GL_CXXALIAS_SYS (roundl, long double, (long double x));
1813# endif
1814_GL_CXXALIASWARN (roundl);
1815#elif defined GNULIB_POSIXCHECK
1816# undef roundl
1817# if HAVE_RAW_DECL_ROUNDL
1818_GL_WARN_ON_USE (roundl, "roundl is unportable - "
1819 "use gnulib module roundl for portability");
1820# endif
1821#endif
1822
1823
35428fb6
LC
1824#if @GNULIB_SINF@
1825# if !@HAVE_SINF@
1826# undef sinf
1827_GL_FUNCDECL_SYS (sinf, float, (float x));
1828# endif
1829_GL_CXXALIAS_SYS (sinf, float, (float x));
1830_GL_CXXALIASWARN (sinf);
1831#elif defined GNULIB_POSIXCHECK
1832# undef sinf
1833# if HAVE_RAW_DECL_SINF
1834_GL_WARN_ON_USE (sinf, "sinf is unportable - "
1835 "use gnulib module sinf for portability");
1836# endif
1837#endif
1838
2e65b52f
LC
1839#if @GNULIB_SINL@
1840# if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
005de2e8 1841# undef sinl
2e65b52f
LC
1842_GL_FUNCDECL_SYS (sinl, long double, (long double x));
1843# endif
1844_GL_CXXALIAS_SYS (sinl, long double, (long double x));
1845_GL_CXXALIASWARN (sinl);
1846#elif defined GNULIB_POSIXCHECK
1847# undef sinl
1848# if HAVE_RAW_DECL_SINL
1849_GL_WARN_ON_USE (sinl, "sinl is unportable - "
005de2e8 1850 "use gnulib module sinl for portability");
2e65b52f
LC
1851# endif
1852#endif
1853
1854
35428fb6
LC
1855#if @GNULIB_SINHF@
1856# if !@HAVE_SINHF@
1857# undef sinhf
1858_GL_FUNCDECL_SYS (sinhf, float, (float x));
1859# endif
1860_GL_CXXALIAS_SYS (sinhf, float, (float x));
1861_GL_CXXALIASWARN (sinhf);
1862#elif defined GNULIB_POSIXCHECK
1863# undef sinhf
1864# if HAVE_RAW_DECL_SINHF
1865_GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
1866 "use gnulib module sinhf for portability");
1867# endif
1868#endif
1869
1870
1871#if @GNULIB_SQRTF@
1872# if !@HAVE_SQRTF@
1873# undef sqrtf
1874_GL_FUNCDECL_SYS (sqrtf, float, (float x));
1875# endif
1876_GL_CXXALIAS_SYS (sqrtf, float, (float x));
1877_GL_CXXALIASWARN (sqrtf);
1878#elif defined GNULIB_POSIXCHECK
1879# undef sqrtf
1880# if HAVE_RAW_DECL_SQRTF
1881_GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - "
1882 "use gnulib module sqrtf for portability");
1883# endif
1884#endif
1885
2e65b52f 1886#if @GNULIB_SQRTL@
005de2e8
LC
1887# if @REPLACE_SQRTL@
1888# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1889# undef sqrtl
1890# define sqrtl rpl_sqrtl
1891# endif
1892_GL_FUNCDECL_RPL (sqrtl, long double, (long double x));
1893_GL_CXXALIAS_RPL (sqrtl, long double, (long double x));
1894# else
1895# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
1896# undef sqrtl
2e65b52f 1897_GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
005de2e8 1898# endif
2e65b52f 1899_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
005de2e8 1900# endif
2e65b52f
LC
1901_GL_CXXALIASWARN (sqrtl);
1902#elif defined GNULIB_POSIXCHECK
1903# undef sqrtl
1904# if HAVE_RAW_DECL_SQRTL
1905_GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
005de2e8 1906 "use gnulib module sqrtl for portability");
2e65b52f
LC
1907# endif
1908#endif
1909
1910
35428fb6
LC
1911#if @GNULIB_TANF@
1912# if !@HAVE_TANF@
1913# undef tanf
1914_GL_FUNCDECL_SYS (tanf, float, (float x));
1915# endif
1916_GL_CXXALIAS_SYS (tanf, float, (float x));
1917_GL_CXXALIASWARN (tanf);
1918#elif defined GNULIB_POSIXCHECK
1919# undef tanf
1920# if HAVE_RAW_DECL_TANF
1921_GL_WARN_ON_USE (tanf, "tanf is unportable - "
1922 "use gnulib module tanf for portability");
1923# endif
1924#endif
1925
2e65b52f
LC
1926#if @GNULIB_TANL@
1927# if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
005de2e8 1928# undef tanl
2e65b52f
LC
1929_GL_FUNCDECL_SYS (tanl, long double, (long double x));
1930# endif
1931_GL_CXXALIAS_SYS (tanl, long double, (long double x));
1932_GL_CXXALIASWARN (tanl);
1933#elif defined GNULIB_POSIXCHECK
1934# undef tanl
1935# if HAVE_RAW_DECL_TANL
1936_GL_WARN_ON_USE (tanl, "tanl is unportable - "
005de2e8 1937 "use gnulib module tanl for portability");
2e65b52f
LC
1938# endif
1939#endif
1940
1941
35428fb6
LC
1942#if @GNULIB_TANHF@
1943# if !@HAVE_TANHF@
1944# undef tanhf
1945_GL_FUNCDECL_SYS (tanhf, float, (float x));
1946# endif
1947_GL_CXXALIAS_SYS (tanhf, float, (float x));
1948_GL_CXXALIASWARN (tanhf);
1949#elif defined GNULIB_POSIXCHECK
1950# undef tanhf
1951# if HAVE_RAW_DECL_TANHF
1952_GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
1953 "use gnulib module tanhf for portability");
1954# endif
1955#endif
1956
1957
2e65b52f 1958#if @GNULIB_TRUNCF@
49114fd4
LC
1959# if @REPLACE_TRUNCF@
1960# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1961# define truncf rpl_truncf
1962# endif
1963_GL_FUNCDECL_RPL (truncf, float, (float x));
1964_GL_CXXALIAS_RPL (truncf, float, (float x));
1965# else
1966# if !@HAVE_DECL_TRUNCF@
2e65b52f 1967_GL_FUNCDECL_SYS (truncf, float, (float x));
49114fd4 1968# endif
2e65b52f 1969_GL_CXXALIAS_SYS (truncf, float, (float x));
49114fd4 1970# endif
2e65b52f
LC
1971_GL_CXXALIASWARN (truncf);
1972#elif defined GNULIB_POSIXCHECK
1973# undef truncf
1974# if HAVE_RAW_DECL_TRUNCF
1975_GL_WARN_ON_USE (truncf, "truncf is unportable - "
1976 "use gnulib module truncf for portability");
1977# endif
1978#endif
1979
1980#if @GNULIB_TRUNC@
49114fd4
LC
1981# if @REPLACE_TRUNC@
1982# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1983# define trunc rpl_trunc
1984# endif
1985_GL_FUNCDECL_RPL (trunc, double, (double x));
1986_GL_CXXALIAS_RPL (trunc, double, (double x));
1987# else
1988# if !@HAVE_DECL_TRUNC@
2e65b52f 1989_GL_FUNCDECL_SYS (trunc, double, (double x));
49114fd4 1990# endif
2e65b52f 1991_GL_CXXALIAS_SYS (trunc, double, (double x));
49114fd4 1992# endif
2e65b52f
LC
1993_GL_CXXALIASWARN (trunc);
1994#elif defined GNULIB_POSIXCHECK
1995# undef trunc
1996# if HAVE_RAW_DECL_TRUNC
1997_GL_WARN_ON_USE (trunc, "trunc is unportable - "
1998 "use gnulib module trunc for portability");
1999# endif
2000#endif
2001
2002#if @GNULIB_TRUNCL@
2003# if @REPLACE_TRUNCL@
2004# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2005# undef truncl
2006# define truncl rpl_truncl
2007# endif
2008_GL_FUNCDECL_RPL (truncl, long double, (long double x));
2009_GL_CXXALIAS_RPL (truncl, long double, (long double x));
2010# else
2011# if !@HAVE_DECL_TRUNCL@
2012_GL_FUNCDECL_SYS (truncl, long double, (long double x));
2013# endif
2014_GL_CXXALIAS_SYS (truncl, long double, (long double x));
2015# endif
2016_GL_CXXALIASWARN (truncl);
2017#elif defined GNULIB_POSIXCHECK
2018# undef truncl
2019# if HAVE_RAW_DECL_TRUNCL
2020_GL_WARN_ON_USE (truncl, "truncl is unportable - "
2021 "use gnulib module truncl for portability");
2022# endif
2023#endif
2024
2025
35428fb6
LC
2026/* Definitions of function-like macros come here, after the function
2027 declarations. */
2028
2029
2e65b52f
LC
2030#if @GNULIB_ISFINITE@
2031# if @REPLACE_ISFINITE@
2032_GL_EXTERN_C int gl_isfinitef (float x);
2033_GL_EXTERN_C int gl_isfinited (double x);
2034_GL_EXTERN_C int gl_isfinitel (long double x);
2035# undef isfinite
2036# define isfinite(x) \
2037 (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
2038 sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
2039 gl_isfinitef (x))
2040# endif
35428fb6
LC
2041# ifdef __cplusplus
2042# ifdef isfinite
2043_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
2044# undef isfinite
2045_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
2046# endif
2047# endif
2e65b52f
LC
2048#elif defined GNULIB_POSIXCHECK
2049# if defined isfinite
2050_GL_WARN_REAL_FLOATING_DECL (isfinite);
2051# undef isfinite
2052# define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
2053# endif
2054#endif
2055
2056
2057#if @GNULIB_ISINF@
2058# if @REPLACE_ISINF@
2059_GL_EXTERN_C int gl_isinff (float x);
2060_GL_EXTERN_C int gl_isinfd (double x);
2061_GL_EXTERN_C int gl_isinfl (long double x);
2062# undef isinf
2063# define isinf(x) \
2064 (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
2065 sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
2066 gl_isinff (x))
2067# endif
35428fb6
LC
2068# ifdef __cplusplus
2069# ifdef isinf
2070_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
2071# undef isinf
2072_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
2073# endif
2074# endif
2e65b52f
LC
2075#elif defined GNULIB_POSIXCHECK
2076# if defined isinf
2077_GL_WARN_REAL_FLOATING_DECL (isinf);
2078# undef isinf
2079# define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
2080# endif
2081#endif
2082
2083
2084#if @GNULIB_ISNANF@
2085/* Test for NaN for 'float' numbers. */
2086# if @HAVE_ISNANF@
2087/* The original <math.h> included above provides a declaration of isnan macro
2088 or (older) isnanf function. */
2089# if __GNUC__ >= 4
2090 /* GCC 4.0 and newer provides three built-ins for isnan. */
2091# undef isnanf
2092# define isnanf(x) __builtin_isnanf ((float)(x))
2093# elif defined isnan
2094# undef isnanf
2095# define isnanf(x) isnan ((float)(x))
2096# endif
2097# else
2098/* Test whether X is a NaN. */
2099# undef isnanf
2100# define isnanf rpl_isnanf
2101_GL_EXTERN_C int isnanf (float x);
2102# endif
2103#endif
2104
2105#if @GNULIB_ISNAND@
2106/* Test for NaN for 'double' numbers.
2107 This function is a gnulib extension, unlike isnan() which applied only
2108 to 'double' numbers earlier but now is a type-generic macro. */
2109# if @HAVE_ISNAND@
0f00f2c3
LC
2110/* The original <math.h> included above provides a declaration of isnan
2111 macro. */
2e65b52f
LC
2112# if __GNUC__ >= 4
2113 /* GCC 4.0 and newer provides three built-ins for isnan. */
2114# undef isnand
2115# define isnand(x) __builtin_isnan ((double)(x))
2116# else
2117# undef isnand
2118# define isnand(x) isnan ((double)(x))
2119# endif
2120# else
2121/* Test whether X is a NaN. */
2122# undef isnand
2123# define isnand rpl_isnand
2124_GL_EXTERN_C int isnand (double x);
2125# endif
2126#endif
2127
2128#if @GNULIB_ISNANL@
2129/* Test for NaN for 'long double' numbers. */
2130# if @HAVE_ISNANL@
0f00f2c3
LC
2131/* The original <math.h> included above provides a declaration of isnan
2132 macro or (older) isnanl function. */
2e65b52f
LC
2133# if __GNUC__ >= 4
2134 /* GCC 4.0 and newer provides three built-ins for isnan. */
2135# undef isnanl
2136# define isnanl(x) __builtin_isnanl ((long double)(x))
2137# elif defined isnan
2138# undef isnanl
2139# define isnanl(x) isnan ((long double)(x))
2140# endif
2141# else
2142/* Test whether X is a NaN. */
2143# undef isnanl
2144# define isnanl rpl_isnanl
7f1ea859 2145_GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
2e65b52f
LC
2146# endif
2147#endif
2148
2149/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */
2150#if @GNULIB_ISNAN@
2151# if @REPLACE_ISNAN@
2152/* We can't just use the isnanf macro (e.g.) as exposed by
2153 isnanf.h (e.g.) here, because those may end up being macros
2154 that recursively expand back to isnan. So use the gnulib
2155 replacements for them directly. */
2156# if @HAVE_ISNANF@ && __GNUC__ >= 4
49114fd4 2157# define gl_isnan_f(x) __builtin_isnanf ((float)(x))
2e65b52f
LC
2158# else
2159_GL_EXTERN_C int rpl_isnanf (float x);
2160# define gl_isnan_f(x) rpl_isnanf (x)
2161# endif
2162# if @HAVE_ISNAND@ && __GNUC__ >= 4
2163# define gl_isnan_d(x) __builtin_isnan ((double)(x))
2164# else
2165_GL_EXTERN_C int rpl_isnand (double x);
2166# define gl_isnan_d(x) rpl_isnand (x)
2167# endif
2168# if @HAVE_ISNANL@ && __GNUC__ >= 4
49114fd4 2169# define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
2e65b52f 2170# else
7f1ea859 2171_GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
2e65b52f
LC
2172# define gl_isnan_l(x) rpl_isnanl (x)
2173# endif
2174# undef isnan
2175# define isnan(x) \
2176 (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
2177 sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
2178 gl_isnan_f (x))
49114fd4
LC
2179# elif __GNUC__ >= 4
2180# undef isnan
2181# define isnan(x) \
2182 (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
2183 sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
2184 __builtin_isnanf ((float)(x)))
2e65b52f 2185# endif
35428fb6
LC
2186# ifdef __cplusplus
2187# ifdef isnan
2188_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
2189# undef isnan
2190_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
2191# endif
2192# else
ab4d62ad 2193/* Ensure isnan is a macro. */
35428fb6
LC
2194# ifndef isnan
2195# define isnan isnan
2196# endif
ab4d62ad 2197# endif
2e65b52f
LC
2198#elif defined GNULIB_POSIXCHECK
2199# if defined isnan
2200_GL_WARN_REAL_FLOATING_DECL (isnan);
2201# undef isnan
2202# define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
2203# endif
2204#endif
2205
2206
2207#if @GNULIB_SIGNBIT@
2208# if @REPLACE_SIGNBIT_USING_GCC@
2209# undef signbit
2210 /* GCC 4.0 and newer provides three built-ins for signbit. */
2211# define signbit(x) \
2212 (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
2213 sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
2214 __builtin_signbitf (x))
2215# endif
2216# if @REPLACE_SIGNBIT@
2217# undef signbit
2218_GL_EXTERN_C int gl_signbitf (float arg);
2219_GL_EXTERN_C int gl_signbitd (double arg);
2220_GL_EXTERN_C int gl_signbitl (long double arg);
35428fb6 2221# if __GNUC__ >= 2 && !defined __STRICT_ANSI__
0f00f2c3
LC
2222# define _GL_NUM_UINT_WORDS(type) \
2223 ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
2e65b52f
LC
2224# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
2225# define gl_signbitf_OPTIMIZED_MACRO
2226# define gl_signbitf(arg) \
2227 ({ union { float _value; \
0f00f2c3 2228 unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
2e65b52f
LC
2229 } _m; \
2230 _m._value = (arg); \
2231 (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
2232 })
2233# endif
2234# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
2235# define gl_signbitd_OPTIMIZED_MACRO
2236# define gl_signbitd(arg) \
0f00f2c3
LC
2237 ({ union { double _value; \
2238 unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
2e65b52f
LC
2239 } _m; \
2240 _m._value = (arg); \
2241 (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
2242 })
2243# endif
2244# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
2245# define gl_signbitl_OPTIMIZED_MACRO
2246# define gl_signbitl(arg) \
2247 ({ union { long double _value; \
0f00f2c3 2248 unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
2e65b52f
LC
2249 } _m; \
2250 _m._value = (arg); \
0f00f2c3 2251 (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
2e65b52f
LC
2252 })
2253# endif
2254# endif
2255# define signbit(x) \
2256 (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
2257 sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
2258 gl_signbitf (x))
2259# endif
35428fb6
LC
2260# ifdef __cplusplus
2261# ifdef signbit
2262_GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
2263# undef signbit
2264_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
2265# endif
2266# endif
2e65b52f
LC
2267#elif defined GNULIB_POSIXCHECK
2268# if defined signbit
2269_GL_WARN_REAL_FLOATING_DECL (signbit);
2270# undef signbit
2271# define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
2272# endif
2273#endif
2274
af07e104 2275_GL_INLINE_HEADER_END
2e65b52f 2276
3d458a81
AW
2277#endif /* _@GUARD_PREFIX@_MATH_H */
2278#endif /* _@GUARD_PREFIX@_MATH_H */