]> git.lyx.org Git - lyx.git/blob - boost/boost/detail/fenv.hpp
update boost to version 1.48
[lyx.git] / boost / boost / detail / fenv.hpp
1 /*=============================================================================
2     Copyright (c) 2010      Bryce Lelbach
3
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 =============================================================================*/
7
8 #include <boost/config.hpp>
9
10 #if defined(BOOST_NO_FENV_H)
11   #error This platform does not have a floating point environment
12 #endif
13
14 #if !defined(BOOST_DETAIL_FENV_HPP)
15 #define BOOST_DETAIL_FENV_HPP
16
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__)       &&                       \
20     defined(__GNU_LIBRARY__) && /* up to version 5 */ \
21     defined(__GLIBC__)          /* version 6 + */
22   #define _FENV_H
23
24   #include <features.h>
25   #include <bits/fenv.h>
26
27   extern "C" {
28     extern int fegetexceptflag (fexcept_t*, int) __THROW;
29     extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
30     extern int feclearexcept (int) __THROW;
31     extern int feraiseexcept (int) __THROW;
32     extern int fetestexcept (int) __THROW;
33     extern int fegetround (void) __THROW;
34     extern int fesetround (int) __THROW;
35     extern int fegetenv (fenv_t*) __THROW;
36     extern int fesetenv (__const fenv_t*) __THROW;
37     extern int feupdateenv (__const fenv_t*) __THROW;
38     extern int feholdexcept (fenv_t*) __THROW;
39
40     #ifdef __USE_GNU
41       extern int feenableexcept (int) __THROW;
42       extern int fedisableexcept (int) __THROW;
43       extern int fegetexcept (void) __THROW;
44     #endif
45   }
46
47   namespace std { namespace tr1 {
48     using ::fenv_t;
49     using ::fexcept_t;
50     using ::fegetexceptflag;
51     using ::fesetexceptflag;
52     using ::feclearexcept;
53     using ::feraiseexcept;
54     using ::fetestexcept;
55     using ::fegetround;
56     using ::fesetround;
57     using ::fegetenv;
58     using ::fesetenv;
59     using ::feupdateenv;
60     using ::feholdexcept;
61   } }
62
63 #else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
64   #if defined(__SUNPRO_CC) /* lol suncc */
65     #include <stdio.h>
66   #endif
67   
68   #include <fenv.h>
69
70 #endif
71
72 #endif /* BOOST_DETAIL_FENV_HPP */
73