From da757049e5a8cec26faabfc95a407add90e8ad79 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Fri, 7 Feb 2014 10:01:12 -0800 Subject: [PATCH] misc fixes in tests to condition of C++11 support another fix for S Kelly fiasco. --- include/boost/archive/basic_binary_oarchive.hpp | 6 ++++++ include/boost/serialization/array.hpp | 3 ++- test/test_array.cpp | 6 ++++-- test/test_map.cpp | 8 ++++++++ test/test_set.cpp | 8 ++++++-- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/include/boost/archive/basic_binary_oarchive.hpp b/include/boost/archive/basic_binary_oarchive.hpp index a3ad05c6..34a0a9b5 100644 --- a/include/boost/archive/basic_binary_oarchive.hpp +++ b/include/boost/archive/basic_binary_oarchive.hpp @@ -63,7 +63,13 @@ class basic_binary_oarchive : public archive::detail::common_oarchive { protected: +#if BOOST_WORKAROUND(BOOST_MSVC, < 1600) + // for some inexplicable reason insertion of "class" generates compile error + // on msvc versions befor 9.0 + friend detail::interface_oarchive; +#else friend class detail::interface_oarchive; +#endif // any datatype not specifed below will be handled by base class typedef detail::common_oarchive detail_common_oarchive; template diff --git a/include/boost/serialization/array.hpp b/include/boost/serialization/array.hpp index a7fc9967..ab8632f5 100644 --- a/include/boost/serialization/array.hpp +++ b/include/boost/serialization/array.hpp @@ -6,13 +6,14 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include // msvc 6.0 needs this for warning suppression + #include #include // std::size_t #ifndef BOOST_NO_CXX11_HDR_ARRAY #include #endif -#include // msvc 6.0 needs this for warning suppression #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; diff --git a/test/test_array.cpp b/test/test_array.cpp index 801bb5dc..5cd5025c 100644 --- a/test/test_array.cpp +++ b/test/test_array.cpp @@ -8,6 +8,8 @@ // should pass compilation and execution +#include + #include #include #ifndef BOOST_NO_CXX11_HDR_ARRAY @@ -15,7 +17,6 @@ #endif #include // equal #include // remove -#include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::remove; @@ -204,8 +205,9 @@ int test_main( int /* argc */, char* /* argv */[] ) res = test_std_array(); if (res != EXIT_SUCCESS) return EXIT_FAILURE; - return EXIT_SUCCESS; #endif + + return EXIT_SUCCESS; } // EOF diff --git a/test/test_map.cpp b/test/test_map.cpp index 3c748e69..fa2ab226 100644 --- a/test/test_map.cpp +++ b/test/test_map.cpp @@ -215,6 +215,8 @@ test_hash_multimap(){ } #endif +#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP + #include #include // requires changeset [69520]; Ticket #5254 @@ -290,17 +292,23 @@ test_unordered_multimap(){ std::remove(testfile); } +#endif int test_main( int /* argc */, char* /* argv */[] ) { test_map(); test_map_2(); test_multimap(); + #ifdef BOOST_HAS_HASH test_hash_map(); test_hash_multimap(); #endif + + #ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP test_unordered_map(); test_unordered_multimap(); + #endif + return EXIT_SUCCESS; } diff --git a/test/test_set.cpp b/test/test_set.cpp index 66458209..8379c77f 100644 --- a/test/test_set.cpp +++ b/test/test_set.cpp @@ -165,7 +165,8 @@ test_hash_multiset(){ } #endif -#ifndef BOOST_NO_CXX11_STD_UNORDERED +#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET + #include #include // requires changeset [69520]; Ticket #5254 @@ -246,13 +247,16 @@ test_unordered_multiset(){ int test_main( int /* argc */, char* /* argv */[] ){ test_set(); test_multiset(); + #ifdef BOOST_HAS_HASH test_hash_set(); test_hash_multiset(); #endif - #ifndef BOOST_NO_CXX11_STD_UNORDERED + + #ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET test_unordered_set(); test_unordered_multiset(); #endif + return EXIT_SUCCESS; }