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
16This entire header is C99 / C++0X
17
18Macros:
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
32Types:
33
34 fenv_t
35 fexcept_t
36
37int feclearexcept(int excepts);
38int fegetexceptflag(fexcept_t* flagp, int excepts);
39int feraiseexcept(int excepts);
40int fesetexceptflag(const fexcept_t* flagp, int excepts);
41int fetestexcept(int excepts);
42int fegetround();
43int fesetround(int round);
44int fegetenv(fenv_t* envp);
45int feholdexcept(fenv_t* envp);
46int fesetenv(const fenv_t* envp);
47int feupdateenv(const fenv_t* envp);
48
49
50*/
51
52#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
53# include <__cxx03/__config>
54#else
55# include <__config>
56#endif
57
58#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
59# pragma GCC system_header
60#endif
61
62#if __has_include_next(<fenv.h>)
63# include_next <fenv.h>
64#endif
65
66#ifdef __cplusplus
67
68extern "C++" {
69
70# ifdef feclearexcept
71# undef feclearexcept
72# endif
73
74# ifdef fegetexceptflag
75# undef fegetexceptflag
76# endif
77
78# ifdef feraiseexcept
79# undef feraiseexcept
80# endif
81
82# ifdef fesetexceptflag
83# undef fesetexceptflag
84# endif
85
86# ifdef fetestexcept
87# undef fetestexcept
88# endif
89
90# ifdef fegetround
91# undef fegetround
92# endif
93
94# ifdef fesetround
95# undef fesetround
96# endif
97
98# ifdef fegetenv
99# undef fegetenv
100# endif
101
102# ifdef feholdexcept
103# undef feholdexcept
104# endif
105
106# ifdef fesetenv
107# undef fesetenv
108# endif
109
110# ifdef feupdateenv
111# undef feupdateenv
112# endif
113
114} // extern "C++"
115
116#endif // defined(__cplusplus)
117
118#endif // _LIBCPP_FENV_H
119