diff --git a/config.htm b/config.htm index ded13abe..602841f8 100644 --- a/config.htm +++ b/config.htm @@ -554,6 +554,12 @@ struct foo : { class X { ... }; + + BOOST_NO_EXCEPTION_STD_NAMESPACE + Standard Library + The standard library does not put some or all of the + contents of <exception> in namespace std. + BOOST_NO_EXCEPTIONS Compiler @@ -894,6 +900,12 @@ present.

The platform has an <nl_types.h>. + + BOOST_HAS_PARTIAL_STD_ALLOCATOR + Standard Library + The standard library has a partially conforming std::allocator + class, but without any of the member templates. + BOOST_HAS_PTHREAD_DELAY_NP Platform diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index cdc3c5d2..3b2cc12e 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -30,6 +30,8 @@ # define BOOST_HAS_TWO_ARG_USE_FACET // C lib functions aren't in namespace std either: # define BOOST_NO_STDC_NAMESPACE + // and nor is +# define BOOST_NO_EXCEPTION_STD_NAMESPACE # endif // 3.06 appears to have (non-sgi versions of) & , // and no at all diff --git a/include/boost/config/stdlib/stlport.hpp b/include/boost/config/stdlib/stlport.hpp index acea6c1f..ccc40bf9 100644 --- a/include/boost/config/stdlib/stlport.hpp +++ b/include/boost/config/stdlib/stlport.hpp @@ -64,6 +64,10 @@ # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS # define BOOST_NO_STD_ALLOCATOR #endif +// +// however we always have at least a partial allocator: +// +#define BOOST_HAS_PARTIAL_STD_ALLOCATOR #if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) # define BOOST_NO_STD_ALLOCATOR @@ -99,6 +103,7 @@ || defined(_STLP_USE_OWN_NAMESPACE)) \ && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD)) # define BOOST_NO_STDC_NAMESPACE +# define BOOST_NO_EXCEPTION_STD_NAMESPACE # endif #elif __BORLANDC__ < 0x560 // STLport doesn't import std::abs correctly: diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index abffd3b0..332527f6 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -132,6 +132,13 @@ # define BOOST_NO_STD_ALLOCATOR # endif +// +// If we have a standard allocator, then we have a partial one as well: +// +#if !defined(BOOST_NO_STD_ALLOCATOR) +# define BOOST_HAS_PARTIAL_STD_ALLOCATOR +#endif + // // We can't have a working std::use_facet if there is no std::locale: // diff --git a/test/boost_has_part_alloc.ipp b/test/boost_has_part_alloc.ipp new file mode 100644 index 00000000..b4fc3fcf --- /dev/null +++ b/test/boost_has_part_alloc.ipp @@ -0,0 +1,59 @@ +// (C) Copyright John Maddock 2001. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// MACRO: BOOST_HAS_PARTIAL_STD_ALLOCATOR +// TITLE: limited std::allocator support +// DESCRIPTION: The std lib has at least some kind of stanfard allocator +// with allocate/deallocate members and probably not much more. + +#include + +namespace boost_has_partial_std_allocator{ + +// +// test everything except rebind template members: +// + +template +int test_allocator(const T& i) +{ + typedef std::allocator alloc1_t; + typedef typename alloc1_t::size_type size_type; + typedef typename alloc1_t::difference_type difference_type; + typedef typename alloc1_t::pointer pointer; + typedef typename alloc1_t::const_pointer const_pointer; + typedef typename alloc1_t::reference reference; + typedef typename alloc1_t::const_reference const_reference; + typedef typename alloc1_t::value_type value_type; + + alloc1_t a1; + + pointer p = a1.allocate(1); + const_pointer cp = p; + a1.construct(p,i); + size_type s = a1.max_size(); + (void)s; + reference r = *p; + const_reference cr = *cp; + if(p != a1.address(r)) return -1; + if(cp != a1.address(cr)) return -1; + a1.destroy(p); + a1.deallocate(p,1); + + return 0; +} + + +int test() +{ + return test_allocator(0); +} + +} + + + + + diff --git a/test/boost_no_excep_std.ipp b/test/boost_no_excep_std.ipp new file mode 100644 index 00000000..ee8c2125 --- /dev/null +++ b/test/boost_no_excep_std.ipp @@ -0,0 +1,32 @@ +// (C) Copyright John Maddock 2001. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// MACRO: BOOST_NO_EXCEPTION_STD_NAMESPACE +// TITLE: is in namespace std +// DESCRIPTION: Some std libs don't put the contents of +// in namespace std. + +#include + +namespace boost_no_exception_std_namespace{ + +int t(int i) +{ + if(i) + std::terminate(); + return 0; +} + +int test() +{ + return t(0); +} + +} + + + + + diff --git a/test/config_test.cpp b/test/config_test.cpp index cc77a9c2..7025696f 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -10,7 +10,7 @@ // Do not edit this file, it was generated automatically by // ../tools/generate from boost_*.cxx on -// Thu Jul 18 11:26:48 2002 +// Tue Aug 13 12:19:31 2002 #include #define BOOST_INCLUDE_MAIN @@ -67,6 +67,11 @@ namespace boost_no_dependent_nested_derivations = empty_boost; #else namespace boost_no_dependent_types_in_template_value_parameters = empty_boost; #endif +#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE +#include "boost_no_excep_std.cxx" +#else +namespace boost_no_exception_std_namespace = empty_boost; +#endif #ifndef BOOST_NO_EXCEPTIONS #include "boost_no_exceptions.cxx" #else @@ -307,6 +312,11 @@ namespace boost_has_nanosleep = empty_boost; #else namespace boost_has_nl_types_h = empty_boost; #endif +#ifdef BOOST_HAS_PARTIAL_STD_ALLOCATOR +#include "boost_has_part_alloc.cxx" +#else +namespace boost_has_partial_std_allocator = empty_boost; +#endif #ifdef BOOST_HAS_PTHREAD_DELAY_NP #include "boost_has_pthread_delay_np.cxx" #else @@ -411,6 +421,7 @@ int test_main( int, char *[] ) BOOST_TEST(0 == boost_no_function_template_ordering::test()); BOOST_TEST(0 == boost_no_explicit_function_template_arguments::test()); BOOST_TEST(0 == boost_no_exceptions::test()); + BOOST_TEST(0 == boost_no_exception_std_namespace::test()); BOOST_TEST(0 == boost_no_dependent_types_in_template_value_parameters::test()); BOOST_TEST(0 == boost_no_dependent_nested_derivations::test()); BOOST_TEST(0 == boost_no_cwctype::test()); @@ -434,6 +445,7 @@ int test_main( int, char *[] ) BOOST_TEST(0 == boost_has_pthread_yield::test()); BOOST_TEST(0 == boost_has_pthread_mutexattr_settype::test()); BOOST_TEST(0 == boost_has_pthread_delay_np::test()); + BOOST_TEST(0 == boost_has_partial_std_allocator::test()); BOOST_TEST(0 == boost_has_nl_types_h::test()); BOOST_TEST(0 == boost_has_nanosleep::test()); BOOST_TEST(0 == boost_has_ms_int64::test()); diff --git a/test/has_part_alloc_fail.cpp b/test/has_part_alloc_fail.cpp new file mode 100644 index 00000000..c3cede17 --- /dev/null +++ b/test/has_part_alloc_fail.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Test file for macro BOOST_HAS_PARTIAL_STD_ALLOCATOR +// This file should not compile, if it does then +// BOOST_HAS_PARTIAL_STD_ALLOCATOR may be defined. +// see boost_has_part_alloc.cxx for more details + +// Do not edit this file, it was generated automatically by +// ../tools/generate from boost_has_part_alloc.cxx on +// Tue Aug 13 12:19:31 2002 + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include +#include "test.hpp" + +#ifndef BOOST_HAS_PARTIAL_STD_ALLOCATOR +#include "boost_has_part_alloc.cxx" +#else +#error "this file should not compile" +#endif + +int cpp_main( int, char *[] ) +{ + return boost_has_partial_std_allocator::test(); +} + diff --git a/test/has_part_alloc_pass.cpp b/test/has_part_alloc_pass.cpp new file mode 100644 index 00000000..9b78a614 --- /dev/null +++ b/test/has_part_alloc_pass.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Test file for macro BOOST_HAS_PARTIAL_STD_ALLOCATOR +// This file should compile, if it does not then +// BOOST_HAS_PARTIAL_STD_ALLOCATOR should not be defined. +// see boost_has_part_alloc.cxx for more details + +// Do not edit this file, it was generated automatically by +// ../tools/generate from boost_has_part_alloc.cxx on +// Tue Aug 13 12:19:31 2002 + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include +#include "test.hpp" + +#ifdef BOOST_HAS_PARTIAL_STD_ALLOCATOR +#include "boost_has_part_alloc.cxx" +#else +namespace boost_has_partial_std_allocator = empty_boost; +#endif + +int cpp_main( int, char *[] ) +{ + return boost_has_partial_std_allocator::test(); +} + diff --git a/test/no_excep_std_fail.cpp b/test/no_excep_std_fail.cpp new file mode 100644 index 00000000..1f434e4a --- /dev/null +++ b/test/no_excep_std_fail.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Test file for macro BOOST_NO_EXCEPTION_STD_NAMESPACE +// This file should not compile, if it does then +// BOOST_NO_EXCEPTION_STD_NAMESPACE need not be defined. +// see boost_no_excep_std.cxx for more details + +// Do not edit this file, it was generated automatically by +// ../tools/generate from boost_no_excep_std.cxx on +// Tue Aug 13 12:19:31 2002 + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include +#include "test.hpp" + +#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE +#include "boost_no_excep_std.cxx" +#else +#error "this file should not compile" +#endif + +int cpp_main( int, char *[] ) +{ + return boost_no_exception_std_namespace::test(); +} + diff --git a/test/no_excep_std_pass.cpp b/test/no_excep_std_pass.cpp new file mode 100644 index 00000000..8bfb3a8f --- /dev/null +++ b/test/no_excep_std_pass.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Test file for macro BOOST_NO_EXCEPTION_STD_NAMESPACE +// This file should compile, if it does not then +// BOOST_NO_EXCEPTION_STD_NAMESPACE needs to be defined. +// see boost_no_excep_std.cxx for more details + +// Do not edit this file, it was generated automatically by +// ../tools/generate from boost_no_excep_std.cxx on +// Tue Aug 13 12:19:31 2002 + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include +#include "test.hpp" + +#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE +#include "boost_no_excep_std.cxx" +#else +namespace boost_no_exception_std_namespace = empty_boost; +#endif + +int cpp_main( int, char *[] ) +{ + return boost_no_exception_std_namespace::test(); +} + diff --git a/test/regression.cfg b/test/regression.cfg index 878d22a4..cc9a4a07 100644 --- a/test/regression.cfg +++ b/test/regression.cfg @@ -25,6 +25,8 @@ run libs/config/test/no_dep_nested_class_pass.cpp link-fail libs/config/test/no_dep_nested_class_fail.cpp run libs/config/test/no_dep_val_param_pass.cpp link-fail libs/config/test/no_dep_val_param_fail.cpp +run libs/config/test/no_excep_std_pass.cpp +link-fail libs/config/test/no_excep_std_fail.cpp run libs/config/test/no_exceptions_pass.cpp link-fail libs/config/test/no_exceptions_fail.cpp run libs/config/test/no_exp_func_tem_arg_pass.cpp @@ -121,6 +123,8 @@ run libs/config/test/has_nanosleep_pass.cpp link-fail libs/config/test/has_nanosleep_fail.cpp run libs/config/test/has_nl_types_h_pass.cpp link-fail libs/config/test/has_nl_types_h_fail.cpp +run libs/config/test/has_part_alloc_pass.cpp +link-fail libs/config/test/has_part_alloc_fail.cpp run libs/config/test/has_pthread_delay_np_pass.cpp link-fail libs/config/test/has_pthread_delay_np_fail.cpp run libs/config/test/has_pthread_ma_st_pass.cpp