1
2 /*
3 (c) Copyright 2019 Joel Sherrill <joel@rtems.org
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #include <fenv.h>
31 #include <errno.h>
32
33 /*
34 FUNCTION
35 <<fetestexcept>>---test floating-point exception flags
36
37 INDEX
38 fetestexcept
39 SYNOPSIS
40 #include <fenv.h>
41 int fetestexcept(int <[except]>);
42
43 Link with -lm.
44
45 DESCRIPTION
46 This method test the current floating-point exceptions to determine
47 which of those specified in <[except]> are currently set.
48
49 RETURNS
50 This method returns the bitwise-inclusive OR of the floating point
51 exception macros which correspond to the currently set floating point
52 exceptions.
53
54 PORTABILITY
55 ANSI C requires <<fetestexcept>>.
56
57 Not all Newlib targets have a working implementation. Refer to
58 the file <<sys/fenv.h>> to see the status for your target.
59 */
60
61 /*
62 * This is a non-functional implementation that should be overridden
63 * by an architecture specific implementation in newlib/libm/machine/ARCH.
64 */
fetestexcept(int excepts)65 int fetestexcept(int excepts)
66 {
67 (void) excepts;
68 return 0;
69 }
70