Blame math/math-svid-compat.h

Packit 6c4009
/* Declarations for SVID math error handling compatibility.
Packit 6c4009
   Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef	_MATH_SVID_COMPAT_H
Packit 6c4009
#define	_MATH_SVID_COMPAT_H	1
Packit 6c4009
Packit 6c4009
/* Support for various different standard error handling behaviors.  */
Packit 6c4009
typedef enum
Packit 6c4009
{
Packit 6c4009
  _IEEE_ = -1,	/* According to IEEE 754/IEEE 854.  */
Packit 6c4009
  _SVID_,	/* According to System V, release 4.  */
Packit 6c4009
  _XOPEN_,	/* Nowadays also Unix98.  */
Packit 6c4009
  _POSIX_,
Packit 6c4009
  _ISOC_	/* Actually this is ISO C99.  */
Packit 6c4009
} _LIB_VERSION_TYPE;
Packit 6c4009
Packit 6c4009
/* This variable can be changed at run-time to any of the values above to
Packit 6c4009
   affect floating point error handling behavior (it may also be necessary
Packit 6c4009
   to change the hardware FPU exception settings).  */
Packit 6c4009
extern _LIB_VERSION_TYPE _LIB_VERSION;
Packit 6c4009
Packit 6c4009
/* In SVID error handling, `matherr' is called with this description
Packit 6c4009
   of the exceptional condition.  */
Packit 6c4009
struct exception
Packit 6c4009
  {
Packit 6c4009
    int type;
Packit 6c4009
    char *name;
Packit 6c4009
    double arg1;
Packit 6c4009
    double arg2;
Packit 6c4009
    double retval;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
extern int matherr (struct exception *__exc);
Packit 6c4009
extern int __matherr (struct exception *__exc);
Packit 6c4009
Packit 6c4009
#define X_TLOSS	1.41484755040568800000e+16
Packit 6c4009
Packit 6c4009
/* Types of exceptions in the `type' field.  */
Packit 6c4009
#define DOMAIN		1
Packit 6c4009
#define SING		2
Packit 6c4009
#define OVERFLOW	3
Packit 6c4009
#define UNDERFLOW	4
Packit 6c4009
#define TLOSS		5
Packit 6c4009
#define PLOSS		6
Packit 6c4009
Packit 6c4009
/* SVID mode specifies returning this large value instead of infinity.  */
Packit 6c4009
#define HUGE		3.40282347e+38F
Packit 6c4009
Packit 6c4009
/* The above definitions may be used in testcases.  The following code
Packit 6c4009
   is only used in the implementation.  */
Packit 6c4009
Packit 6c4009
#ifdef _LIBC
Packit 6c4009
/* fdlibm kernel function */
Packit 6c4009
extern double __kernel_standard (double, double, int);
Packit 6c4009
extern float __kernel_standard_f (float, float, int);
Packit 6c4009
extern long double __kernel_standard_l (long double, long double, int);
Packit 6c4009
Packit 6c4009
# include <shlib-compat.h>
Packit 6c4009
# define LIBM_SVID_COMPAT SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
Packit 6c4009
# if LIBM_SVID_COMPAT
Packit 6c4009
compat_symbol_reference (libm, matherr, matherr, GLIBC_2_0);
Packit 6c4009
compat_symbol_reference (libm, _LIB_VERSION, _LIB_VERSION, GLIBC_2_0);
Packit 6c4009
# else
Packit 6c4009
/* Except when building compat code, optimize out references to
Packit 6c4009
   _LIB_VERSION and matherr.  */
Packit 6c4009
#  define _LIB_VERSION _POSIX_
Packit 6c4009
#  define matherr(EXC) ((void) (EXC), 0)
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif /* math-svid-compat.h.  */