cfenv 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. #ifndef _LIBCPP_CFENV
  10. #define _LIBCPP_CFENV
  11. /*
  12. cfenv synopsis
  13. This entire header is C99 / C++0X
  14. Macros:
  15. FE_DIVBYZERO
  16. FE_INEXACT
  17. FE_INVALID
  18. FE_OVERFLOW
  19. FE_UNDERFLOW
  20. FE_ALL_EXCEPT
  21. FE_DOWNWARD
  22. FE_TONEAREST
  23. FE_TOWARDZERO
  24. FE_UPWARD
  25. FE_DFL_ENV
  26. namespace std
  27. {
  28. Types:
  29. fenv_t
  30. fexcept_t
  31. int feclearexcept(int excepts);
  32. int fegetexceptflag(fexcept_t* flagp, int excepts);
  33. int feraiseexcept(int excepts);
  34. int fesetexceptflag(const fexcept_t* flagp, int excepts);
  35. int fetestexcept(int excepts);
  36. int fegetround();
  37. int fesetround(int round);
  38. int fegetenv(fenv_t* envp);
  39. int feholdexcept(fenv_t* envp);
  40. int fesetenv(const fenv_t* envp);
  41. int feupdateenv(const fenv_t* envp);
  42. } // std
  43. */
  44. #include <__assert> // all public C++ headers provide the assertion handler
  45. #include <__config>
  46. #include <fenv.h>
  47. #ifndef _LIBCPP_FENV_H
  48. # error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
  49. This usually means that your header search paths are not configured properly. \
  50. The header search paths should contain the C++ Standard Library headers before \
  51. any C Standard Library, and you are probably using compiler flags that make that \
  52. not be the case.
  53. #endif
  54. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  55. # pragma GCC system_header
  56. #endif
  57. _LIBCPP_BEGIN_NAMESPACE_STD
  58. using ::fenv_t _LIBCPP_USING_IF_EXISTS;
  59. using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
  60. using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
  61. using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
  62. using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
  63. using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
  64. using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
  65. using ::fegetround _LIBCPP_USING_IF_EXISTS;
  66. using ::fesetround _LIBCPP_USING_IF_EXISTS;
  67. using ::fegetenv _LIBCPP_USING_IF_EXISTS;
  68. using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
  69. using ::fesetenv _LIBCPP_USING_IF_EXISTS;
  70. using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
  71. _LIBCPP_END_NAMESPACE_STD
  72. #endif // _LIBCPP_CFENV