forked from boostorg/config
Add BOOST_NO_CXX11_EXCECPTION.
Replaces: https://github.com/boostorg/config/pull/285 Fixes https://github.com/boostorg/config/issues/284 See also: https://github.com/boostorg/exception/issues/10
This commit is contained in:
+4
-1
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Regression test Jamfile for boost configuration setup.
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Sun Apr 21 09:13:03 2019
|
||||
# This file was automatically generated on Fri Aug 23 11:11:12 2019
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@@ -196,6 +196,9 @@ test-suite "BOOST_NO_CXX11_ATOMIC_SMART_PTR" :
|
||||
test-suite "BOOST_NO_CXX11_DEFAULTED_MOVES" :
|
||||
[ run ../no_cxx11_defaulted_moves_pass.cpp ]
|
||||
[ compile-fail ../no_cxx11_defaulted_moves_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_CXX11_HDR_EXCEPTION" :
|
||||
[ run ../no_cxx11_exception_pass.cpp ]
|
||||
[ compile-fail ../no_cxx11_exception_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_CXX11_FINAL" :
|
||||
[ run ../no_cxx11_final_pass.cpp ]
|
||||
[ compile-fail ../no_cxx11_final_fail.cpp ] ;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// (C) Copyright Beman Dawes 2009
|
||||
|
||||
// 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 more information.
|
||||
|
||||
// MACRO: BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
// TITLE: C++11 header <exception> not compatible
|
||||
// DESCRIPTION: The standard library does not provide a C++11 compatible version of <exception>.
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace boost_no_cxx11_hdr_exception {
|
||||
|
||||
int test()
|
||||
{
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
using std::exception_ptr;
|
||||
using std::current_exception;
|
||||
using std::rethrow_exception;
|
||||
return 0;
|
||||
#else
|
||||
std::exception_ptr ep;
|
||||
try
|
||||
{
|
||||
throw 42;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ep = std::current_exception();
|
||||
}
|
||||
try
|
||||
{
|
||||
std::rethrow_exception(ep);
|
||||
}
|
||||
catch (int i)
|
||||
{
|
||||
// return zero on success
|
||||
return i == 42 ? 0 : 1;
|
||||
}
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1107,6 +1107,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_CHRONO);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_CODECVT);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_EXCEPTION);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_FORWARD_LIST);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_FUNCTIONAL);
|
||||
PRINT_MACRO(BOOST_NO_CXX11_HDR_FUTURE);
|
||||
@@ -1231,6 +1232,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_USING_TEMPLATE);
|
||||
PRINT_MACRO(BOOST_NO_VOID_RETURNS);
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
||||
PRINT_MACRO(BOOST_INTEL);
|
||||
|
||||
+11
-1
@@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Sun Apr 21 09:13:03 2019
|
||||
// This file was automatically generated on Fri Aug 23 11:11:12 2019
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@@ -127,6 +127,11 @@ namespace boost_no_cxx11_atomic_smart_ptr = empty_boost;
|
||||
#else
|
||||
namespace boost_no_cxx11_defaulted_moves = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
#include "boost_no_cxx11_exception.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx11_hdr_exception = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_FINAL
|
||||
#include "boost_no_cxx11_final.ipp"
|
||||
#else
|
||||
@@ -1301,6 +1306,11 @@ int main( int, char *[] )
|
||||
std::cerr << "Failed test for BOOST_NO_CXX11_DEFAULTED_MOVES at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_cxx11_hdr_exception::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_CXX11_HDR_EXCEPTION at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_cxx11_final::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_CXX11_FINAL at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Fri Aug 23 11:11:12 2019
|
||||
// by libs/config/tools/generate.cpp
|
||||
// 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.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
// This file should not compile, if it does then
|
||||
// BOOST_NO_CXX11_HDR_EXCEPTION should not be defined.
|
||||
// See file boost_no_cxx11_exception.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_CXX11_HDR_EXCEPTION
|
||||
#include "boost_no_cxx11_exception.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx11_hdr_exception::test();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Fri Aug 23 11:11:12 2019
|
||||
// by libs/config/tools/generate.cpp
|
||||
// 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.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
// This file should compile, if it does not then
|
||||
// BOOST_NO_CXX11_HDR_EXCEPTION should be defined.
|
||||
// See file boost_no_cxx11_exception.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_CXX11_HDR_EXCEPTION
|
||||
#include "boost_no_cxx11_exception.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx11_hdr_exception = empty_boost;
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx11_hdr_exception::test();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user