1 /* Declarations for SVID math error handling compatibility.
2 Copyright (C) 1991-2018 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 <http://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
53 /* Types of exceptions in the `type' field. */
61 /* SVID mode specifies returning this large value instead of infinity. */
62 #define HUGE 3.40282347e+38F
64 /* The above definitions may be used in testcases. The following code
65 is only used in the implementation. */
68 /* fdlibm kernel function */
69 extern double __kernel_standard (double, double, int);
70 extern float __kernel_standard_f (float, float, int);
71 extern long double __kernel_standard_l (long double, long double, int);
73 # include <shlib-compat.h>
74 # define LIBM_SVID_COMPAT SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
76 compat_symbol_reference (libm
, matherr
, matherr
, GLIBC_2_0
);
77 compat_symbol_reference (libm
, _LIB_VERSION
, _LIB_VERSION
, GLIBC_2_0
);
79 /* Except when building compat code, optimize out references to
80 _LIB_VERSION and matherr. */
81 # define _LIB_VERSION _POSIX_
82 # define matherr(EXC) ((void) (EXC), 0)
86 #endif /* math-svid-compat.h. */