Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66804 - in trunk: boost/config/compiler boost/config/platform boost/config/stdlib boost/detail libs/config/doc libs/config/test
From: admin_at_[hidden]
Date: 2010-11-27 16:43:54


Author: wash
Date: 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
New Revision: 66804
URL: http://svn.boost.org/trac/boost/changeset/66804

Log:
Added *nix identification macros to Boost.Config; BOOST_NIX, BOOST_GENETIC_NIX,
BOOST_TRADEMARK_NIX and BOOST_FUNCTIONAL_NIX.

Added:
   trunk/libs/config/test/boost_no_fenv_h.ipp (contents, props changed)
   trunk/libs/config/test/no_fenv_h_fail.cpp (contents, props changed)
   trunk/libs/config/test/no_fenv_h_pass.cpp (contents, props changed)
Text files modified:
   trunk/boost/config/compiler/visualc.hpp | 3 +++
   trunk/boost/config/platform/cygwin.hpp | 3 +++
   trunk/boost/config/platform/win32.hpp | 1 -
   trunk/boost/config/stdlib/libstdcpp3.hpp | 9 ++++-----
   trunk/boost/config/stdlib/sgi.hpp | 5 +----
   trunk/boost/config/stdlib/stlport.hpp | 5 +----
   trunk/boost/config/stdlib/vacpp.hpp | 5 +----
   trunk/boost/detail/fenv.hpp | 2 +-
   trunk/libs/config/doc/macro_reference.qbk | 10 +++++-----
   9 files changed, 19 insertions(+), 24 deletions(-)

Modified: trunk/boost/config/compiler/visualc.hpp
==============================================================================
--- trunk/boost/config/compiler/visualc.hpp (original)
+++ trunk/boost/config/compiler/visualc.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -37,6 +37,9 @@
    //
 #endif
 
+/// Visual Studio has no fenv.h
+#define BOOST_NO_FENV_H
+
 #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

Modified: trunk/boost/config/platform/cygwin.hpp
==============================================================================
--- trunk/boost/config/platform/cygwin.hpp (original)
+++ trunk/boost/config/platform/cygwin.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -43,6 +43,9 @@
   #define BOOST_HAS_STDINT_H
 #endif
 
+/// Cygwin has no fenv.h
+#define BOOST_NO_FENV_H
+
 #include <boost/config/posix_features.hpp>
 
 // Cygwin lies about XSI conformance, there is no nl_types.h.

Modified: trunk/boost/config/platform/win32.hpp
==============================================================================
--- trunk/boost/config/platform/win32.hpp (original)
+++ trunk/boost/config/platform/win32.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -31,7 +31,6 @@
 # define BOOST_SYMBOL_IMPORT __declspec(dllimport)
 #endif
 
-
 #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
 # define BOOST_HAS_STDINT_H
 # define __STDC_LIMIT_MACROS

Modified: trunk/boost/config/stdlib/libstdcpp3.hpp
==============================================================================
--- trunk/boost/config/stdlib/libstdcpp3.hpp (original)
+++ trunk/boost/config/stdlib/libstdcpp3.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -54,11 +54,6 @@
 # define BOOST_HAS_THREADS
 #endif
 
-#if !defined(CYGWIN)
-# include <unistd.h>
-# define BOOST_HAS_FENV_H
-#endif
-
 #if !defined(_GLIBCPP_USE_LONG_LONG) \
     && !defined(_GLIBCXX_USE_LONG_LONG)\
     && defined(BOOST_HAS_LONG_LONG)
@@ -67,6 +62,10 @@
 # undef BOOST_HAS_LONG_LONG
 #endif
 
+#if !defined(CYGWIN)
+# include <unistd.h>
+#endif
+
 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
 # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
 # define BOOST_HAS_SLIST

Modified: trunk/boost/config/stdlib/sgi.hpp
==============================================================================
--- trunk/boost/config/stdlib/sgi.hpp (original)
+++ trunk/boost/config/stdlib/sgi.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -40,11 +40,8 @@
 # define BOOST_NO_STRINGSTREAM
 #endif
 
-#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__))
+#if !defined(CYGWIN)
 # include <unistd.h>
-# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
-# define BOOST_HAS_FENV_H
-# endif
 #endif
 
 

Modified: trunk/boost/config/stdlib/stlport.hpp
==============================================================================
--- trunk/boost/config/stdlib/stlport.hpp (original)
+++ trunk/boost/config/stdlib/stlport.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -16,11 +16,8 @@
 # endif
 #endif
 
-#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__))
+#if !defined(CYGWIN)
 # include <unistd.h>
-# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
-# define BOOST_HAS_FENV_H
-# endif
 #endif
 
 //

Modified: trunk/boost/config/stdlib/vacpp.hpp
==============================================================================
--- trunk/boost/config/stdlib/vacpp.hpp (original)
+++ trunk/boost/config/stdlib/vacpp.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -12,11 +12,8 @@
 #define BOOST_HAS_MACRO_USE_FACET
 #define BOOST_NO_STD_MESSAGES
 
-#if !defined(CYGWIN) && (defined(unix) || defined(__unix) || defined(__unix__))
+#if !defined(CYGWIN)
 # include <unistd.h>
-# if defined(_POSIX_VERSION) || defined(_XOPEN_VERSION)
-# define BOOST_HAS_FENV_H
-# endif
 #endif
 
 // C++0x headers not yet implemented

Modified: trunk/boost/detail/fenv.hpp
==============================================================================
--- trunk/boost/detail/fenv.hpp (original)
+++ trunk/boost/detail/fenv.hpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -7,7 +7,7 @@
 
 #include <boost/config.hpp>
 
-#if !defined(BOOST_HAS_FENV_H)
+#if defined(BOOST_NO_FENV_H)
   #error This platform does not have a floating point environment
 #endif
 

Modified: trunk/libs/config/doc/macro_reference.qbk
==============================================================================
--- trunk/libs/config/doc/macro_reference.qbk (original)
+++ trunk/libs/config/doc/macro_reference.qbk 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -71,6 +71,11 @@
 [[`BOOST_NO_CWCTYPE`][Platform][
 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][
 The compiler fails to compile a nested class that has a dependent base class:
 ``
@@ -399,11 +404,6 @@
 [[`BOOST_HAS_SGI_TYPE_TRAITS`][Compiler, Standard library][
 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][
 The platform has a `<stdint.h>`
 ]]

Added: trunk/libs/config/test/boost_no_fenv_h.ipp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/boost_no_fenv_h.ipp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -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;
+}
+
+}
+

Added: trunk/libs/config/test/no_fenv_h_fail.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/no_fenv_h_fail.cpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -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();
+}
+

Added: trunk/libs/config/test/no_fenv_h_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/config/test/no_fenv_h_pass.cpp 2010-11-27 16:43:52 EST (Sat, 27 Nov 2010)
@@ -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();
+}
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk