forked from boostorg/config
Added new config macros:
BOOST_HAS_PARTIAL_STD_ALLOCATOR BOOST_NO_EXCEPTION_STD_NAMESPACE [SVN r14809]
This commit is contained in:
@@ -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 <memory>
|
||||
|
||||
namespace boost_has_partial_std_allocator{
|
||||
|
||||
//
|
||||
// test everything except rebind template members:
|
||||
//
|
||||
|
||||
template <class T>
|
||||
int test_allocator(const T& i)
|
||||
{
|
||||
typedef std::allocator<int> 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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: <exception> is in namespace std
|
||||
// DESCRIPTION: Some std libs don't put the contents of
|
||||
// <exception> in namespace std.
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace boost_no_exception_std_namespace{
|
||||
|
||||
int t(int i)
|
||||
{
|
||||
if(i)
|
||||
std::terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test()
|
||||
{
|
||||
return t(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+13
-1
@@ -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 <boost/config.hpp>
|
||||
#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());
|
||||
|
||||
@@ -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 <boost/config.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#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();
|
||||
}
|
||||
|
||||
@@ -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 <boost/config.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#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();
|
||||
}
|
||||
|
||||
@@ -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 <boost/config.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#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();
|
||||
}
|
||||
|
||||
@@ -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 <boost/config.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user