1 // (C) Copyright John Maddock 2001.
2 // (C) Copyright Bryce Lelbach 2010.
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/config for most recent version.
9 // MACRO: BOOST_NO_FENV_H
11 // DESCRIPTION: There is no standard <fenv.h> available. If <fenv.h> is
12 // available, <boost/detail/fenv.hpp> should be included
13 // instead of directly including <fenv.h>.
17 namespace boost_no_fenv_h {
21 /// C++0x required typedefs
22 typedef ::fenv_t has_fenv_t;
23 typedef ::fexcept_t has_fexcept_t;
25 /// C++0x required macros
26 #if !defined(FE_DIVBYZERO)
27 #error platform does not define FE_DIVBYZERO
30 #if !defined(FE_INEXACT)
31 #error platform does not define FE_INEXACT
34 #if !defined(FE_ALL_EXCEPT)
35 #error platform does not define FE_ALL_EXCEPT
42 i = feclearexcept(FE_ALL_EXCEPT);
43 i += fetestexcept(FE_ALL_EXCEPT); // All flags should be zero
44 i += fegetexceptflag(&fe, FE_ALL_EXCEPT);
45 i += fesetexceptflag(&fe, FE_ALL_EXCEPT);
46 i += feraiseexcept(0);
47 i += fesetround(fegetround());
50 i += feholdexcept(&env);
52 i += feupdateenv(&env);