forked from boostorg/config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added defect macro BOOST_NO_CXX11_HDR_EXCEPTION Should be #define'd when: The standard library does not provide a C++11 compatible version of <exception>. To solve Boost.Exception issue boostorg/exception#10 I need to detect compiler support for C++11 compliant: - std::exception_ptr - std::current_exception() - std::rethrow_exception()
- Loading branch information
1 parent
f76000b
commit 7e9fd9f
Showing
10 changed files
with
144 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// (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> unavailable | ||
// DESCRIPTION: The standard library does not provide a C++11 compatible version of <exception>. | ||
|
||
#include <exception> | ||
|
||
namespace boost_no_cxx11_hdr_exception { | ||
|
||
int test() | ||
{ | ||
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file was automatically generated on Tue Jun 4 10:08:17 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_hdr_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_hdr_exception.ipp" | ||
#else | ||
#error "this file should not compile" | ||
#endif | ||
|
||
int main( int, char *[] ) | ||
{ | ||
return boost_no_cxx11_hdr_exception::test(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file was automatically generated on Tue Jun 4 10:08:17 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_hdr_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_hdr_exception.ipp" | ||
#else | ||
namespace boost_no_cxx11_hdr_exception = empty_boost; | ||
#endif | ||
|
||
int main( int, char *[] ) | ||
{ | ||
return boost_no_cxx11_hdr_exception::test(); | ||
} | ||
|