mirror of
https://github.com/boostorg/system.git
synced 2025-12-25 16:28:05 +01:00
Compare commits
19 Commits
feature/co
...
feature/sy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbd0a3766d | ||
|
|
a9909bb82b | ||
|
|
3bdea5dfa3 | ||
|
|
02ea086173 | ||
|
|
4b7018de85 | ||
|
|
f92c0fc9b7 | ||
|
|
dc5a054d9e | ||
|
|
13199e504c | ||
|
|
3c59cea7ef | ||
|
|
697c73ac57 | ||
|
|
3afc9db9e6 | ||
|
|
e57cca107d | ||
|
|
9e039cfaf9 | ||
|
|
084d8e119e | ||
|
|
0d2aeead38 | ||
|
|
73b2805d63 | ||
|
|
6a71483984 | ||
|
|
2b1aa524d9 | ||
|
|
a9bb21507a |
105
.travis.yml
105
.travis.yml
@@ -109,7 +109,7 @@ matrix:
|
||||
|
||||
- os: linux
|
||||
compiler: g++-7
|
||||
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1
|
||||
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
@@ -117,6 +117,16 @@ matrix:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
||||
@@ -160,6 +170,18 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.6
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
|
||||
@@ -171,6 +193,29 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||
@@ -183,6 +228,17 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
|
||||
@@ -195,6 +251,17 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
|
||||
@@ -207,6 +274,17 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
|
||||
@@ -231,6 +309,29 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-libc++
|
||||
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
|
||||
@@ -267,7 +368,7 @@ install:
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 -j3 libs/system/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on}
|
||||
- ./b2 -j3 libs/system/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
@@ -36,6 +36,13 @@ environment:
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
|
||||
#include <boost/system/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
@@ -43,11 +42,28 @@
|
||||
# define BOOST_SYSTEM_HAS_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8) && __cplusplus >= 201700L
|
||||
#if defined(__GNUC__) && (__GNUC__ == 7 && __GNUC_MINOR__ < 4) && __cplusplus >= 201700L
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83835
|
||||
# undef BOOST_SYSTEM_HAS_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) && defined(_MSC_VER) && defined(_CPPLIB_VER)
|
||||
// Clang on Windows with MSVC headers, the constructor of std::error_category
|
||||
// is not constexpr at least up to VS2017 15.7.x (_MSVC_STL_UPDATE 201803)
|
||||
# undef BOOST_SYSTEM_HAS_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) && defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 40900
|
||||
// The constructor of std::error_category is not constexpr in libstdc++ 4.8
|
||||
# undef BOOST_SYSTEM_HAS_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC < 1920
|
||||
// msvc-14.1 does not implement correct static initialization for
|
||||
// classes with constexpr constructors
|
||||
# undef BOOST_SYSTEM_HAS_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
||||
# define BOOST_SYSTEM_CONSTEXPR constexpr
|
||||
#else
|
||||
@@ -209,13 +225,13 @@ namespace boost
|
||||
|
||||
// class error_category ------------------------------------------------//
|
||||
|
||||
class error_category : public noncopyable
|
||||
class BOOST_SYMBOL_VISIBLE error_category : public noncopyable
|
||||
{
|
||||
#ifndef BOOST_NO_CXX11_HDR_SYSTEM_ERROR
|
||||
|
||||
private:
|
||||
|
||||
class std_category: public std::error_category
|
||||
class BOOST_SYMBOL_VISIBLE std_category: public std::error_category
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -266,7 +282,7 @@ namespace boost
|
||||
|
||||
private:
|
||||
|
||||
class std_category
|
||||
class BOOST_SYMBOL_VISIBLE std_category
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -345,7 +361,7 @@ namespace detail
|
||||
# define BOOST_SYSTEM_DECL_ BOOST_SYSTEM_DECL
|
||||
#endif
|
||||
|
||||
class generic_error_category: public error_category
|
||||
class BOOST_SYMBOL_VISIBLE generic_error_category: public error_category
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -363,7 +379,7 @@ public:
|
||||
BOOST_SYSTEM_DECL_ std::string message( int ev ) const;
|
||||
};
|
||||
|
||||
class system_error_category: public error_category
|
||||
class BOOST_SYMBOL_VISIBLE system_error_category: public error_category
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -442,9 +458,23 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#if defined(BOOST_SYSTEM_SOURCE) || defined(_MSC_VER)
|
||||
|
||||
// clang++ requires a strictly matching declaration
|
||||
// MSVC requires __declspec(dllimport)
|
||||
|
||||
BOOST_SYSTEM_DECL extern system_error_category system_category_instance;
|
||||
BOOST_SYSTEM_DECL extern generic_error_category generic_category_instance;
|
||||
|
||||
#else
|
||||
|
||||
// g++ constexpr requires absence of __declspec(dllimport)
|
||||
|
||||
extern system_error_category system_category_instance;
|
||||
extern generic_error_category generic_category_instance;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
constexpr const error_category & system_category() BOOST_SYSTEM_NOEXCEPT
|
||||
@@ -508,7 +538,7 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
|
||||
|
||||
template <class ErrorConditionEnum>
|
||||
error_condition(ErrorConditionEnum e,
|
||||
typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum> >::type*
|
||||
typename boost::enable_if_<is_error_condition_enum<ErrorConditionEnum>::value>::type*
|
||||
= 0) BOOST_SYSTEM_NOEXCEPT
|
||||
{
|
||||
*this = make_error_condition(e);
|
||||
@@ -523,7 +553,7 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
|
||||
}
|
||||
|
||||
template<typename ErrorConditionEnum>
|
||||
typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum>,
|
||||
typename boost::enable_if_<is_error_condition_enum<ErrorConditionEnum>::value,
|
||||
error_condition>::type &
|
||||
operator=( ErrorConditionEnum val ) BOOST_SYSTEM_NOEXCEPT
|
||||
{
|
||||
@@ -618,7 +648,7 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
|
||||
|
||||
template <class ErrorCodeEnum>
|
||||
error_code(ErrorCodeEnum e,
|
||||
typename boost::enable_if<is_error_code_enum<ErrorCodeEnum> >::type* = 0)
|
||||
typename boost::enable_if_<is_error_code_enum<ErrorCodeEnum>::value>::type* = 0)
|
||||
BOOST_SYSTEM_NOEXCEPT
|
||||
{
|
||||
*this = make_error_code(e);
|
||||
@@ -632,7 +662,7 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
|
||||
}
|
||||
|
||||
template<typename ErrorCodeEnum>
|
||||
typename boost::enable_if<is_error_code_enum<ErrorCodeEnum>, error_code>::type &
|
||||
typename boost::enable_if_<is_error_code_enum<ErrorCodeEnum>::value, error_code>::type &
|
||||
operator=( ErrorCodeEnum val ) BOOST_SYSTEM_NOEXCEPT
|
||||
{
|
||||
*this = make_error_code(val);
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#ifndef BOOST_SYSTEM_SYSTEM_ERROR_HPP
|
||||
#define BOOST_SYSTEM_SYSTEM_ERROR_HPP
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -15,12 +15,8 @@ project
|
||||
<library>/boost/system//boost_system
|
||||
<toolset>msvc:<asynch-exceptions>on
|
||||
;
|
||||
|
||||
lib throw_test
|
||||
: throw_test.cpp
|
||||
: <link>shared:<define>BOOST_SYSTEM_DYN_LINK=1
|
||||
<link>static:<define>BOOST_SYSTEM_STATIC_LINK=1
|
||||
;
|
||||
|
||||
lib throw_test : throw_test.cpp : <link>shared:<define>THROW_DYN_LINK=1 ;
|
||||
|
||||
lib single_instance_lib1 : single_instance_1.cpp : <link>shared:<define>SINGLE_INSTANCE_DYN_LINK ;
|
||||
lib single_instance_lib2 : single_instance_2.cpp : <link>shared:<define>SINGLE_INSTANCE_DYN_LINK ;
|
||||
|
||||
@@ -32,7 +32,7 @@ BOOST_STATIC_ASSERT( e2.category() == generic_category() );
|
||||
BOOST_STATIC_ASSERT( e2 );
|
||||
BOOST_STATIC_ASSERT( e2 == e2 );
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 80000)
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 80200)
|
||||
|
||||
BOOST_STATIC_ASSERT( e1 != e2 );
|
||||
|
||||
@@ -45,7 +45,7 @@ BOOST_STATIC_ASSERT( e3.category() == system_category() );
|
||||
BOOST_STATIC_ASSERT( !e3 );
|
||||
BOOST_STATIC_ASSERT( e3 == e3 );
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 80000)
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 80200)
|
||||
|
||||
BOOST_STATIC_ASSERT( e1 != e3 );
|
||||
|
||||
|
||||
@@ -19,22 +19,15 @@
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/system/system_error.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
BOOST_SYSTEM_DECL void throw_test();
|
||||
}
|
||||
}
|
||||
void throw_test();
|
||||
|
||||
int main()
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::system::throw_test();
|
||||
throw_test();
|
||||
}
|
||||
catch (const boost::system::system_error& ex)
|
||||
{
|
||||
@@ -42,7 +35,6 @@ int main()
|
||||
std::cout << " what() reports " << ex.what() << '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
catch (const std::runtime_error& ex)
|
||||
{
|
||||
std::cout << " error: caught std::runtime_error instead of boost::system::system_error\n";
|
||||
@@ -52,4 +44,4 @@ int main()
|
||||
|
||||
std::cout << " error: failed to catch boost::system::system_error\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,19 +13,16 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// define BOOST_SYSTEM_SOURCE so that <boost/system/config.hpp> knows
|
||||
// the library is being built (possibly exporting rather than importing code)
|
||||
#define BOOST_SYSTEM_SOURCE
|
||||
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
#if defined(THROW_DYN_LINK)
|
||||
# define EXPORT BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
# define EXPORT
|
||||
#endif
|
||||
|
||||
EXPORT void throw_test()
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
BOOST_SYSTEM_DECL void throw_test()
|
||||
{
|
||||
throw system_error(9999, system_category(), "boo boo");
|
||||
}
|
||||
}
|
||||
throw boost::system::system_error( 9999, boost::system::system_category(), "boo boo" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user