xref: /freebsd/contrib/llvm-project/libcxx/include/cfenv (revision 031beb4e239bfce798af17f5fe8dba8bcaf13d99)
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_CFENV
11#define _LIBCPP_CFENV
12
13/*
14    cfenv 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
32namespace std
33{
34
35Types:
36
37    fenv_t
38    fexcept_t
39
40int feclearexcept(int excepts);
41int fegetexceptflag(fexcept_t* flagp, int excepts);
42int feraiseexcept(int excepts);
43int fesetexceptflag(const fexcept_t* flagp, int excepts);
44int fetestexcept(int excepts);
45int fegetround();
46int fesetround(int round);
47int fegetenv(fenv_t* envp);
48int feholdexcept(fenv_t* envp);
49int fesetenv(const fenv_t* envp);
50int feupdateenv(const fenv_t* envp);
51
52}  // std
53*/
54
55#include <__assert> // all public C++ headers provide the assertion handler
56#include <__config>
57
58#include <fenv.h>
59
60#ifndef _LIBCPP_FENV_H
61#   error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
62          This usually means that your header search paths are not configured properly. \
63          The header search paths should contain the C++ Standard Library headers before \
64          any C Standard Library, and you are probably using compiler flags that make that \
65          not be the case.
66#endif
67
68#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
69#  pragma GCC system_header
70#endif
71
72_LIBCPP_BEGIN_NAMESPACE_STD
73
74using ::fenv_t _LIBCPP_USING_IF_EXISTS;
75using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
76
77using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
78using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
79using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
80using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
81using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
82using ::fegetround _LIBCPP_USING_IF_EXISTS;
83using ::fesetround _LIBCPP_USING_IF_EXISTS;
84using ::fegetenv _LIBCPP_USING_IF_EXISTS;
85using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
86using ::fesetenv _LIBCPP_USING_IF_EXISTS;
87using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
88
89_LIBCPP_END_NAMESPACE_STD
90
91#endif // _LIBCPP_CFENV
92