Restore [66804], [66833], and [66834]. (fenv fixes.) I mistakenly reverted them in [68201] because [66804] was mislabeled.

[SVN r68554]
This commit is contained in:
Steven Watanabe
2011-01-30 06:24:30 +00:00
parent 69e5377957
commit ed7120adb8
11 changed files with 186 additions and 23 deletions

View File

@ -71,6 +71,11 @@ The Platform does not provide `<wchar.h>` and `<cwchar>`.
[[`BOOST_NO_CWCTYPE`][Platform][ [[`BOOST_NO_CWCTYPE`][Platform][
The Platform does not provide `<wctype.h>` and `<cwctype>`. The Platform does not provide `<wctype.h>` and `<cwctype>`.
]] ]]
[[`BOOST_NO_FENV_H`][Platform, Standard library][
The C standard library doesn't provide `<fenv.h>`. [@../../../../boost/detail/fenv.hpp
`<boost/detail/fenv.hpp>`] should be included instead of `<fenv.h>` for maximum
portability on platforms which do provide `<fenv.h>`.
]]
[[`BOOST_NO_DEPENDENT_NESTED_DERIVATIONS`][Compiler][ [[`BOOST_NO_DEPENDENT_NESTED_DERIVATIONS`][Compiler][
The compiler fails to compile a nested class that has a dependent base class: The compiler fails to compile a nested class that has a dependent base class:
`` ``
@ -399,11 +404,6 @@ The platform has the POSIX API `sched_yield`.
[[`BOOST_HAS_SGI_TYPE_TRAITS`][Compiler, Standard library][ [[`BOOST_HAS_SGI_TYPE_TRAITS`][Compiler, Standard library][
The compiler has native support for SGI style type traits. The compiler has native support for SGI style type traits.
]] ]]
[[`BOOST_HAS_FENV_H`][Platform, Standard library][
The platform has a `<fenv.h>`. [@../../../../boost/detail/fenv.hpp
`<boost/detail/fenv.hpp>`] should be included instead of `<fenv.h>` for maximum
portability.
]]
[[`BOOST_HAS_STDINT_H`][Platform][ [[`BOOST_HAS_STDINT_H`][Platform][
The platform has a `<stdint.h>` The platform has a `<stdint.h>`
]] ]]

View File

@ -37,6 +37,9 @@
// //
#endif #endif
/// Visual Studio has no fenv.h
#define BOOST_NO_FENV_H
#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 #if (_MSC_VER <= 1300) // 1300 == VC++ 7.0
# if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za # if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za

View File

@ -39,6 +39,9 @@
#define BOOST_HAS_STDINT_H #define BOOST_HAS_STDINT_H
#endif #endif
/// Cygwin has no fenv.h
#define BOOST_NO_FENV_H
// boilerplate code: // boilerplate code:
#include <boost/config/posix_features.hpp> #include <boost/config/posix_features.hpp>

View File

@ -31,7 +31,6 @@
# define BOOST_SYMBOL_IMPORT __declspec(dllimport) # define BOOST_SYMBOL_IMPORT __declspec(dllimport)
#endif #endif
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
# define BOOST_HAS_STDINT_H # define BOOST_HAS_STDINT_H
# define __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS

View File

@ -56,11 +56,6 @@
# define BOOST_HAS_THREADS # define BOOST_HAS_THREADS
#endif #endif
#if !defined(CYGWIN)
# include <unistd.h>
# define BOOST_HAS_FENV_H
#endif
#if !defined(_GLIBCPP_USE_LONG_LONG) \ #if !defined(_GLIBCPP_USE_LONG_LONG) \
&& !defined(_GLIBCXX_USE_LONG_LONG)\ && !defined(_GLIBCXX_USE_LONG_LONG)\
&& defined(BOOST_HAS_LONG_LONG) && defined(BOOST_HAS_LONG_LONG)
@ -69,6 +64,16 @@
# undef BOOST_HAS_LONG_LONG # undef BOOST_HAS_LONG_LONG
#endif #endif
// Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h>
#endif
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
# define BOOST_HAS_SLIST # define BOOST_HAS_SLIST

View File

@ -40,11 +40,14 @@
# define BOOST_NO_STRINGSTREAM # define BOOST_NO_STRINGSTREAM
#endif #endif
#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__)) // Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h> # include <unistd.h>
# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
# define BOOST_HAS_FENV_H
# endif
#endif #endif

View File

@ -16,11 +16,14 @@
# endif # endif
#endif #endif
#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__)) // Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h> # include <unistd.h>
# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
# define BOOST_HAS_FENV_H
# endif
#endif #endif
// //

View File

@ -12,11 +12,14 @@
#define BOOST_HAS_MACRO_USE_FACET #define BOOST_HAS_MACRO_USE_FACET
#define BOOST_NO_STD_MESSAGES #define BOOST_NO_STD_MESSAGES
#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__)) // Apple doesn't seem to reliably defined a *unix* macro
#if !defined(CYGWIN) && ( defined(__unix__) \
|| defined(__unix) \
|| defined(unix) \
|| defined(__APPLE__) \
|| defined(__APPLE) \
|| defined(APPLE))
# include <unistd.h> # include <unistd.h>
# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
# define BOOST_HAS_FENV_H
# endif
#endif #endif
// C++0x headers not yet implemented // C++0x headers not yet implemented

78
test/boost_no_fenv_h.ipp Normal file
View File

@ -0,0 +1,78 @@
// (C) Copyright John Maddock 2001.
// (C) Copyright Bryce Lelbach 2010.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
// MACRO: BOOST_NO_FENV_H
// TITLE: fenv.h
// DESCRIPTION: There is no POSIX <fenv.h> available. If <fenv.h> is
// available, <boost/detail/fenv.hpp> should be included
// instead of directly including <fenv.h>.
#include <boost/detail/fenv.hpp>
namespace boost_no_fenv_h {
int test()
{
/// POSIX required typedefs
typedef ::fenv_t has_fenv_t;
typedef ::fexcept_t has_fexcept_t;
/// POSIX required macros
#if !defined(FE_DIVBYZERO)
#error platform does not define FE_DIVBYZERO
#endif
#if !defined(FE_INEXACT)
#error platform does not define FE_INEXACT
#endif
#if !defined(FE_INVALID)
#error platform does not define FE_INVALID
#endif
#if !defined(FE_OVERFLOW)
#error platform does not define FE_OVERFLOW
#endif
#if !defined(FE_UNDERFLOW)
#error platform does not define FE_UNDERFLOW
#endif
#if !defined(FE_DOWNWARD)
#error platform does not define FE_DOWNWARD
#endif
#if !defined(FE_TONEAREST)
#error platform does not define FE_TONEAREST
#endif
#if !defined(FE_UPWARD)
#error platform does not define FE_UPWARD
#endif
#if !defined(FE_DFL_ENV)
#error platform does not define FE_DFL_ENV
#endif
int (*has_feclearexcept)(int) = ::feclearexcept;
int (*has_fegetenv)(fenv_t*) = ::fegetenv;
int (*has_fegetexcept)(fexcept_t*, int) = ::fegetexcept;
int (*has_fegetround)(void) = ::fegetround;
int (*has_feholdexcept)(fenv_t*) = ::feholdexcept;
int (*has_feraiseexcept)(int) = ::feraiseexcept;
int (*has_fesetenv)(const fenv_t*) = ::fesetenv;
int (*has_fesetexceptflag)(const fexcept_t*, int) = ::fesetexceptflag;
int (*has_fesetround)(int) = ::fesetround;
int (*has_fetestexcept)(int) = ::fetestexcept;
int (*has_feupdateenv)(const fenv_t*) = ::feupdateenv;
return 0;
}
}

33
test/no_fenv_h_fail.cpp Normal file
View File

@ -0,0 +1,33 @@
// Copyright Bryce Lelbach 2010.
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.
// Test file for macro BOOST_NO_FENV_H
// This file should not compile, if it does then
// BOOST_NO_FENV_H should not be defined.
// See file boost_no_fenv_h.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifdef BOOST_NO_FENV_H
#include "boost_no_fenv_h.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_fenv_h::test();
}

33
test/no_fenv_h_pass.cpp Normal file
View File

@ -0,0 +1,33 @@
// Copyright Bryce Lelbach 2010.
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.
// Test file for macro BOOST_NO_FENV_H
// This file should compile, if it does not then
// BOOST_NO_FENV_H should be defined.
// See file boost_no_fenv_h.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifndef BOOST_NO_FENV_H
#include "boost_no_fenv_h.ipp"
#else
namespace boost_no_fenv_h = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_fenv_h::test();
}