1 /* Declarations for SVID math error handling compatibility.
2 Copyright (C) 1991-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library 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 GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #ifndef _MATH_SVID_COMPAT_H
20 #define _MATH_SVID_COMPAT_H 1
22 /* Support for various different standard error handling behaviors. */
25 _IEEE_
= -1, /* According to IEEE 754/IEEE 854. */
26 _SVID_
, /* According to System V, release 4. */
27 _XOPEN_
, /* Nowadays also Unix98. */
29 _ISOC_
/* Actually this is ISO C99. */
32 /* This variable can be changed at run-time to any of the values above to
33 affect floating point error handling behavior (it may also be necessary
34 to change the hardware FPU exception settings). */
35 extern _LIB_VERSION_TYPE _LIB_VERSION
;
37 /* In SVID error handling, `matherr' is called with this description
38 of the exceptional condition. */
48 extern int matherr (struct exception
*__exc
);
49 extern int __matherr (struct exception
*__exc
);
51 #define X_TLOSS 1.41484755040568800000e+16
52 #define AS_FLOAT_CONSTANT_1(x) x##f
53 #define AS_FLOAT_CONSTANT(x) AS_FLOAT_CONSTANT_1(x)
55 /* Types of exceptions in the `type' field. */
63 /* SVID mode specifies returning this large value instead of infinity. */
64 #define HUGE 3.40282347e+38F
66 /* The above definitions may be used in testcases. The following code
67 is only used in the implementation. */
70 /* fdlibm kernel function */
71 extern double __kernel_standard (double, double, int);
72 extern float __kernel_standard_f (float, float, int);
73 extern long double __kernel_standard_l (long double, long double, int);
75 # include <shlib-compat.h>
76 # define LIBM_SVID_COMPAT SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
78 compat_symbol_reference (libm
, matherr
, matherr
, GLIBC_2_0
);
79 compat_symbol_reference (libm
, _LIB_VERSION
, _LIB_VERSION
, GLIBC_2_0
);
81 /* Except when building compat code, optimize out references to
82 _LIB_VERSION and matherr. */
83 # define _LIB_VERSION _POSIX_
84 # define matherr(EXC) ((void) (EXC), 0)
88 #endif /* math-svid-compat.h. */