xref: /freebsd/lib/msun/arm/fenv.c (revision 5d9fefacf242fc8db7b169257fab739c798bfe77)
119220bc1SDavid Schultz /*-
219220bc1SDavid Schultz  * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
319220bc1SDavid Schultz  * All rights reserved.
419220bc1SDavid Schultz  *
519220bc1SDavid Schultz  * Redistribution and use in source and binary forms, with or without
619220bc1SDavid Schultz  * modification, are permitted provided that the following conditions
719220bc1SDavid Schultz  * are met:
819220bc1SDavid Schultz  * 1. Redistributions of source code must retain the above copyright
919220bc1SDavid Schultz  *    notice, this list of conditions and the following disclaimer.
1019220bc1SDavid Schultz  * 2. Redistributions in binary form must reproduce the above copyright
1119220bc1SDavid Schultz  *    notice, this list of conditions and the following disclaimer in the
1219220bc1SDavid Schultz  *    documentation and/or other materials provided with the distribution.
1319220bc1SDavid Schultz  *
1419220bc1SDavid Schultz  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1519220bc1SDavid Schultz  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1619220bc1SDavid Schultz  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1719220bc1SDavid Schultz  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1819220bc1SDavid Schultz  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1919220bc1SDavid Schultz  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2019220bc1SDavid Schultz  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2119220bc1SDavid Schultz  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2219220bc1SDavid Schultz  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2319220bc1SDavid Schultz  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2419220bc1SDavid Schultz  * SUCH DAMAGE.
2519220bc1SDavid Schultz  *
2619220bc1SDavid Schultz  * $FreeBSD$
2719220bc1SDavid Schultz  */
2819220bc1SDavid Schultz 
29d78e594bSDavid Schultz #define	__fenv_static
30*5d9fefacSDavid Schultz #include "fenv.h"
3119220bc1SDavid Schultz 
32d78e594bSDavid Schultz #ifdef __GNUC_GNU_INLINE__
33d78e594bSDavid Schultz #error "This file must be compiled with C99 'inline' semantics"
34d78e594bSDavid Schultz #endif
35d78e594bSDavid Schultz 
3619220bc1SDavid Schultz /*
3719220bc1SDavid Schultz  * Hopefully the system ID byte is immutable, so it's valid to use
3819220bc1SDavid Schultz  * this as a default environment.
3919220bc1SDavid Schultz  */
4019220bc1SDavid Schultz const fenv_t __fe_dfl_env = 0;
41d78e594bSDavid Schultz 
42d78e594bSDavid Schultz extern inline int feclearexcept(int __excepts);
43d78e594bSDavid Schultz extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
44d78e594bSDavid Schultz extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
45d78e594bSDavid Schultz extern inline int feraiseexcept(int __excepts);
46d78e594bSDavid Schultz extern inline int fetestexcept(int __excepts);
47d78e594bSDavid Schultz extern inline int fegetround(void);
48d78e594bSDavid Schultz extern inline int fesetround(int __round);
49d78e594bSDavid Schultz extern inline int fegetenv(fenv_t *__envp);
50d78e594bSDavid Schultz extern inline int feholdexcept(fenv_t *__envp);
51d78e594bSDavid Schultz extern inline int fesetenv(const fenv_t *__envp);
52d78e594bSDavid Schultz extern inline int feupdateenv(const fenv_t *__envp);
53