xref: /llvm-project/libcxx/include/fenv.h (revision b9a2658a3e8bd13b0f9e7a8a440832a95b377216)
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef _LIBCPP_FENV_H
11 #define _LIBCPP_FENV_H
12 
13 /*
14     fenv.h synopsis
15 
16 This entire header is C99 / C++0X
17 
18 Macros:
19 
20     FE_DIVBYZERO
21     FE_INEXACT
22     FE_INVALID
23     FE_OVERFLOW
24     FE_UNDERFLOW
25     FE_ALL_EXCEPT
26     FE_DOWNWARD
27     FE_TONEAREST
28     FE_TOWARDZERO
29     FE_UPWARD
30     FE_DFL_ENV
31 
32 Types:
33 
34     fenv_t
35     fexcept_t
36 
37 int feclearexcept(int excepts);
38 int fegetexceptflag(fexcept_t* flagp, int excepts);
39 int feraiseexcept(int excepts);
40 int fesetexceptflag(const fexcept_t* flagp, int excepts);
41 int fetestexcept(int excepts);
42 int fegetround();
43 int fesetround(int round);
44 int fegetenv(fenv_t* envp);
45 int feholdexcept(fenv_t* envp);
46 int fesetenv(const fenv_t* envp);
47 int feupdateenv(const fenv_t* envp);
48 
49 
50 */
51 
52 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
53 #  include <__cxx03/fenv.h>
54 #else
55 #  include <__config>
56 
57 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
58 #    pragma GCC system_header
59 #  endif
60 
61 #  if __has_include_next(<fenv.h>)
62 #    include_next <fenv.h>
63 #  endif
64 
65 #  ifdef __cplusplus
66 
67 extern "C++" {
68 
69 #    ifdef feclearexcept
70 #      undef feclearexcept
71 #    endif
72 
73 #    ifdef fegetexceptflag
74 #      undef fegetexceptflag
75 #    endif
76 
77 #    ifdef feraiseexcept
78 #      undef feraiseexcept
79 #    endif
80 
81 #    ifdef fesetexceptflag
82 #      undef fesetexceptflag
83 #    endif
84 
85 #    ifdef fetestexcept
86 #      undef fetestexcept
87 #    endif
88 
89 #    ifdef fegetround
90 #      undef fegetround
91 #    endif
92 
93 #    ifdef fesetround
94 #      undef fesetround
95 #    endif
96 
97 #    ifdef fegetenv
98 #      undef fegetenv
99 #    endif
100 
101 #    ifdef feholdexcept
102 #      undef feholdexcept
103 #    endif
104 
105 #    ifdef fesetenv
106 #      undef fesetenv
107 #    endif
108 
109 #    ifdef feupdateenv
110 #      undef feupdateenv
111 #    endif
112 
113 } // extern "C++"
114 
115 #  endif // defined(__cplusplus)
116 #endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
117 
118 #endif // _LIBCPP_FENV_H
119