1 /*=============================================================================
2 Copyright (c) 2010 Bryce Lelbach
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 =============================================================================*/
8 #include <boost/config.hpp>
10 #if defined(BOOST_NO_FENV_H)
11 #error This platform does not have a floating point environment
14 #if !defined(BOOST_DETAIL_FENV_HPP)
15 #define BOOST_DETAIL_FENV_HPP
17 /* If we're using clang + glibc, we have to get hacky.
18 * See http://llvm.org/bugs/show_bug.cgi?id=6907 */
19 #if defined(__clang__) && (__clang_major__ < 3) && \
20 defined(__GNU_LIBRARY__) && /* up to version 5 */ \
21 defined(__GLIBC__) && /* version 6 + */ \
26 #include <bits/fenv.h>
29 extern int fegetexceptflag (fexcept_t*, int) __THROW;
30 extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
31 extern int feclearexcept (int) __THROW;
32 extern int feraiseexcept (int) __THROW;
33 extern int fetestexcept (int) __THROW;
34 extern int fegetround (void) __THROW;
35 extern int fesetround (int) __THROW;
36 extern int fegetenv (fenv_t*) __THROW;
37 extern int fesetenv (__const fenv_t*) __THROW;
38 extern int feupdateenv (__const fenv_t*) __THROW;
39 extern int feholdexcept (fenv_t*) __THROW;
42 extern int feenableexcept (int) __THROW;
43 extern int fedisableexcept (int) __THROW;
44 extern int fegetexcept (void) __THROW;
48 namespace std { namespace tr1 {
51 using ::fegetexceptflag;
52 using ::fesetexceptflag;
53 using ::feclearexcept;
54 using ::feraiseexcept;
64 #else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
65 #if defined(__SUNPRO_CC) /* lol suncc */
73 #endif /* BOOST_DETAIL_FENV_HPP */