22 #pragma GCC system_header
27 #include_next <math.h>
33 #ifndef _GL_MATH_INLINE
34 # define _GL_MATH_INLINE _GL_INLINE
102 #if defined __cplusplus
103 # define _GL_EXTERN_C extern "C"
105 # define _GL_EXTERN_C extern
115 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
116 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
117 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
118 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
127 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
128 _GL_EXTERN_C rettype func parameters_and_attributes
136 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
137 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
138 #if defined __cplusplus && defined GNULIB_NAMESPACE
139 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
140 namespace GNULIB_NAMESPACE \
142 rettype (*const func) parameters = ::rpl_func; \
144 _GL_EXTERN_C int _gl_cxxalias_dummy
146 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
147 _GL_EXTERN_C int _gl_cxxalias_dummy
155 #if defined __cplusplus && defined GNULIB_NAMESPACE
156 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
157 namespace GNULIB_NAMESPACE \
159 rettype (*const func) parameters = \
160 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
162 _GL_EXTERN_C int _gl_cxxalias_dummy
164 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
165 _GL_EXTERN_C int _gl_cxxalias_dummy
175 #if defined __cplusplus && defined GNULIB_NAMESPACE
182 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
183 namespace GNULIB_NAMESPACE \
185 static rettype (*func) parameters = ::func; \
187 _GL_EXTERN_C int _gl_cxxalias_dummy
189 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
190 _GL_EXTERN_C int _gl_cxxalias_dummy
198 #if defined __cplusplus && defined GNULIB_NAMESPACE
199 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
200 namespace GNULIB_NAMESPACE \
202 static rettype (*func) parameters = \
203 reinterpret_cast<rettype(*)parameters>(::func); \
205 _GL_EXTERN_C int _gl_cxxalias_dummy
207 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
208 _GL_EXTERN_C int _gl_cxxalias_dummy
217 #if defined __cplusplus && defined GNULIB_NAMESPACE
223 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
224 namespace GNULIB_NAMESPACE \
226 static rettype (*func) parameters = \
227 reinterpret_cast<rettype(*)parameters>( \
228 (rettype2(*)parameters2)(::func)); \
230 _GL_EXTERN_C int _gl_cxxalias_dummy
232 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
233 _GL_EXTERN_C int _gl_cxxalias_dummy
240 #if defined __cplusplus && defined GNULIB_NAMESPACE
241 # define _GL_CXXALIASWARN(func) \
242 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
243 # define _GL_CXXALIASWARN_1(func,namespace) \
244 _GL_CXXALIASWARN_2 (func, namespace)
248 # define _GL_CXXALIASWARN_2(func,namespace) \
249 _GL_WARN_ON_USE (func, \
250 "The symbol ::" #func " refers to the system function. " \
251 "Use " #namespace "::" #func " instead.")
252 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
253 # define _GL_CXXALIASWARN_2(func,namespace) \
254 extern __typeof__ (func) func
256 # define _GL_CXXALIASWARN_2(func,namespace) \
257 _GL_EXTERN_C int _gl_cxxalias_dummy
260 # define _GL_CXXALIASWARN(func) \
261 _GL_EXTERN_C int _gl_cxxalias_dummy
267 #if defined __cplusplus && defined GNULIB_NAMESPACE
268 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
269 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
271 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
272 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
276 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
277 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
278 "The symbol ::" #func " refers to the system function. " \
279 "Use " #namespace "::" #func " instead.")
280 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
281 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
282 extern __typeof__ (func) func
284 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
285 _GL_EXTERN_C int _gl_cxxalias_dummy
288 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
289 _GL_EXTERN_C int _gl_cxxalias_dummy
298 #ifndef _GL_ARG_NONNULL
299 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
300 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
302 # define _GL_ARG_NONNULL(params)
307 #ifndef _GL_WARN_ON_USE
309 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
311 # define _GL_WARN_ON_USE(function, message) \
312 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
313 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
315 # define _GL_WARN_ON_USE(function, message) \
316 extern __typeof__ (function) function
318 # define _GL_WARN_ON_USE(function, message) \
319 _GL_WARN_EXTERN_C int _gl_warn_on_use
329 #ifndef _GL_WARN_ON_USE_CXX
330 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
331 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
332 extern rettype function parameters_and_attributes \
333 __attribute__ ((__warning__ (msg)))
334 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
336 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
337 extern rettype function parameters_and_attributes
339 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
340 _GL_WARN_EXTERN_C int _gl_warn_on_use
346 #ifndef _GL_WARN_EXTERN_C
347 # if defined __cplusplus
348 # define _GL_WARN_EXTERN_C extern "C"
350 # define _GL_WARN_EXTERN_C extern
358 # define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
360 _gl_cxx_ ## func ## f (float f) \
365 _gl_cxx_ ## func ## d (double d) \
370 _gl_cxx_ ## func ## l (long double l) \
374 # define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
378 return _gl_cxx_ ## func ## f (f); \
383 return _gl_cxx_ ## func ## d (d); \
386 func (long double l) \
388 return _gl_cxx_ ## func ## l (l); \
396 #define _GL_WARN_REAL_FLOATING_DECL(func) \
397 _GL_MATH_INLINE int \
398 rpl_ ## func ## f (float f) \
402 _GL_MATH_INLINE int \
403 rpl_ ## func ## d (double d) \
407 _GL_MATH_INLINE int \
408 rpl_ ## func ## l (long double l) \
412 _GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - " \
413 "use gnulib module " #func " for portability"); \
414 _GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - " \
415 "use gnulib module " #func " for portability"); \
416 _GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - " \
417 "use gnulib module " #func " for portability")
418 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
419 (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
420 : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
421 : rpl_ ## func ## l (value))
428 static void (*_gl_math_fix_itold) (
long double *, int) = _Qp_itoq;
437 #if !defined NAN || 0
438 # if !GNULIB_defined_NAN
442 # if defined __DECC || defined _MSC_VER
446 static float zero = 0.0f;
449 # define NAN (_NaN())
451 # define NAN (0.0f / 0.0f)
453 # define GNULIB_defined_NAN 1
461 # define HUGE_VALF (1.0f / 0.0f)
463 # define HUGE_VAL (1.0 / 0.0)
465 # define HUGE_VALL (1.0L / 0.0L)
470 # if defined _MSC_VER
472 # define HUGE_VALF (1e25f * 1e25f)
474 # define HUGE_VALF (1.0f / 0.0f)
480 # if defined _MSC_VER
482 # define HUGE_VAL (1e250 * 1e250)
484 # define HUGE_VAL (1.0 / 0.0)
490 # if defined _MSC_VER
492 # define HUGE_VALL (1e250L * 1e250L)
494 # define HUGE_VALL (1.0L / 0.0L)
500 #if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
501 # if defined __NetBSD__ || defined __sgi
503 # define FP_ILOGB0 (- 2147483647 - 1)
504 # define FP_ILOGBNAN (- 2147483647 - 1)
507 # define FP_ILOGB0 (- 2147483647 - 1)
508 # define FP_ILOGBNAN 2147483647
511 # define FP_ILOGB0 (- 2147483647)
512 # define FP_ILOGBNAN 2147483647
515 # define FP_ILOGB0 (- 2147483647)
516 # define FP_ILOGBNAN (- 2147483647 - 1)
528 #elif defined GNULIB_POSIXCHECK
530 # if HAVE_RAW_DECL_ACOSF
532 "use gnulib module acosf for portability");
543 #elif defined GNULIB_POSIXCHECK
545 # if HAVE_RAW_DECL_ACOSL
547 "use gnulib module acosl for portability");
559 #elif defined GNULIB_POSIXCHECK
561 # if HAVE_RAW_DECL_ASINF
563 "use gnulib module asinf for portability");
574 #elif defined GNULIB_POSIXCHECK
576 # if HAVE_RAW_DECL_ASINL
578 "use gnulib module asinl for portability");
590 #elif defined GNULIB_POSIXCHECK
592 # if HAVE_RAW_DECL_ATANF
594 "use gnulib module atanf for portability");
605 #elif defined GNULIB_POSIXCHECK
607 # if HAVE_RAW_DECL_ATANL
609 "use gnulib module atanl for portability");
621 #elif defined GNULIB_POSIXCHECK
623 # if HAVE_RAW_DECL_ATAN2F
625 "use gnulib module atan2f for portability");
632 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
634 # define cbrtf rpl_cbrtf
645 #elif defined GNULIB_POSIXCHECK
647 # if HAVE_RAW_DECL_CBRTF
649 "use gnulib module cbrtf for portability");
659 #elif defined GNULIB_POSIXCHECK
661 # if HAVE_RAW_DECL_CBRT
663 "use gnulib module cbrt for portability");
669 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
671 # define cbrtl rpl_cbrtl
682 #elif defined GNULIB_POSIXCHECK
684 # if HAVE_RAW_DECL_CBRTL
686 "use gnulib module cbrtl for portability");
693 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
695 # define ceilf rpl_ceilf
707 #elif defined GNULIB_POSIXCHECK
709 # if HAVE_RAW_DECL_CEILF
711 "use gnulib module ceilf for portability");
717 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
718 # define ceil rpl_ceil
730 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
732 # define ceill rpl_ceill
744 #elif defined GNULIB_POSIXCHECK
746 # if HAVE_RAW_DECL_CEILL
748 "use gnulib module ceill for portability");
759 #elif defined GNULIB_POSIXCHECK
761 # if HAVE_RAW_DECL_COPYSIGNF
763 "use gnulib module copysignf for portability");
773 #elif defined GNULIB_POSIXCHECK
775 # if HAVE_RAW_DECL_COPYSIGN
777 "use gnulib module copysign for portability");
787 #elif defined GNULIB_POSIXCHECK
789 # if HAVE_RAW_DECL_COPYSIGNL
791 "use gnulib module copysignl for portability");
803 #elif defined GNULIB_POSIXCHECK
805 # if HAVE_RAW_DECL_COSF
807 "use gnulib module cosf for portability");
818 #elif defined GNULIB_POSIXCHECK
820 # if HAVE_RAW_DECL_COSL
822 "use gnulib module cosl for portability");
834 #elif defined GNULIB_POSIXCHECK
836 # if HAVE_RAW_DECL_COSHF
838 "use gnulib module coshf for portability");
850 #elif defined GNULIB_POSIXCHECK
852 # if HAVE_RAW_DECL_EXPF
854 "use gnulib module expf for portability");
865 #elif defined GNULIB_POSIXCHECK
867 # if HAVE_RAW_DECL_EXPL
869 "use gnulib module expl for portability");
880 #elif defined GNULIB_POSIXCHECK
882 # if HAVE_RAW_DECL_EXP2F
884 "use gnulib module exp2f for portability");
890 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
892 # define exp2 rpl_exp2
903 #elif defined GNULIB_POSIXCHECK
905 # if HAVE_RAW_DECL_EXP2
907 "use gnulib module exp2 for portability");
913 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
915 # define exp2l rpl_exp2l
927 #elif defined GNULIB_POSIXCHECK
929 # if HAVE_RAW_DECL_EXP2L
931 "use gnulib module exp2l for portability");
938 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
940 # define expm1f rpl_expm1f
951 #elif defined GNULIB_POSIXCHECK
953 # if HAVE_RAW_DECL_EXPM1F
955 "use gnulib module expm1f for portability");
961 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
963 # define expm1 rpl_expm1
974 #elif defined GNULIB_POSIXCHECK
976 # if HAVE_RAW_DECL_EXPM1
978 "use gnulib module expm1 for portability");
989 #elif defined GNULIB_POSIXCHECK
991 # if HAVE_RAW_DECL_EXPM1L
993 "use gnulib module expm1l for portability");
1005 #elif defined GNULIB_POSIXCHECK
1007 # if HAVE_RAW_DECL_FABSF
1009 "use gnulib module fabsf for portability");
1015 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1017 # define fabsl rpl_fabsl
1029 #elif defined GNULIB_POSIXCHECK
1031 # if HAVE_RAW_DECL_FABSL
1033 "use gnulib module fabsl for portability");
1040 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1042 # define floorf rpl_floorf
1054 #elif defined GNULIB_POSIXCHECK
1056 # if HAVE_RAW_DECL_FLOORF
1058 "use gnulib module floorf for portability");
1064 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1065 # define floor rpl_floor
1077 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1079 # define floorl rpl_floorl
1091 #elif defined GNULIB_POSIXCHECK
1093 # if HAVE_RAW_DECL_FLOORL
1095 "use gnulib module floorl for portability");
1102 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1104 # define fmaf rpl_fmaf
1115 #elif defined GNULIB_POSIXCHECK
1117 # if HAVE_RAW_DECL_FMAF
1119 "use gnulib module fmaf for portability");
1125 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1127 # define fma rpl_fma
1138 #elif defined GNULIB_POSIXCHECK
1140 # if HAVE_RAW_DECL_FMA
1142 "use gnulib module fma for portability");
1148 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1150 # define fmal rpl_fmal
1153 (
long double x,
long double y,
long double z));
1155 (
long double x,
long double y,
long double z));
1160 (
long double x,
long double y,
long double z));
1163 (
long double x,
long double y,
long double z));
1166 #elif defined GNULIB_POSIXCHECK
1168 # if HAVE_RAW_DECL_FMAL
1170 "use gnulib module fmal for portability");
1177 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1179 # define fmodf rpl_fmodf
1191 #elif defined GNULIB_POSIXCHECK
1193 # if HAVE_RAW_DECL_FMODF
1195 "use gnulib module fmodf for portability");
1201 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1203 # define fmod rpl_fmod
1211 #elif defined GNULIB_POSIXCHECK
1213 # if HAVE_RAW_DECL_FMOD
1215 "use gnulib module fmod for portability");
1221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1223 # define fmodl rpl_fmodl
1235 #elif defined GNULIB_POSIXCHECK
1237 # if HAVE_RAW_DECL_FMODL
1239 "use gnulib module fmodl for portability");
1253 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1255 # define frexpf rpl_frexpf
1267 #elif defined GNULIB_POSIXCHECK
1269 # if HAVE_RAW_DECL_FREXPF
1271 "use gnulib module frexpf for portability");
1284 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1285 # define frexp rpl_frexp
1293 #elif defined GNULIB_POSIXCHECK
1297 "use gnulib module frexp for portability");
1308 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1310 # define frexpl rpl_frexpl
1327 #if !1 && defined GNULIB_POSIXCHECK
1329 # if HAVE_RAW_DECL_FREXPL
1331 "use gnulib module frexpl for portability");
1339 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1341 # define hypotf rpl_hypotf
1352 #elif defined GNULIB_POSIXCHECK
1354 # if HAVE_RAW_DECL_HYPOTF
1356 "use gnulib module hypotf for portability");
1363 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1365 # define hypot rpl_hypot
1373 #elif defined GNULIB_POSIXCHECK
1375 # if HAVE_RAW_DECL_HYPOT
1377 "use gnulib module hypot for portability");
1384 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1386 # define hypotl rpl_hypotl
1397 #elif defined GNULIB_POSIXCHECK
1399 # if HAVE_RAW_DECL_HYPOTL
1401 "use gnulib module hypotl for portability");
1408 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1410 # define ilogbf rpl_ilogbf
1421 #elif defined GNULIB_POSIXCHECK
1423 # if HAVE_RAW_DECL_ILOGBF
1425 "use gnulib module ilogbf for portability");
1431 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1433 # define ilogb rpl_ilogb
1444 #elif defined GNULIB_POSIXCHECK
1446 # if HAVE_RAW_DECL_ILOGB
1448 "use gnulib module ilogb for portability");
1458 #elif defined GNULIB_POSIXCHECK
1460 # if HAVE_RAW_DECL_ILOGBL
1462 "use gnulib module ilogbl for portability");
1475 #elif defined GNULIB_POSIXCHECK
1477 # if HAVE_RAW_DECL_LDEXPF
1479 "use gnulib module ldexpf for portability");
1485 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1487 # define ldexpl rpl_ldexpl
1502 #if !0 && defined GNULIB_POSIXCHECK
1504 # if HAVE_RAW_DECL_LDEXPL
1506 "use gnulib module ldexpl for portability");
1513 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1515 # define logf rpl_logf
1527 #elif defined GNULIB_POSIXCHECK
1529 # if HAVE_RAW_DECL_LOGF
1531 "use gnulib module logf for portability");
1537 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1539 # define log rpl_log
1547 #elif defined GNULIB_POSIXCHECK
1549 # if HAVE_RAW_DECL_LOG
1551 "use gnulib module log for portability");
1557 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1559 # define logl rpl_logl
1571 #elif defined GNULIB_POSIXCHECK
1573 # if HAVE_RAW_DECL_LOGL
1575 "use gnulib module logl for portability");
1582 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1584 # define log10f rpl_log10f
1596 #elif defined GNULIB_POSIXCHECK
1598 # if HAVE_RAW_DECL_LOG10F
1600 "use gnulib module log10f for portability");
1606 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1608 # define log10 rpl_log10
1616 #elif defined GNULIB_POSIXCHECK
1618 # if HAVE_RAW_DECL_LOG10
1620 "use gnulib module log10 for portability");
1626 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1628 # define log10l rpl_log10l
1640 #elif defined GNULIB_POSIXCHECK
1642 # if HAVE_RAW_DECL_LOG10L
1644 "use gnulib module log10l for portability");
1651 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1653 # define log1pf rpl_log1pf
1664 #elif defined GNULIB_POSIXCHECK
1666 # if HAVE_RAW_DECL_LOG1PF
1668 "use gnulib module log1pf for portability");
1674 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1676 # define log1p rpl_log1p
1687 #elif defined GNULIB_POSIXCHECK
1689 # if HAVE_RAW_DECL_LOG1P
1691 "use gnulib module log1p for portability");
1697 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1699 # define log1pl rpl_log1pl
1710 #elif defined GNULIB_POSIXCHECK
1712 # if HAVE_RAW_DECL_LOG1PL
1714 "use gnulib module log1pl for portability");
1721 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1723 # define log2f rpl_log2f
1735 #elif defined GNULIB_POSIXCHECK
1737 # if HAVE_RAW_DECL_LOG2F
1739 "use gnulib module log2f for portability");
1745 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1747 # define log2 rpl_log2
1759 #elif defined GNULIB_POSIXCHECK
1761 # if HAVE_RAW_DECL_LOG2
1763 "use gnulib module log2 for portability");
1769 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1771 # define log2l rpl_log2l
1782 #elif defined GNULIB_POSIXCHECK
1784 # if HAVE_RAW_DECL_LOG2L
1786 "use gnulib module log2l for portability");
1793 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1795 # define logbf rpl_logbf
1806 #elif defined GNULIB_POSIXCHECK
1808 # if HAVE_RAW_DECL_LOGBF
1810 "use gnulib module logbf for portability");
1816 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1818 # define logb rpl_logb
1829 #elif defined GNULIB_POSIXCHECK
1831 # if HAVE_RAW_DECL_LOGB
1833 "use gnulib module logb for portability");
1839 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1841 # define logbl rpl_logbl
1852 #elif defined GNULIB_POSIXCHECK
1854 # if HAVE_RAW_DECL_LOGBL
1856 "use gnulib module logbl for portability");
1863 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1865 # define modff rpl_modff
1877 #elif defined GNULIB_POSIXCHECK
1879 # if HAVE_RAW_DECL_MODFF
1881 "use gnulib module modff for portability");
1887 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1889 # define modf rpl_modf
1897 #elif defined GNULIB_POSIXCHECK
1899 # if HAVE_RAW_DECL_MODF
1901 "use gnulib module modf for portability");
1907 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1909 # define modfl rpl_modfl
1923 #elif defined GNULIB_POSIXCHECK
1925 # if HAVE_RAW_DECL_MODFL
1927 "use gnulib module modfl for portability");
1939 #elif defined GNULIB_POSIXCHECK
1941 # if HAVE_RAW_DECL_POWF
1943 "use gnulib module powf for portability");
1950 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1952 # define remainderf rpl_remainderf
1963 #elif defined GNULIB_POSIXCHECK
1965 # if HAVE_RAW_DECL_REMAINDERF
1967 "use gnulib module remainderf for portability");
1973 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1975 # define remainder rpl_remainder
1986 #elif defined GNULIB_POSIXCHECK
1988 # if HAVE_RAW_DECL_REMAINDER
1990 "use gnulib module remainder for portability");
1996 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1998 # define remainderl rpl_remainderl
2000 _GL_FUNCDECL_RPL (remainderl,
long double, (
long double x,
long double y));
2001 _GL_CXXALIAS_RPL (remainderl,
long double, (
long double x,
long double y));
2005 _GL_FUNCDECL_SYS (remainderl,
long double, (
long double x,
long double y));
2007 _GL_CXXALIAS_SYS (remainderl,
long double, (
long double x,
long double y));
2010 #elif defined GNULIB_POSIXCHECK
2012 # if HAVE_RAW_DECL_REMAINDERL
2014 "use gnulib module remainderl for portability");
2025 #elif defined GNULIB_POSIXCHECK
2027 # if HAVE_RAW_DECL_RINTF
2029 "use gnulib module rintf for portability");
2039 #elif defined GNULIB_POSIXCHECK
2041 # if HAVE_RAW_DECL_RINT
2043 "use gnulib module rint for portability");
2053 #elif defined GNULIB_POSIXCHECK
2055 # if HAVE_RAW_DECL_RINTL
2057 "use gnulib module rintl for portability");
2064 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2066 # define roundf rpl_roundf
2077 #elif defined GNULIB_POSIXCHECK
2079 # if HAVE_RAW_DECL_ROUNDF
2081 "use gnulib module roundf for portability");
2087 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2089 # define round rpl_round
2100 #elif defined GNULIB_POSIXCHECK
2102 # if HAVE_RAW_DECL_ROUND
2104 "use gnulib module round for portability");
2110 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2112 # define roundl rpl_roundl
2124 #elif defined GNULIB_POSIXCHECK
2126 # if HAVE_RAW_DECL_ROUNDL
2128 "use gnulib module roundl for portability");
2140 #elif defined GNULIB_POSIXCHECK
2142 # if HAVE_RAW_DECL_SINF
2144 "use gnulib module sinf for portability");
2155 #elif defined GNULIB_POSIXCHECK
2157 # if HAVE_RAW_DECL_SINL
2159 "use gnulib module sinl for portability");
2171 #elif defined GNULIB_POSIXCHECK
2173 # if HAVE_RAW_DECL_SINHF
2175 "use gnulib module sinhf for portability");
2187 #elif defined GNULIB_POSIXCHECK
2189 # if HAVE_RAW_DECL_SQRTF
2191 "use gnulib module sqrtf for portability");
2197 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2199 # define sqrtl rpl_sqrtl
2211 #elif defined GNULIB_POSIXCHECK
2213 # if HAVE_RAW_DECL_SQRTL
2215 "use gnulib module sqrtl for portability");
2227 #elif defined GNULIB_POSIXCHECK
2229 # if HAVE_RAW_DECL_TANF
2231 "use gnulib module tanf for portability");
2242 #elif defined GNULIB_POSIXCHECK
2244 # if HAVE_RAW_DECL_TANL
2246 "use gnulib module tanl for portability");
2258 #elif defined GNULIB_POSIXCHECK
2260 # if HAVE_RAW_DECL_TANHF
2262 "use gnulib module tanhf for portability");
2269 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2270 # define truncf rpl_truncf
2281 #elif defined GNULIB_POSIXCHECK
2283 # if HAVE_RAW_DECL_TRUNCF
2285 "use gnulib module truncf for portability");
2291 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2292 # define trunc rpl_trunc
2303 #elif defined GNULIB_POSIXCHECK
2305 # if HAVE_RAW_DECL_TRUNC
2307 "use gnulib module trunc for portability");
2313 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2315 # define truncl rpl_truncl
2326 #elif defined GNULIB_POSIXCHECK
2328 # if HAVE_RAW_DECL_TRUNCL
2330 "use gnulib module truncl for portability");
2345 # define isfinite(x) \
2346 (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
2347 sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
2352 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
2354 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
2357 #elif defined GNULIB_POSIXCHECK
2358 # if defined isfinite
2361 # define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
2373 (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
2374 sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
2379 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
2381 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
2384 #elif defined GNULIB_POSIXCHECK
2388 # define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
2401 # define isnanf(x) __builtin_isnanf ((float)(x))
2402 # elif defined isnan
2404 # define isnanf(x) isnan ((float)(x))
2409 # define isnanf rpl_isnanf
2424 # define isnand(x) __builtin_isnan ((double)(x))
2427 # define isnand(x) isnan ((double)(x))
2432 # define isnand rpl_isnand
2445 # define isnanl(x) __builtin_isnanl ((long double)(x))
2446 # elif defined isnan
2448 # define isnanl(x) isnan ((long double)(x))
2453 # define isnanl rpl_isnanl
2465 # if 1 && __GNUC__ >= 4
2466 # define gl_isnan_f(x) __builtin_isnanf ((float)(x))
2469 # define gl_isnan_f(x) rpl_isnanf (x)
2471 # if 1 && __GNUC__ >= 4
2472 # define gl_isnan_d(x) __builtin_isnan ((double)(x))
2475 # define gl_isnan_d(x) rpl_isnand (x)
2477 # if 1 && __GNUC__ >= 4
2478 # define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
2481 # define gl_isnan_l(x) rpl_isnanl (x)
2485 (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
2486 sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
2488 # elif __GNUC__ >= 4
2491 (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
2492 sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
2493 __builtin_isnanf ((float)(x)))
2497 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
2499 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
2504 # define isnan isnan
2507 #elif defined GNULIB_POSIXCHECK
2511 # define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
2520 # define signbit(x) \
2521 (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
2522 sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
2523 __builtin_signbitf (x))
2530 # if __GNUC__ >= 2 && !defined __STRICT_ANSI__
2531 # define _GL_NUM_UINT_WORDS(type) \
2532 ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
2533 # if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
2534 # define gl_signbitf_OPTIMIZED_MACRO
2535 # define gl_signbitf(arg) \
2536 ({ union { float _value; \
2537 unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
2539 _m._value = (arg); \
2540 (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
2543 # if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
2544 # define gl_signbitd_OPTIMIZED_MACRO
2545 # define gl_signbitd(arg) \
2546 ({ union { double _value; \
2547 unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
2549 _m._value = (arg); \
2550 (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
2553 # if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
2554 # define gl_signbitl_OPTIMIZED_MACRO
2555 # define gl_signbitl(arg) \
2556 ({ union { long double _value; \
2557 unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
2559 _m._value = (arg); \
2560 (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
2564 # define signbit(x) \
2565 (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
2566 sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
2571 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
2573 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
2576 #elif defined GNULIB_POSIXCHECK
2577 # if defined signbit
2580 # define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
#define _GL_ARG_NONNULL(params)
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
#define _GL_ATTRIBUTE_CONST
#define _GL_CXXALIASWARN(func)
#define _GL_WARN_REAL_FLOATING_DECL(func)
#define _GL_WARN_ON_USE(function, message)
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
#define _GL_INLINE_HEADER_END
#define _GL_INLINE_HEADER_BEGIN
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)