From 08c1e93fa36a49f49325a07fe91ff92c964c2b6c Mon Sep 17 00:00:00 2001 From: Chanho Park Date: Thu, 11 Dec 2014 18:55:56 +0900 Subject: Imported Upstream version 1.57.0 --- boost/detail/fenv.hpp | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'boost/detail/fenv.hpp') diff --git a/boost/detail/fenv.hpp b/boost/detail/fenv.hpp index f048706416..b268f5c1cc 100644 --- a/boost/detail/fenv.hpp +++ b/boost/detail/fenv.hpp @@ -14,7 +14,7 @@ #if !defined(BOOST_DETAIL_FENV_HPP) #define BOOST_DETAIL_FENV_HPP -/* If we're using clang + glibc, we have to get hacky. +/* If we're using clang + glibc, we have to get hacky. * See http://llvm.org/bugs/show_bug.cgi?id=6907 */ #if defined(__clang__) && (__clang_major__ < 3) && \ defined(__GNU_LIBRARY__) && /* up to version 5 */ \ @@ -61,14 +61,41 @@ using ::feholdexcept; } } +#elif defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 + + // MinGW (32-bit) has a bug in mingw32/bits/c++config.h, it does not define _GLIBCXX_HAVE_FENV_H, + // which prevents the C fenv.h header contents to be included in the C++ wrapper header fenv.h. This is at least + // the case with gcc 4.8.1 packages tested so far, up to 4.8.1-4. Note that there is no issue with + // MinGW-w64. + // To work around the bug we avoid including the C++ wrapper header and include the C header directly + // and import all relevant symbols into std:: ourselves. + + #include <../include/fenv.h> + + namespace std { + using ::fenv_t; + using ::fexcept_t; + using ::fegetexceptflag; + using ::fesetexceptflag; + using ::feclearexcept; + using ::feraiseexcept; + using ::fetestexcept; + using ::fegetround; + using ::fesetround; + using ::fegetenv; + using ::fesetenv; + using ::feupdateenv; + using ::feholdexcept; + } + #else /* if we're not using GNU's C stdlib, fenv.h should work with clang */ + #if defined(__SUNPRO_CC) /* lol suncc */ #include #endif - + #include #endif #endif /* BOOST_DETAIL_FENV_HPP */ - -- cgit v1.2.3