14bf1032aSRuslan Bukin /*- 24bf1032aSRuslan Bukin * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG> 34bf1032aSRuslan Bukin * All rights reserved. 44bf1032aSRuslan Bukin * 54bf1032aSRuslan Bukin * Redistribution and use in source and binary forms, with or without 64bf1032aSRuslan Bukin * modification, are permitted provided that the following conditions 74bf1032aSRuslan Bukin * are met: 84bf1032aSRuslan Bukin * 1. Redistributions of source code must retain the above copyright 94bf1032aSRuslan Bukin * notice, this list of conditions and the following disclaimer. 104bf1032aSRuslan Bukin * 2. Redistributions in binary form must reproduce the above copyright 114bf1032aSRuslan Bukin * notice, this list of conditions and the following disclaimer in the 124bf1032aSRuslan Bukin * documentation and/or other materials provided with the distribution. 134bf1032aSRuslan Bukin * 144bf1032aSRuslan Bukin * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 154bf1032aSRuslan Bukin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 164bf1032aSRuslan Bukin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 174bf1032aSRuslan Bukin * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 184bf1032aSRuslan Bukin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 194bf1032aSRuslan Bukin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204bf1032aSRuslan Bukin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 214bf1032aSRuslan Bukin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 224bf1032aSRuslan Bukin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 234bf1032aSRuslan Bukin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 244bf1032aSRuslan Bukin * SUCH DAMAGE. 254bf1032aSRuslan Bukin */ 264bf1032aSRuslan Bukin 274bf1032aSRuslan Bukin #define __fenv_static 284bf1032aSRuslan Bukin #include "fenv.h" 294bf1032aSRuslan Bukin 304bf1032aSRuslan Bukin #ifdef __GNUC_GNU_INLINE__ 314bf1032aSRuslan Bukin #error "This file must be compiled with C99 'inline' semantics" 324bf1032aSRuslan Bukin #endif 334bf1032aSRuslan Bukin 344bf1032aSRuslan Bukin /* 354bf1032aSRuslan Bukin * Hopefully the system ID byte is immutable, so it's valid to use 364bf1032aSRuslan Bukin * this as a default environment. 374bf1032aSRuslan Bukin */ 384bf1032aSRuslan Bukin const fenv_t __fe_dfl_env = 0; 394bf1032aSRuslan Bukin 404bf1032aSRuslan Bukin extern inline int feclearexcept(int __excepts); 414bf1032aSRuslan Bukin extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts); 424bf1032aSRuslan Bukin extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts); 434bf1032aSRuslan Bukin extern inline int feraiseexcept(int __excepts); 444bf1032aSRuslan Bukin extern inline int fetestexcept(int __excepts); 454bf1032aSRuslan Bukin extern inline int fegetround(void); 464bf1032aSRuslan Bukin extern inline int fesetround(int __round); 474bf1032aSRuslan Bukin extern inline int fegetenv(fenv_t *__envp); 484bf1032aSRuslan Bukin extern inline int feholdexcept(fenv_t *__envp); 494bf1032aSRuslan Bukin extern inline int fesetenv(const fenv_t *__envp); 504bf1032aSRuslan Bukin extern inline int feupdateenv(const fenv_t *__envp); 51*7804dd52SRuslan Bukin extern inline int feenableexcept(int __mask); 52*7804dd52SRuslan Bukin extern inline int fedisableexcept(int __mask); 53*7804dd52SRuslan Bukin extern inline int fegetexcept(void); 54