cfenv 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 <__config>
  45. #include <fenv.h>
  46. #ifndef _LIBCPP_FENV_H
  47. # error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
  48. This usually means that your header search paths are not configured properly. \
  49. The header search paths should contain the C++ Standard Library headers before \
  50. any C Standard Library, and you are probably using compiler flags that make that \
  51. not be the case.
  52. #endif
  53. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  54. # pragma GCC system_header
  55. #endif
  56. _LIBCPP_BEGIN_NAMESPACE_STD
  57. using ::fenv_t _LIBCPP_USING_IF_EXISTS;
  58. using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
  59. using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
  60. using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
  61. using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
  62. using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
  63. using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
  64. using ::fegetround _LIBCPP_USING_IF_EXISTS;
  65. using ::fesetround _LIBCPP_USING_IF_EXISTS;
  66. using ::fegetenv _LIBCPP_USING_IF_EXISTS;
  67. using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
  68. using ::fesetenv _LIBCPP_USING_IF_EXISTS;
  69. using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
  70. _LIBCPP_END_NAMESPACE_STD
  71. #endif // _LIBCPP_CFENV