forked from boostorg/exception
Compare commits
380 Commits
boost-1.55
...
boost-1.73
Author | SHA1 | Date | |
---|---|---|---|
ff0bcc1d85 | |||
c07417af68 | |||
9197b6a880 | |||
012921be43 | |||
0353b975f8 | |||
bd1a6ee1bb | |||
93692697ef | |||
120b35fde2 | |||
a5a8e865c0 | |||
81e9a137eb | |||
3f6ff1a8bf | |||
af98afb3d1 | |||
f68cd7b2d4 | |||
e8c57591a3 | |||
c4e5f44e94 | |||
1f90ecc324 | |||
820338c36b | |||
9c8f2b6400 | |||
6bc76ee326 | |||
0036e62dce | |||
9d8f16f4e6 | |||
87f0473396 | |||
d0963a7cf6 | |||
80ad850f3a | |||
8e61e8e9fd | |||
c44bdae6ac | |||
bfddc104c6 | |||
f1af13409d | |||
2aaa7975b6 | |||
90694bc3b9 | |||
b63736ac89 | |||
1a7ac9174a | |||
ef4f541a8a | |||
688f6238f1 | |||
5025e2ca18 | |||
457330f286 | |||
8d19f99e43 | |||
f4e1a11e6b | |||
607268dd8e | |||
386f5507cb | |||
e3590d89af | |||
c87b9c55b1 | |||
de6cef966b | |||
2a2557b903 | |||
50899b8f1b | |||
dcd2d83b34 | |||
38cdb50eb2 | |||
d29b6bc1a2 | |||
1a0e643211 | |||
32d831c4b2 | |||
7599ec73a2 | |||
e0d31c79ab | |||
4824ef856f | |||
bed7f3147f | |||
73f3e4796e | |||
c8fbbb9d11 | |||
464e7f9d09 | |||
991d600f01 | |||
10550b69d4 | |||
cf05dc079b | |||
4ea8555871 | |||
36af19fa50 | |||
0eee187876 | |||
e8877d4837 | |||
d39ba00088 | |||
972667f52e | |||
406d3c87f7 | |||
6d1c2c434b | |||
59666dcdb0 | |||
07d5ef529b | |||
2cdbdfcf4e | |||
32a3bda6cc | |||
119dbf688f | |||
66b39f3136 | |||
e1fc48ef3d | |||
da0f861b05 | |||
14d3b01c60 | |||
6cf231330a | |||
e1378f7aef | |||
27598f92db | |||
44fcc63f36 | |||
c1e2284628 | |||
3003123b2b | |||
c1dc3b8dcb | |||
dac601519d | |||
1afb7e0372 | |||
c57eefbf42 | |||
5a040eedf5 | |||
c1f6b743e4 | |||
e5e4652b75 | |||
af4de75bac | |||
38bfc39d10 | |||
5dea76a301 | |||
8931eb2e0d | |||
2de5a8f4dd | |||
fe3b1807b8 | |||
73c3cb7e46 | |||
a129725e3e | |||
a823cbe32a | |||
7f937491f0 | |||
4de3efa73d | |||
dc07696fd9 | |||
fdbb57b197 | |||
c030775c84 | |||
29b0b87b6a | |||
4edba2f8be | |||
8f097eb241 | |||
7062572c8f | |||
b2221bf92d | |||
73687f1f0f | |||
f6c1ebece0 | |||
432b3090fe | |||
ac5ebbcd45 | |||
2a68f099bf | |||
e97bcb4c56 | |||
831f73599a | |||
9e012e1fdf | |||
9b100b0c9d | |||
2ebfd49b4f | |||
9508b38e22 | |||
e25f33aaf6 | |||
c2c1728a5b | |||
886e9ee793 | |||
4cdfbb9ec6 | |||
b43961cf94 | |||
6fe16d80ef | |||
b3640aa019 | |||
41ce8a3322 | |||
c3e35e9d37 | |||
439ef89742 | |||
3d10233a6b | |||
f576e14dbc | |||
192ffd0379 | |||
d4acff61be | |||
875bc71581 | |||
c7bae18633 | |||
b053deaf22 | |||
32e2b33250 | |||
5f6812b226 | |||
f6e9b5808a | |||
9bab07e9bc | |||
cc0d73af9d | |||
24f3292606 | |||
fb4ed73b5e | |||
a74d041bd5 | |||
08f65cca73 | |||
d1065c8a13 | |||
6b0bfad6bf | |||
c210c38dae | |||
f1a4e59469 | |||
e43210c417 | |||
56ae4311bb | |||
6d41b399d0 | |||
b48a7933c7 | |||
c98deb1e40 | |||
976e89a137 | |||
d637e8efc7 | |||
12903d4e49 | |||
3b4cdfce47 | |||
5dbd4c8f32 | |||
17304c365c | |||
79964f73df | |||
9090f38cde | |||
65845c7252 | |||
2bd34963cd | |||
177fce2389 | |||
8897ff6586 | |||
787fb1f148 | |||
ad829e590a | |||
c251404656 | |||
f10defd7a2 | |||
11661f05d3 | |||
42b5b4b899 | |||
8a8705542f | |||
d3c27315d1 | |||
f6588caf4e | |||
c5230be656 | |||
0cebd7efbf | |||
2f18eef27a | |||
37c31a6622 | |||
2bbd6ae7b5 | |||
3013e991f1 | |||
1af9381775 | |||
a955aa431e | |||
ab7a4ebb1a | |||
6b30091ee3 | |||
2dc075e6e8 | |||
4ae002cbf8 | |||
9dee0fb9e6 | |||
3911cd2472 | |||
6a92851a38 | |||
21ecbb3614 | |||
9d499676ae | |||
58a49ff77e | |||
dc75da0dc4 | |||
a870f8651b | |||
8d24c87032 | |||
3ab1c234f5 | |||
5630262c4d | |||
e299f609b5 | |||
4756dc6fe7 | |||
baece0983f | |||
17951c2b7d | |||
2c0599b885 | |||
da4f20e998 | |||
c25d7d2ba0 | |||
9683159e5c | |||
920ae71b00 | |||
fa96125efb | |||
7b4290bc76 | |||
0003622f9d | |||
96ed20d2d7 | |||
96e2ac573a | |||
a674ec2bb9 | |||
33bfe0bf65 | |||
f2d6ca64da | |||
2b34528ef0 | |||
953399846a | |||
bd0ed9f83b | |||
a0614793b3 | |||
bd19b50db3 | |||
e2882e8251 | |||
19b67c4983 | |||
bfaa9b404e | |||
e7c9f21a93 | |||
2b9c154563 | |||
8465a47472 | |||
0372936d86 | |||
d692895aab | |||
9cee59551d | |||
1643ad2e81 | |||
15c0ff6130 | |||
bec171e234 | |||
0ddded8e41 | |||
2c959a4e43 | |||
0e1e2ad515 | |||
90782a9fe6 | |||
25948347fe | |||
e020b0f282 | |||
f80f55143e | |||
bb8a3d3fff | |||
6da7fed23a | |||
c9d1d02ec3 | |||
2d5be208de | |||
e45ffc810e | |||
37c1020bc4 | |||
6aa4d2f93b | |||
87384d2116 | |||
b2e31a640e | |||
88c2d1f228 | |||
338ce71238 | |||
2649e88c52 | |||
17f36e5962 | |||
3070a53e01 | |||
62c6967dd2 | |||
4ebbc111b9 | |||
d2c197d4e6 | |||
6e909aaf58 | |||
304003832f | |||
f8b8c60d69 | |||
d6ddb02ff7 | |||
0058740bab | |||
e93f4b811a | |||
f6f09c16cd | |||
aef7275c0f | |||
cd1cb71367 | |||
f28285c073 | |||
b52e6c7d6b | |||
5d92a68e68 | |||
8e75a12330 | |||
4182c3634e | |||
717997e014 | |||
7c47c0be86 | |||
ffa2e8d9e7 | |||
4cb98696a6 | |||
1c5df6b59a | |||
2cde7922b2 | |||
da0c1fa744 | |||
f89533b81f | |||
a42693427f | |||
a416168862 | |||
b5fc84025b | |||
c37744a228 | |||
76380aa2f6 | |||
29fc99b378 | |||
49395913d0 | |||
475dbd4021 | |||
d094c3f41c | |||
fc101598ba | |||
783a0530ba | |||
6aecfeca3f | |||
546f093a33 | |||
f07a5a5923 | |||
474ed15d35 | |||
8310c9831f | |||
5a9532783d | |||
353bb95e2c | |||
2887a719c8 | |||
31a9264bf9 | |||
b84fb75a60 | |||
9a35c999a2 | |||
c50fd487fe | |||
ab0c20a846 | |||
5d4c014f5b | |||
5c84929742 | |||
6fc0e3ac1e | |||
6c3f38c45d | |||
85e3d1f5c3 | |||
f12d40765b | |||
f2b14ffa98 | |||
fecfa21877 | |||
23923c1045 | |||
9dd2d64304 | |||
e1aba12621 | |||
5258fbc2d1 | |||
0c9d70964e | |||
d7b98ba390 | |||
70a910d82c | |||
850b7d9618 | |||
14765312e2 | |||
e05771c0c4 | |||
8c89aef48e | |||
2b457b1656 | |||
09c3747408 | |||
88ef777088 | |||
d7722921a7 | |||
044d5767e2 | |||
9ddb810b95 | |||
b1fbc58a9f | |||
b8ae58b904 | |||
475f37b9c4 | |||
d0febca84b | |||
ad1ef37b81 | |||
640d6cfc58 | |||
87b1b323d8 | |||
f58ffdd643 | |||
1d776ff363 | |||
d54052b137 | |||
175c3e50e9 | |||
421a059421 | |||
3b2a6a2711 | |||
d04ddee87a | |||
8328f20b1a | |||
9f8623a2c9 | |||
f243fadab2 | |||
ebc9563ed0 | |||
ec0ae8105d | |||
7cc96d23ec | |||
cde6de22d9 | |||
5ffd47553f | |||
4900711406 | |||
d4a15cd9db | |||
e1056d2f4a | |||
cc7d466f5d | |||
f3cfeeee57 | |||
b5877b8d9a | |||
487235a7cc | |||
0dec4fed2c | |||
628b06a2fa | |||
ce9a26634c | |||
a61063b8f5 | |||
79f0253d94 | |||
b1b9478cbc | |||
4ae983f5f0 | |||
eb7a736198 | |||
f29f86f65c | |||
c61e655ada | |||
08607bca72 | |||
9bac76a06d | |||
92fbda9a88 | |||
bf5e44f798 | |||
ec40d3d8ad | |||
761ae0bc1e | |||
3c7f53176f | |||
65d278a387 | |||
0fbc4dc974 | |||
e0881a603d | |||
e961744baf | |||
45fe1f6289 | |||
bf515d83ca |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.vscode/ipch/*
|
||||
/.vscode/settings.json
|
399
.travis.yml
Normal file
399
.travis.yml
Normal file
@ -0,0 +1,399 @@
|
||||
# Copyright 2016-2018 Peter Dimov
|
||||
# Copyright 2018-2019 Emil Dotchevski
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
dist: trusty
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /^feature.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
- g++-5
|
||||
- g++-6
|
||||
- clang-3.6
|
||||
- clang-3.7
|
||||
- clang-3.8
|
||||
- ruby-full
|
||||
# - python-3.6
|
||||
- ninja-build
|
||||
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise
|
||||
- llvm-toolchain-precise-3.6
|
||||
- llvm-toolchain-precise-3.7
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode11.2
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode11.1
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode11
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.3
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.2
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.4
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.3
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.1
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8.3
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.7
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=98,03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.8
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=98,03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.9
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=98,03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-6
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=98,03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=98,03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.3
|
||||
|
||||
- os: linux
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.4
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.5
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.6
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=98,03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=98,03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=98,03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-8
|
||||
|
||||
- os: linux
|
||||
dist: xenial
|
||||
compiler: clang++-9
|
||||
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=98,03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-8
|
||||
|
||||
install:
|
||||
- gem install asciidoctor
|
||||
- gem install coderay
|
||||
- cd ..
|
||||
- git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init tools/inspect
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- rm -rf libs/exception
|
||||
- mkdir libs/exception
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/exception
|
||||
- python tools/boostdep/depinst/depinst.py exception
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
- cd libs/exception
|
||||
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
- ../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
30
CMakeLists.txt
Normal file
30
CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
||||
# Copyright 2019 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
# NOTE: CMake support for Boost.Exception is currently experimental at best
|
||||
# and the interface is likely to change in the future
|
||||
|
||||
cmake_minimum_required( VERSION 3.5 )
|
||||
project( BoostException LANGUAGES CXX )
|
||||
|
||||
# We treat Boost.Exception as header only for now.
|
||||
# See https://github.com/boostorg/exception/pull/17
|
||||
# for more information.
|
||||
|
||||
add_library( boost_exception INTERFACE )
|
||||
add_library( Boost::exception ALIAS boost_exception )
|
||||
|
||||
target_include_directories( boost_exception INTERFACE include )
|
||||
|
||||
target_link_libraries( boost_exception
|
||||
INTERFACE
|
||||
Boost::assert
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::smart_ptr
|
||||
Boost::throw_exception
|
||||
Boost::tuple
|
||||
Boost::type_traits
|
||||
)
|
||||
|
69
appveyor.yml
Normal file
69
appveyor.yml
Normal file
@ -0,0 +1,69 @@
|
||||
# Copyright 2016-2019 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-12.0,msvc-14.0
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: clang-win
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: msvc-14.2
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
|
||||
install:
|
||||
- set BOOST_BRANCH=develop
|
||||
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||
- cd ..
|
||||
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init libs/headers
|
||||
- git submodule update --init tools/boostdep
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\exception\
|
||||
- python tools/boostdep/depinst/depinst.py exception
|
||||
- cmd /c bootstrap
|
||||
- b2 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- PATH=%ADDPATH%%PATH%
|
||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||
- b2 -j3 libs/exception/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release
|
@ -38,7 +38,7 @@ boost
|
||||
<p>Nothing.</p>
|
||||
<h4>Notes:</h4>
|
||||
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink">current_exception</span> refer to the same exception object.</li>
|
||||
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
|
||||
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support (e.g. C++11 <a href="https://en.cppreference.com/w/cpp/error/current_exception">std::current_exception()</a> is used when available, as specified by Boost.Config BOOST_NO_CXX11_HDR_EXCEPTION), unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
|
||||
<li> if available, the exception contains the std::type_info of the original exception object, accessible through <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><<span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>>.</li>
|
||||
</ul></div>
|
||||
</li>
|
||||
|
15372
doc/source/boost-exception.reno
Normal file
15372
doc/source/boost-exception.reno
Normal file
File diff suppressed because it is too large
Load Diff
21
doc/source/html_prefix.txt
Normal file
21
doc/source/html_prefix.txt
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>%s</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under 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) -->
|
16
doc/source/html_suffix.txt
Normal file
16
doc/source/html_suffix.txt
Normal file
@ -0,0 +1,16 @@
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under 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) -->
|
||||
<div id="footer">
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -35,14 +35,14 @@ error: //Base for all exception objects we throw.
|
||||
public:
|
||||
|
||||
char const *
|
||||
what() const throw()
|
||||
what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return "example_io error";
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
~error() throw()
|
||||
~error() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -3,15 +3,10 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
|
||||
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_316FDA946C0D11DEA9CBAE5255D89593
|
||||
#define BOOST_EXCEPTION_316FDA946C0D11DEA9CBAE5255D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/error_info.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
@ -29,8 +24,4 @@
|
||||
#include <boost/exception/errinfo_nested_exception.hpp>
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -3,14 +3,20 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_7E83C166200811DE885E826156D89593
|
||||
#define UUID_7E83C166200811DE885E826156D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifndef BOOST_EXCEPTION_7E83C166200811DE885E826156D89593
|
||||
#define BOOST_EXCEPTION_7E83C166200811DE885E826156D89593
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -1,17 +0,0 @@
|
||||
//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_61531AB0680611DEADD5846855D89593
|
||||
#define UUID_61531AB0680611DEADD5846855D89593
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
|
||||
#elif defined(__GNUC__)
|
||||
#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
#define BOOST_ATTRIBUTE_NORETURN
|
||||
#endif
|
||||
|
||||
#endif
|
@ -3,14 +3,20 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_81522C0EB56511DFAB613DB0DFD72085
|
||||
#define UUID_81522C0EB56511DFAB613DB0DFD72085
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifndef BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
|
||||
#define BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
# error This header requires exception handling to be enabled.
|
||||
|
@ -3,16 +3,27 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_CE6983AC753411DDA764247956D89593
|
||||
#define UUID_CE6983AC753411DDA764247956D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifndef BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
|
||||
#define BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
||||
#endif
|
||||
#include <utility>
|
||||
#include <string>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
@ -26,11 +37,10 @@ boost
|
||||
public:
|
||||
|
||||
virtual std::string name_value_string() const = 0;
|
||||
|
||||
protected:
|
||||
virtual error_info_base * clone() const = 0;
|
||||
|
||||
virtual
|
||||
~error_info_base() throw()
|
||||
~error_info_base() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -41,30 +51,53 @@ boost
|
||||
error_info:
|
||||
public exception_detail::error_info_base
|
||||
{
|
||||
exception_detail::error_info_base *
|
||||
clone() const
|
||||
{
|
||||
return new error_info<Tag,T>(*this);
|
||||
}
|
||||
public:
|
||||
|
||||
typedef T value_type;
|
||||
|
||||
error_info( value_type const & value );
|
||||
~error_info() throw();
|
||||
|
||||
error_info( value_type const & v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
#if (__GNUC__*100+__GNUC_MINOR__!=406) //workaround for g++ bug
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
error_info( error_info const & x ):
|
||||
v_(x.v_)
|
||||
{
|
||||
}
|
||||
error_info( T && v ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
|
||||
v_(std::move(v))
|
||||
{
|
||||
}
|
||||
error_info( error_info && x ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
|
||||
v_(std::move(x.v_))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
~error_info() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
value_type const &
|
||||
value() const
|
||||
{
|
||||
return value_;
|
||||
return v_;
|
||||
}
|
||||
|
||||
value_type &
|
||||
value()
|
||||
{
|
||||
return value_;
|
||||
return v_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
error_info & operator=( error_info const & );
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
error_info & operator=( error_info && x );
|
||||
#endif
|
||||
std::string name_value_string() const;
|
||||
|
||||
value_type value_;
|
||||
value_type v_;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//Copyright (c) 2019 Dario Menendez, Banco Santander
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_618474C2DE1511DEB74A388C56D89593
|
||||
#define UUID_618474C2DE1511DEB74A388C56D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
|
||||
#define BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
@ -19,22 +14,34 @@
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <boost/exception/detail/clone_current_exception.hpp>
|
||||
//#ifndef BOOST_NO_RTTI
|
||||
//#include <boost/units/detail/utility.hpp>
|
||||
//#endif
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#include <boost/core/demangle.hpp>
|
||||
#endif
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdexcept>
|
||||
#include <new>
|
||||
#include <ios>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
class exception_ptr;
|
||||
BOOST_ATTRIBUTE_NORETURN void rethrow_exception( exception_ptr const & );
|
||||
BOOST_NORETURN void rethrow_exception( exception_ptr const & );
|
||||
exception_ptr current_exception();
|
||||
|
||||
class
|
||||
@ -92,7 +99,7 @@ boost
|
||||
std::string
|
||||
to_string( original_exception_type const & x )
|
||||
{
|
||||
return /*units::detail::demangle*/(x.value()->name());
|
||||
return core::demangle(x.value()->name());
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -104,7 +111,7 @@ boost
|
||||
boost::exception,
|
||||
std::bad_alloc
|
||||
{
|
||||
~bad_alloc_() throw() { }
|
||||
~bad_alloc_() BOOST_NOEXCEPT_OR_NOTHROW { }
|
||||
};
|
||||
|
||||
struct
|
||||
@ -112,7 +119,7 @@ boost
|
||||
boost::exception,
|
||||
std::bad_exception
|
||||
{
|
||||
~bad_exception_() throw() { }
|
||||
~bad_exception_() BOOST_NOEXCEPT_OR_NOTHROW { }
|
||||
};
|
||||
|
||||
template <class Exception>
|
||||
@ -173,7 +180,7 @@ boost
|
||||
add_original_type(e);
|
||||
}
|
||||
|
||||
~unknown_exception() throw()
|
||||
~unknown_exception() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
@ -219,7 +226,7 @@ boost
|
||||
add_original_type(e1);
|
||||
}
|
||||
|
||||
~current_exception_std_exception_wrapper() throw()
|
||||
~current_exception_std_exception_wrapper() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
@ -298,6 +305,24 @@ boost
|
||||
return boost::copy_exception(unknown_exception(e));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
struct
|
||||
std_exception_ptr_wrapper
|
||||
{
|
||||
std::exception_ptr p;
|
||||
explicit std_exception_ptr_wrapper( std::exception_ptr const & ptr ) BOOST_NOEXCEPT:
|
||||
p(ptr)
|
||||
{
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
explicit std_exception_ptr_wrapper( std::exception_ptr && ptr ) BOOST_NOEXCEPT:
|
||||
p(static_cast<std::exception_ptr &&>(ptr))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
inline
|
||||
exception_ptr
|
||||
current_exception_impl()
|
||||
@ -394,7 +419,7 @@ boost
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
catch(
|
||||
std::bad_cast & e )
|
||||
{
|
||||
@ -405,17 +430,20 @@ boost
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
catch(
|
||||
std::bad_exception & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
// this case can be handled losslesly with std::current_exception() (see below)
|
||||
catch(
|
||||
std::exception & e )
|
||||
{
|
||||
return exception_detail::current_exception_unknown_std_exception(e);
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
boost::exception & e )
|
||||
{
|
||||
@ -424,7 +452,22 @@ boost
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
try
|
||||
{
|
||||
// wrap the std::exception_ptr in a clone-enabled Boost.Exception object
|
||||
exception_detail::clone_base const & base =
|
||||
boost::enable_current_exception(std_exception_ptr_wrapper(std::current_exception()));
|
||||
return exception_ptr(shared_ptr<exception_detail::clone_base const>(base.clone()));
|
||||
}
|
||||
catch(
|
||||
...)
|
||||
{
|
||||
return exception_detail::current_exception_unknown_exception();
|
||||
}
|
||||
#else
|
||||
return exception_detail::current_exception_unknown_exception();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -454,13 +497,26 @@ boost
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOST_ATTRIBUTE_NORETURN
|
||||
BOOST_NORETURN
|
||||
inline
|
||||
void
|
||||
rethrow_exception( exception_ptr const & p )
|
||||
{
|
||||
BOOST_ASSERT(p);
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
try
|
||||
{
|
||||
p.ptr_->rethrow();
|
||||
}
|
||||
catch(
|
||||
exception_detail::std_exception_ptr_wrapper const & wrp)
|
||||
{
|
||||
// if an std::exception_ptr was wrapped above then rethrow it
|
||||
std::rethrow_exception(wrp.p);
|
||||
}
|
||||
#else
|
||||
p.ptr_->rethrow();
|
||||
#endif
|
||||
BOOST_ASSERT(0);
|
||||
#if defined(UNDER_CE)
|
||||
// some CE platforms don't define ::abort()
|
||||
|
@ -3,17 +3,23 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_898984B4076411DD973EDFA055D89593
|
||||
#define UUID_898984B4076411DD973EDFA055D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_898984B4076411DD973EDFA055D89593
|
||||
#define BOOST_EXCEPTION_898984B4076411DD973EDFA055D89593
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
@ -3,14 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
|
||||
#define UUID_6F463AC838DF11DDA3E6909F56D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_6F463AC838DF11DDA3E6909F56D89593
|
||||
#define BOOST_EXCEPTION_6F463AC838DF11DDA3E6909F56D89593
|
||||
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <iomanip>
|
||||
@ -19,6 +13,18 @@
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
17
include/boost/exception/detail/shared_ptr.hpp
Normal file
17
include/boost/exception/detail/shared_ptr.hpp
Normal file
@ -0,0 +1,17 @@
|
||||
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef BOOST_EXCEPTION_837060E885AF11E68DA91D15E31AC075
|
||||
#define BOOST_EXCEPTION_837060E885AF11E68DA91D15E31AC075
|
||||
|
||||
#ifdef BOOST_EXCEPTION_MINI_BOOST
|
||||
#include <memory>
|
||||
namespace boost { namespace exception_detail { using std::shared_ptr; } }
|
||||
#else
|
||||
#include <boost/shared_ptr.hpp>
|
||||
namespace boost { namespace exception_detail { using boost::shared_ptr; } }
|
||||
#endif
|
||||
|
||||
#endif
|
@ -3,22 +3,26 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
|
||||
#define UUID_C3E1741C754311DDB2834CCA55D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifndef BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
|
||||
#define BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
#include <boost/core/demangle.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
#include <string>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
|
||||
#include <boost/detail/sp_typeinfo.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/config.hpp>
|
||||
//#ifndef BOOST_NO_TYPEID
|
||||
//#include <boost/units/detail/utility.hpp>
|
||||
//#endif
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
@ -31,7 +35,7 @@ boost
|
||||
#ifdef BOOST_NO_TYPEID
|
||||
return BOOST_CURRENT_FUNCTION;
|
||||
#else
|
||||
return /*units::detail::demangle*/(typeid(T*).name());
|
||||
return core::demangle(typeid(T*).name());
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -43,7 +47,7 @@ boost
|
||||
#ifdef BOOST_NO_TYPEID
|
||||
return BOOST_CURRENT_FUNCTION;
|
||||
#else
|
||||
return /*units::detail::demangle*/(typeid(T).name());
|
||||
return core::demangle(typeid(T).name());
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -53,10 +57,10 @@ boost
|
||||
struct
|
||||
type_info_
|
||||
{
|
||||
detail::sp_typeinfo const * type_;
|
||||
core::typeinfo const * type_;
|
||||
|
||||
explicit
|
||||
type_info_( detail::sp_typeinfo const & type ):
|
||||
type_info_( core::typeinfo const & type ):
|
||||
type_(&type)
|
||||
{
|
||||
}
|
||||
@ -71,7 +75,7 @@ boost
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
|
||||
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_CORE_TYPEID(T))
|
||||
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
|
||||
|
@ -3,28 +3,36 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_0552D49838DD11DD90146B8956D89593
|
||||
#define UUID_0552D49838DD11DD90146B8956D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_0552D49838DD11DD90146B8956D89593
|
||||
#define BOOST_EXCEPTION_0552D49838DD11DD90146B8956D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
//#ifndef BOOST_NO_RTTI
|
||||
//#include <boost/units/detail/utility.hpp>
|
||||
//#endif
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#include <boost/core/demangle.hpp>
|
||||
#endif
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
@ -42,6 +50,10 @@ boost
|
||||
std::exception const * se=current_exception_cast<std::exception const>();
|
||||
if( be || se )
|
||||
return exception_detail::diagnostic_information_impl(be,se,true,verbose);
|
||||
#if defined(__GLIBCXX__) && __cplusplus >= 201103L && !defined(BOOST_NO_RTTI)
|
||||
else if (auto* p=std::current_exception().__cxa_exception_type())
|
||||
return "Dynamic exception type: "+boost::core::demangle(p->name());
|
||||
#endif
|
||||
else
|
||||
return "No diagnostic information available.";
|
||||
}
|
||||
@ -151,10 +163,10 @@ boost
|
||||
#ifndef BOOST_NO_RTTI
|
||||
if ( verbose )
|
||||
tmp << std::string("Dynamic exception type: ") <<
|
||||
/*units::detail::demangle*/((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
|
||||
core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
|
||||
#endif
|
||||
if( with_what && se && verbose )
|
||||
tmp << "std::exception::what: " << wh << '\n';
|
||||
tmp << "std::exception::what: " << (wh ? wh : "(null)") << '\n';
|
||||
if( be )
|
||||
if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
|
||||
if( *s )
|
||||
@ -172,7 +184,7 @@ boost
|
||||
|
||||
inline
|
||||
char const *
|
||||
diagnostic_information_what( exception const & e, bool verbose=true ) throw()
|
||||
diagnostic_information_what( exception const & e, bool verbose=true ) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
char const * w=0;
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
|
@ -3,4 +3,9 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef BOOST_EXCEPTION_851700A4F7CF11E6B2EE06DD14915323
|
||||
#define BOOST_EXCEPTION_851700A4F7CF11E6B2EE06DD14915323
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
|
||||
#endif
|
||||
|
@ -3,4 +3,9 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef BOOST_EXCEPTION_A0F7404AF7CF11E6908227DD14915323
|
||||
#define BOOST_EXCEPTION_A0F7404AF7CF11E6908227DD14915323
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
|
||||
#endif
|
||||
|
@ -3,10 +3,10 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_DDFBB4546C1211DEA4659E9055D89593
|
||||
#define UUID_DDFBB4546C1211DEA4659E9055D89593
|
||||
#ifndef BOOST_EXCEPTION_DDFBB4546C1211DEA4659E9055D89593
|
||||
#define BOOST_EXCEPTION_DDFBB4546C1211DEA4659E9055D89593
|
||||
|
||||
#include "boost/exception/error_info.hpp"
|
||||
#include <boost/exception/error_info.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_E7255CE26C1211DE85800C9155D89593
|
||||
#define UUID_E7255CE26C1211DE85800C9155D89593
|
||||
#ifndef BOOST_EXCEPTION_E7255CE26C1211DE85800C9155D89593
|
||||
#define BOOST_EXCEPTION_E7255CE26C1211DE85800C9155D89593
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -3,19 +3,26 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
|
||||
#define UUID_F0EE17BE6C1211DE87FF459155D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
|
||||
#define BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
|
||||
|
||||
#include "boost/exception/info.hpp"
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
@ -33,7 +40,7 @@ boost
|
||||
{
|
||||
std::ostringstream tmp;
|
||||
int v=e.value();
|
||||
tmp << v << ", \"" << strerror(v) << "\"";
|
||||
tmp << '[' << error_info_name(e) << "] = " << v << ", \"" << strerror(v) << "\"\n";
|
||||
return tmp.str();
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_F79E6EE26C1211DEB26E929155D89593
|
||||
#define UUID_F79E6EE26C1211DEB26E929155D89593
|
||||
#ifndef BOOST_EXCEPTION_F79E6EE26C1211DEB26E929155D89593
|
||||
#define BOOST_EXCEPTION_F79E6EE26C1211DEB26E929155D89593
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_FEE5120A6C1211DE94E8BC9155D89593
|
||||
#define UUID_FEE5120A6C1211DE94E8BC9155D89593
|
||||
#ifndef BOOST_EXCEPTION_FEE5120A6C1211DE94E8BC9155D89593
|
||||
#define BOOST_EXCEPTION_FEE5120A6C1211DE94E8BC9155D89593
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_056F1F266C1311DE8E74299255D89593
|
||||
#define UUID_056F1F266C1311DE8E74299255D89593
|
||||
#ifndef BOOST_EXCEPTION_056F1F266C1311DE8E74299255D89593
|
||||
#define BOOST_EXCEPTION_056F1F266C1311DE8E74299255D89593
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_45CC9A82B77511DEB330FC4956D89593
|
||||
#define UUID_45CC9A82B77511DEB330FC4956D89593
|
||||
#ifndef BOOST_EXCEPTION_45CC9A82B77511DEB330FC4956D89593
|
||||
#define BOOST_EXCEPTION_45CC9A82B77511DEB330FC4956D89593
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_0E11109E6C1311DEB7EA649255D89593
|
||||
#define UUID_0E11109E6C1311DEB7EA649255D89593
|
||||
#ifndef BOOST_EXCEPTION_0E11109E6C1311DEB7EA649255D89593
|
||||
#define BOOST_EXCEPTION_0E11109E6C1311DEB7EA649255D89593
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_EE7ECCA0433B11E1923E37064924019B
|
||||
#define UUID_EE7ECCA0433B11E1923E37064924019B
|
||||
#ifndef BOOST_EXCEPTION_EE7ECCA0433B11E1923E37064924019B
|
||||
#define BOOST_EXCEPTION_EE7ECCA0433B11E1923E37064924019B
|
||||
namespace boost { template <class Tag,class T> class error_info; }
|
||||
#endif
|
||||
|
@ -1,483 +0,0 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||
#define UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
class
|
||||
refcount_ptr
|
||||
{
|
||||
public:
|
||||
|
||||
refcount_ptr():
|
||||
px_(0)
|
||||
{
|
||||
}
|
||||
|
||||
~refcount_ptr()
|
||||
{
|
||||
release();
|
||||
}
|
||||
|
||||
refcount_ptr( refcount_ptr const & x ):
|
||||
px_(x.px_)
|
||||
{
|
||||
add_ref();
|
||||
}
|
||||
|
||||
refcount_ptr &
|
||||
operator=( refcount_ptr const & x )
|
||||
{
|
||||
adopt(x.px_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void
|
||||
adopt( T * px )
|
||||
{
|
||||
release();
|
||||
px_=px;
|
||||
add_ref();
|
||||
}
|
||||
|
||||
T *
|
||||
get() const
|
||||
{
|
||||
return px_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
T * px_;
|
||||
|
||||
void
|
||||
add_ref()
|
||||
{
|
||||
if( px_ )
|
||||
px_->add_ref();
|
||||
}
|
||||
|
||||
void
|
||||
release()
|
||||
{
|
||||
if( px_ && px_->release() )
|
||||
px_=0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <class Tag,class T>
|
||||
class error_info;
|
||||
|
||||
typedef error_info<struct throw_function_,char const *> throw_function;
|
||||
typedef error_info<struct throw_file_,char const *> throw_file;
|
||||
typedef error_info<struct throw_line_,int> throw_line;
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<throw_function_,char const *>
|
||||
{
|
||||
public:
|
||||
typedef char const * value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<throw_file_,char const *>
|
||||
{
|
||||
public:
|
||||
typedef char const * value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<throw_line_,int>
|
||||
{
|
||||
public:
|
||||
typedef int value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
class exception;
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class shared_ptr;
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class error_info_base;
|
||||
struct type_info_;
|
||||
|
||||
struct
|
||||
error_info_container
|
||||
{
|
||||
virtual char const * diagnostic_information( char const * ) const = 0;
|
||||
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
|
||||
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
|
||||
virtual void add_ref() const = 0;
|
||||
virtual bool release() const = 0;
|
||||
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
~error_info_container() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <class>
|
||||
struct get_info;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_function>;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_file>;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_line>;
|
||||
|
||||
char const * get_diagnostic_information( exception const &, char const * );
|
||||
|
||||
void copy_boost_exception( exception *, exception const * );
|
||||
|
||||
template <class E,class Tag,class T>
|
||||
E const & set_info( E const &, error_info<Tag,T> const & );
|
||||
|
||||
template <class E>
|
||||
E const & set_info( E const &, throw_function const & );
|
||||
|
||||
template <class E>
|
||||
E const & set_info( E const &, throw_file const & );
|
||||
|
||||
template <class E>
|
||||
E const & set_info( E const &, throw_line const & );
|
||||
}
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
class
|
||||
exception
|
||||
{
|
||||
protected:
|
||||
|
||||
exception():
|
||||
throw_function_(0),
|
||||
throw_file_(0),
|
||||
throw_line_(-1)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef __HP_aCC
|
||||
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
|
||||
//On all other platforms, the same effect is achieved by the pure virtual destructor.
|
||||
exception( exception const & x ) throw():
|
||||
data_(x.data_),
|
||||
throw_function_(x.throw_function_),
|
||||
throw_file_(x.throw_file_),
|
||||
throw_line_(x.throw_line_)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual ~exception() throw()
|
||||
#ifndef __HP_aCC
|
||||
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
|
||||
#endif
|
||||
;
|
||||
|
||||
#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
|
||||
public:
|
||||
#else
|
||||
private:
|
||||
|
||||
template <class E>
|
||||
friend E const & exception_detail::set_info( E const &, throw_function const & );
|
||||
|
||||
template <class E>
|
||||
friend E const & exception_detail::set_info( E const &, throw_file const & );
|
||||
|
||||
template <class E>
|
||||
friend E const & exception_detail::set_info( E const &, throw_line const & );
|
||||
|
||||
template <class E,class Tag,class T>
|
||||
friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
|
||||
|
||||
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
|
||||
|
||||
template <class>
|
||||
friend struct exception_detail::get_info;
|
||||
friend struct exception_detail::get_info<throw_function>;
|
||||
friend struct exception_detail::get_info<throw_file>;
|
||||
friend struct exception_detail::get_info<throw_line>;
|
||||
friend void exception_detail::copy_boost_exception( exception *, exception const * );
|
||||
#endif
|
||||
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
|
||||
mutable char const * throw_function_;
|
||||
mutable char const * throw_file_;
|
||||
mutable int throw_line_;
|
||||
};
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
inline
|
||||
exception::
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class E>
|
||||
E const &
|
||||
set_info( E const & x, throw_function const & y )
|
||||
{
|
||||
x.throw_function_=y.v_;
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class E>
|
||||
E const &
|
||||
set_info( E const & x, throw_file const & y )
|
||||
{
|
||||
x.throw_file_=y.v_;
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class E>
|
||||
E const &
|
||||
set_info( E const & x, throw_line const & y )
|
||||
{
|
||||
x.throw_line_=y.v_;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
template <class T>
|
||||
struct
|
||||
error_info_injector:
|
||||
public T,
|
||||
public exception
|
||||
{
|
||||
explicit
|
||||
error_info_injector( T const & x ):
|
||||
T(x)
|
||||
{
|
||||
}
|
||||
|
||||
~error_info_injector() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct large_size { char c[256]; };
|
||||
large_size dispatch_boost_exception( exception const * );
|
||||
|
||||
struct small_size { };
|
||||
small_size dispatch_boost_exception( void const * );
|
||||
|
||||
template <class,int>
|
||||
struct enable_error_info_helper;
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_helper<T,sizeof(large_size)>
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_helper<T,sizeof(small_size)>
|
||||
{
|
||||
typedef error_info_injector<T> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_return_type
|
||||
{
|
||||
typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception(static_cast<T *>(0)))>::type type;
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
typename
|
||||
exception_detail::enable_error_info_return_type<T>::type
|
||||
enable_error_info( T const & x )
|
||||
{
|
||||
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
|
||||
return rt(x);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
class
|
||||
clone_base
|
||||
{
|
||||
public:
|
||||
|
||||
virtual clone_base const * clone() const = 0;
|
||||
virtual void rethrow() const = 0;
|
||||
|
||||
virtual
|
||||
~clone_base() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
inline
|
||||
void
|
||||
copy_boost_exception( exception * a, exception const * b )
|
||||
{
|
||||
refcount_ptr<error_info_container> data;
|
||||
if( error_info_container * d=b->data_.get() )
|
||||
data = d->clone();
|
||||
a->throw_file_ = b->throw_file_;
|
||||
a->throw_line_ = b->throw_line_;
|
||||
a->throw_function_ = b->throw_function_;
|
||||
a->data_ = data;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
copy_boost_exception( void *, void const * )
|
||||
{
|
||||
}
|
||||
|
||||
template <class T>
|
||||
class
|
||||
clone_impl:
|
||||
public T,
|
||||
public virtual clone_base
|
||||
{
|
||||
struct clone_tag { };
|
||||
clone_impl( clone_impl const & x, clone_tag ):
|
||||
T(x)
|
||||
{
|
||||
copy_boost_exception(this,&x);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
explicit
|
||||
clone_impl( T const & x ):
|
||||
T(x)
|
||||
{
|
||||
copy_boost_exception(this,&x);
|
||||
}
|
||||
|
||||
~clone_impl() throw()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new clone_impl(*this,clone_tag());
|
||||
}
|
||||
|
||||
void
|
||||
rethrow() const
|
||||
{
|
||||
throw*this;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
exception_detail::clone_impl<T>
|
||||
enable_current_exception( T const & x )
|
||||
{
|
||||
return exception_detail::clone_impl<T>(x);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
@ -3,19 +3,27 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
|
||||
#define UUID_1A590226753311DD9E4CCF6156D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_1A590226753311DD9E4CCF6156D89593
|
||||
#define BOOST_EXCEPTION_1A590226753311DD9E4CCF6156D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/detail/error_info_impl.hpp>
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/exception/detail/shared_ptr.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -3,22 +3,28 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
|
||||
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_8D22C4CA9CC811DCAA9133D256D89593
|
||||
#define BOOST_EXCEPTION_8D22C4CA9CC811DCAA9133D256D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/to_string_stub.hpp>
|
||||
#include <boost/exception/detail/error_info_impl.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/detail/shared_ptr.hpp>
|
||||
#include <map>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
@ -38,21 +44,6 @@ boost
|
||||
return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n';
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
error_info<Tag,T>::
|
||||
error_info( value_type const & value ):
|
||||
value_(value)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
error_info<Tag,T>::
|
||||
~error_info() throw()
|
||||
{
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
std::string
|
||||
@ -76,7 +67,7 @@ boost
|
||||
{
|
||||
}
|
||||
|
||||
~error_info_container_impl() throw()
|
||||
~error_info_container_impl() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
@ -156,7 +147,11 @@ boost
|
||||
refcount_ptr<error_info_container> p;
|
||||
error_info_container_impl * c=new error_info_container_impl;
|
||||
p.adopt(c);
|
||||
c->info_ = info_;
|
||||
for( error_info_map::const_iterator i=info_.begin(),e=info_.end(); i!=e; ++i )
|
||||
{
|
||||
shared_ptr<error_info_base> cp(i->second->clone());
|
||||
c->info_.insert(std::make_pair(i->first,cp));
|
||||
}
|
||||
return p;
|
||||
}
|
||||
};
|
||||
@ -175,6 +170,85 @@ boost
|
||||
return x;
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class E,class Tag,class T>
|
||||
E const & set_info( E const &, error_info<Tag,T> && );
|
||||
template <class T>
|
||||
struct set_info_rv;
|
||||
template <class Tag,class T>
|
||||
struct
|
||||
set_info_rv<error_info<Tag,T> >
|
||||
{
|
||||
template <class E,class Tag1,class T1>
|
||||
friend E const & set_info( E const &, error_info<Tag1,T1> && );
|
||||
template <class E>
|
||||
static
|
||||
E const &
|
||||
set( E const & x, error_info<Tag,T> && v )
|
||||
{
|
||||
typedef error_info<Tag,T> error_info_tag_t;
|
||||
shared_ptr<error_info_tag_t> p( new error_info_tag_t(std::move(v)) );
|
||||
exception_detail::error_info_container * c=x.data_.get();
|
||||
if( !c )
|
||||
x.data_.adopt(c=new exception_detail::error_info_container_impl);
|
||||
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
|
||||
return x;
|
||||
}
|
||||
};
|
||||
template <>
|
||||
struct
|
||||
set_info_rv<throw_function>
|
||||
{
|
||||
template <class E,class Tag1,class T1>
|
||||
friend E const & set_info( E const &, error_info<Tag1,T1> && );
|
||||
template <class E>
|
||||
static
|
||||
E const &
|
||||
set( E const & x, throw_function && y )
|
||||
{
|
||||
x.throw_function_=y.v_;
|
||||
return x;
|
||||
}
|
||||
};
|
||||
template <>
|
||||
struct
|
||||
set_info_rv<throw_file>
|
||||
{
|
||||
template <class E,class Tag1,class T1>
|
||||
friend E const & set_info( E const &, error_info<Tag1,T1> && );
|
||||
template <class E>
|
||||
static
|
||||
E const &
|
||||
set( E const & x, throw_file && y )
|
||||
{
|
||||
x.throw_file_=y.v_;
|
||||
return x;
|
||||
}
|
||||
};
|
||||
template <>
|
||||
struct
|
||||
set_info_rv<throw_line>
|
||||
{
|
||||
template <class E,class Tag1,class T1>
|
||||
friend E const & set_info( E const &, error_info<Tag1,T1> && );
|
||||
template <class E>
|
||||
static
|
||||
E const &
|
||||
set( E const & x, throw_line && y )
|
||||
{
|
||||
x.throw_line_=y.v_;
|
||||
return x;
|
||||
}
|
||||
};
|
||||
template <class E,class Tag,class T>
|
||||
inline
|
||||
E const &
|
||||
set_info( E const & x, error_info<Tag,T> && v )
|
||||
{
|
||||
return set_info_rv<error_info<Tag,T> >::template set<E>(x,std::move(v));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
derives_boost_exception
|
||||
@ -190,6 +264,16 @@ boost
|
||||
{
|
||||
return exception_detail::set_info(x,v);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class E,class Tag,class T>
|
||||
inline
|
||||
typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
|
||||
operator<<( E const & x, error_info<Tag,T> && v )
|
||||
{
|
||||
return exception_detail::set_info(x,std::move(v));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
|
@ -3,18 +3,24 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_63EE924290FB11DC87BB856555D89593
|
||||
#define UUID_63EE924290FB11DC87BB856555D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
|
||||
#define BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
@ -3,19 +3,25 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_7E48761AD92811DC9011477D56D89593
|
||||
#define UUID_7E48761AD92811DC9011477D56D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
|
||||
#define BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/exception/detail/is_output_streamable.hpp>
|
||||
#include <sstream>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
@ -3,19 +3,25 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_E788439ED9F011DCB181F25B55D89593
|
||||
#define UUID_E788439ED9F011DCB181F25B55D89593
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_EXCEPTION_E788439ED9F011DCB181F25B55D89593
|
||||
#define BOOST_EXCEPTION_E788439ED9F011DCB181F25B55D89593
|
||||
|
||||
#include <boost/exception/to_string.hpp>
|
||||
#include <boost/exception/detail/object_hex_dump.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang system_header
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593
|
||||
#define UUID_FA5836A2CADA11DC8CD47C8555D89593
|
||||
#ifndef BOOST_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
|
||||
#define BOOST_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
|
||||
|
||||
#include <boost/exception/detail/exception_ptr.hpp>
|
||||
|
||||
|
@ -1,103 +0,0 @@
|
||||
#ifndef UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#define UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/throw_exception.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//
|
||||
// Distributed under 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)
|
||||
//
|
||||
// http://www.boost.org/libs/utility/throw_exception.html
|
||||
//
|
||||
|
||||
#include <boost/exception/detail/attribute_noreturn.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
# include <boost/exception/exception.hpp>
|
||||
#if !defined(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION)
|
||||
# include <boost/current_function.hpp>
|
||||
# define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION
|
||||
#endif
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_THROW_EXCEPTION_CURRENT_FUNCTION,__FILE__,__LINE__)
|
||||
#else
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
|
||||
void throw_exception( std::exception const & e ); // user defined
|
||||
|
||||
#else
|
||||
|
||||
inline void throw_exception_assert_compatibility( std::exception const & ) { }
|
||||
|
||||
template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
|
||||
{
|
||||
//All boost exceptions are required to derive from std::exception,
|
||||
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
|
||||
throw_exception_assert_compatibility(e);
|
||||
|
||||
#ifndef BOOST_EXCEPTION_DISABLE
|
||||
throw enable_current_exception(enable_error_info(e));
|
||||
#else
|
||||
throw e;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class E>
|
||||
BOOST_ATTRIBUTE_NORETURN
|
||||
void
|
||||
throw_exception_( E const & x, char const * current_function, char const * file, int line )
|
||||
{
|
||||
boost::throw_exception(
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
15
meta/libraries.json
Normal file
15
meta/libraries.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"key": "exception",
|
||||
"name": "Exception",
|
||||
"authors": [
|
||||
"Emil Dotchevski"
|
||||
],
|
||||
"description": "The Boost Exception library supports transporting of arbitrary data in exception objects, and transporting of exceptions between threads.",
|
||||
"documentation": "doc/boost-exception.html",
|
||||
"category": [
|
||||
"Emulation"
|
||||
],
|
||||
"maintainers": [
|
||||
"Emil Dotchevski <emil -at- revergestudios.com>"
|
||||
]
|
||||
}
|
@ -10,18 +10,17 @@
|
||||
#error This file requires exception handling to be enabled.
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/detail/clone_current_exception.hpp>
|
||||
|
||||
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && defined(_M_IX86) && !defined(_M_X64)
|
||||
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
||||
|
||||
//Non-intrusive cloning support implemented below, only for MSVC versions mentioned above.
|
||||
//Thanks Anthony Williams!
|
||||
//Thanks to Martin Weiss for implementing 64-bit support!
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#include <typeinfo>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <malloc.h>
|
||||
|
||||
@ -32,8 +31,10 @@ namespace
|
||||
|
||||
#if _MSC_VER==1310
|
||||
int const exception_info_offset=0x74;
|
||||
#elif (_MSC_VER==1400 || _MSC_VER==1500)
|
||||
#elif ((_MSC_VER==1400 || _MSC_VER==1500) && !defined _M_X64)
|
||||
int const exception_info_offset=0x80;
|
||||
#elif ((_MSC_VER==1400 || _MSC_VER==1500) && defined _M_X64)
|
||||
int const exception_info_offset=0xE0;
|
||||
#else
|
||||
int const exception_info_offset=-1;
|
||||
#endif
|
||||
@ -58,7 +59,11 @@ namespace
|
||||
|
||||
unsigned const cpp_exception_code=0xE06D7363;
|
||||
unsigned const cpp_exception_magic_flag=0x19930520;
|
||||
#ifdef _M_X64
|
||||
unsigned const cpp_exception_parameter_count=4;
|
||||
#else
|
||||
unsigned const cpp_exception_parameter_count=3;
|
||||
#endif
|
||||
|
||||
struct
|
||||
dummy_exception_type
|
||||
@ -72,10 +77,18 @@ namespace
|
||||
union
|
||||
cpp_copy_constructor
|
||||
{
|
||||
void * address;
|
||||
normal_copy_constructor_ptr normal_copy_constructor;
|
||||
copy_constructor_with_virtual_base_ptr copy_constructor_with_virtual_base;
|
||||
};
|
||||
|
||||
union
|
||||
cpp_destructor
|
||||
{
|
||||
void * address;
|
||||
destructor_ptr destructor;
|
||||
};
|
||||
|
||||
enum
|
||||
cpp_type_flags
|
||||
{
|
||||
@ -83,45 +96,46 @@ namespace
|
||||
class_has_virtual_base=4
|
||||
};
|
||||
|
||||
// ATTENTION: On x86 fields such as type_info and copy_constructor are really pointers
|
||||
// but on 64bit these are 32bit offsets from HINSTANCE. Hints on the 64bit handling from
|
||||
// http://blogs.msdn.com/b/oldnewthing/archive/2010/07/30/10044061.aspx .
|
||||
struct
|
||||
cpp_type_info
|
||||
{
|
||||
unsigned flags;
|
||||
#ifndef BOOST_NO_RTTI
|
||||
void const * type_info;
|
||||
#else
|
||||
std::type_info * type_info;
|
||||
#endif
|
||||
int type_info;
|
||||
int this_offset;
|
||||
int vbase_descr;
|
||||
int vbase_offset;
|
||||
unsigned long size;
|
||||
cpp_copy_constructor copy_constructor;
|
||||
int copy_constructor;
|
||||
};
|
||||
|
||||
struct
|
||||
cpp_type_info_table
|
||||
{
|
||||
unsigned count;
|
||||
const cpp_type_info * info[1];
|
||||
int info;
|
||||
};
|
||||
|
||||
struct
|
||||
cpp_exception_type
|
||||
{
|
||||
unsigned flags;
|
||||
destructor_ptr destructor;
|
||||
void(*custom_handler)();
|
||||
cpp_type_info_table const * type_info_table;
|
||||
int destructor;
|
||||
int custom_handler;
|
||||
int type_info_table;
|
||||
};
|
||||
|
||||
struct
|
||||
exception_object_deleter
|
||||
{
|
||||
cpp_exception_type const & et_;
|
||||
size_t image_base_;
|
||||
|
||||
exception_object_deleter( cpp_exception_type const & et ):
|
||||
et_(et)
|
||||
exception_object_deleter( cpp_exception_type const & et, size_t image_base ):
|
||||
et_(et),
|
||||
image_base_(image_base)
|
||||
{
|
||||
}
|
||||
|
||||
@ -129,45 +143,54 @@ namespace
|
||||
operator()( void * obj )
|
||||
{
|
||||
BOOST_ASSERT(obj!=0);
|
||||
dummy_exception_type * dummy_exception_ptr=reinterpret_cast<dummy_exception_type *>(obj);
|
||||
(dummy_exception_ptr->*(et_.destructor))();
|
||||
dummy_exception_type* dummy_exception_ptr = static_cast<dummy_exception_type *>(obj);
|
||||
if( et_.destructor )
|
||||
{
|
||||
cpp_destructor destructor;
|
||||
destructor.address = reinterpret_cast<void *>(et_.destructor + image_base_);
|
||||
(dummy_exception_ptr->*(destructor.destructor))();
|
||||
}
|
||||
free(obj);
|
||||
}
|
||||
};
|
||||
|
||||
cpp_type_info const &
|
||||
get_cpp_type_info( cpp_exception_type const & et )
|
||||
get_cpp_type_info( cpp_exception_type const & et, size_t image_base )
|
||||
{
|
||||
cpp_type_info const * ti = et.type_info_table->info[0];
|
||||
cpp_type_info_table * const typearray = reinterpret_cast<cpp_type_info_table * const>(et.type_info_table + image_base);
|
||||
cpp_type_info * const ti = reinterpret_cast<cpp_type_info * const>(typearray->info + image_base);
|
||||
BOOST_ASSERT(ti!=0);
|
||||
return *ti;
|
||||
}
|
||||
|
||||
void
|
||||
copy_msvc_exception( void * dst, void * src, cpp_type_info const & ti )
|
||||
copy_msvc_exception( void * dst, void * src, cpp_type_info const & ti, size_t image_base )
|
||||
{
|
||||
if( !(ti.flags & class_is_simple_type) && ti.copy_constructor.normal_copy_constructor )
|
||||
cpp_copy_constructor copy_constructor;
|
||||
copy_constructor.address = reinterpret_cast<void *>(ti.copy_constructor + image_base);
|
||||
|
||||
if( !(ti.flags & class_is_simple_type) && copy_constructor.normal_copy_constructor )
|
||||
{
|
||||
dummy_exception_type * dummy_exception_ptr = reinterpret_cast<dummy_exception_type *>(dst);
|
||||
dummy_exception_type * dummy_exception_ptr = static_cast<dummy_exception_type *>(dst);
|
||||
if( ti.flags & class_has_virtual_base )
|
||||
(dummy_exception_ptr->*(ti.copy_constructor.copy_constructor_with_virtual_base))(src,dst);
|
||||
(dummy_exception_ptr->*(copy_constructor.copy_constructor_with_virtual_base))(src,dst);
|
||||
else
|
||||
(dummy_exception_ptr->*(ti.copy_constructor.normal_copy_constructor))(src);
|
||||
(dummy_exception_ptr->*(copy_constructor.normal_copy_constructor))(src);
|
||||
}
|
||||
else
|
||||
memmove(dst,src,ti.size);
|
||||
}
|
||||
|
||||
boost::shared_ptr<void>
|
||||
clone_msvc_exception( void * src, cpp_exception_type const & et )
|
||||
clone_msvc_exception( void * src, cpp_exception_type const & et, size_t image_base )
|
||||
{
|
||||
assert(src!=0);
|
||||
cpp_type_info const & ti=get_cpp_type_info(et);
|
||||
BOOST_ASSERT(src!=0);
|
||||
cpp_type_info const & ti=get_cpp_type_info(et,image_base);
|
||||
if( void * dst = malloc(ti.size) )
|
||||
{
|
||||
try
|
||||
{
|
||||
copy_msvc_exception(dst,src,ti);
|
||||
copy_msvc_exception(dst,src,ti,image_base);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
@ -175,7 +198,7 @@ namespace
|
||||
free(dst);
|
||||
throw;
|
||||
}
|
||||
return boost::shared_ptr<void>(dst,exception_object_deleter(et));
|
||||
return boost::shared_ptr<void>(dst,exception_object_deleter(et,image_base));
|
||||
}
|
||||
else
|
||||
throw std::bad_alloc();
|
||||
@ -189,36 +212,47 @@ namespace
|
||||
cloned_exception & operator=( cloned_exception const & );
|
||||
|
||||
cpp_exception_type const & et_;
|
||||
size_t image_base_;
|
||||
boost::shared_ptr<void> exc_;
|
||||
|
||||
public:
|
||||
|
||||
cloned_exception( void * exc, cpp_exception_type const & et ):
|
||||
et_(et),
|
||||
exc_(clone_msvc_exception(exc,et_))
|
||||
cloned_exception( EXCEPTION_RECORD const * record ):
|
||||
et_(*reinterpret_cast<cpp_exception_type const *>(record->ExceptionInformation[2])),
|
||||
image_base_((cpp_exception_parameter_count==4) ? record->ExceptionInformation[3] : 0),
|
||||
exc_(clone_msvc_exception(reinterpret_cast<void *>(record->ExceptionInformation[1]),et_,image_base_))
|
||||
{
|
||||
}
|
||||
|
||||
~cloned_exception() throw()
|
||||
cloned_exception( void * exc, cpp_exception_type const & et, size_t image_base ):
|
||||
et_(et),
|
||||
image_base_(image_base),
|
||||
exc_(clone_msvc_exception(exc,et_,image_base))
|
||||
{
|
||||
}
|
||||
|
||||
~cloned_exception() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
boost::exception_detail::clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new cloned_exception(exc_.get(),et_);
|
||||
return new cloned_exception(exc_.get(),et_,image_base_);
|
||||
}
|
||||
|
||||
void
|
||||
rethrow() const
|
||||
{
|
||||
cpp_type_info const & ti=get_cpp_type_info(et_);
|
||||
cpp_type_info const & ti=get_cpp_type_info(et_,image_base_);
|
||||
void * dst = _alloca(ti.size);
|
||||
copy_msvc_exception(dst,exc_.get(),ti);
|
||||
copy_msvc_exception(dst,exc_.get(),ti,image_base_);
|
||||
ULONG_PTR args[cpp_exception_parameter_count];
|
||||
args[0]=cpp_exception_magic_flag;
|
||||
args[1]=reinterpret_cast<ULONG_PTR>(dst);
|
||||
args[2]=reinterpret_cast<ULONG_PTR>(&et_);
|
||||
if (cpp_exception_parameter_count==4)
|
||||
args[3]=image_base_;
|
||||
|
||||
RaiseException(cpp_exception_code,EXCEPTION_NONCONTINUABLE,cpp_exception_parameter_count,args);
|
||||
}
|
||||
};
|
||||
@ -237,8 +271,7 @@ namespace
|
||||
{
|
||||
BOOST_ASSERT(exception_info_offset>=0);
|
||||
BOOST_ASSERT(info_!=0);
|
||||
EXCEPTION_POINTERS * info=reinterpret_cast<EXCEPTION_POINTERS *>(info_);
|
||||
EXCEPTION_RECORD * record=info->ExceptionRecord;
|
||||
EXCEPTION_RECORD* record = static_cast<EXCEPTION_POINTERS *>(info_)->ExceptionRecord;
|
||||
if( is_cpp_exception(record) )
|
||||
{
|
||||
if( !record->ExceptionInformation[2] )
|
||||
@ -246,9 +279,7 @@ namespace
|
||||
if( is_cpp_exception(record) && record->ExceptionInformation[2] )
|
||||
try
|
||||
{
|
||||
ptr = new cloned_exception(
|
||||
reinterpret_cast<void *>(record->ExceptionInformation[1]),
|
||||
*reinterpret_cast<cpp_exception_type const *>(record->ExceptionInformation[2]));
|
||||
ptr = new cloned_exception(record);
|
||||
result = boost::exception_detail::clone_current_exception_result::success;
|
||||
}
|
||||
catch(
|
||||
@ -301,8 +332,6 @@ boost
|
||||
//On all other compilers, return clone_current_exception_result::not_supported.
|
||||
//On such platforms, only the intrusive enable_current_exception() cloning will work.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
|
@ -5,19 +5,17 @@
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
bool called=false;
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
void
|
||||
throw_exception( std::exception const & )
|
||||
{
|
||||
called=true;
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +23,5 @@ int
|
||||
main()
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_TEST(called);
|
||||
return boost::report_errors();
|
||||
return 1;
|
||||
}
|
||||
|
@ -6,19 +6,17 @@
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#define BOOST_EXCEPTION_DISABLE
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
bool called=false;
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
void
|
||||
throw_exception( std::exception const & )
|
||||
{
|
||||
called=true;
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +24,5 @@ int
|
||||
main()
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_TEST(called);
|
||||
return boost::report_errors();
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Boost Exception Library test Jamfile
|
||||
#
|
||||
# Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
# Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc.
|
||||
#
|
||||
# Distributed under 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)
|
||||
@ -34,7 +34,11 @@ run exception_test.cpp ;
|
||||
run enable_error_info_test.cpp helper1.cpp ;
|
||||
run throw_exception_test.cpp helper2.cpp ;
|
||||
run errno_test.cpp ;
|
||||
run error_info_test.cpp ;
|
||||
run error_info_basic_test.cpp ;
|
||||
run error_info_lv_test.cpp ;
|
||||
run error_info_lv_const_test.cpp ;
|
||||
run error_info_rv_test.cpp ;
|
||||
run error_info_rv_const_test.cpp ;
|
||||
run diagnostic_information_test.cpp ;
|
||||
run refcount_ptr_test.cpp ;
|
||||
run current_exception_cast_test.cpp ;
|
||||
@ -67,3 +71,5 @@ compile errinfo_file_name_hpp_test.cpp ;
|
||||
compile errinfo_file_open_mode_hpp_test.cpp ;
|
||||
compile errinfo_nested_exception_hpp_test.cpp ;
|
||||
compile errinfo_type_info_name_hpp_test.cpp ;
|
||||
|
||||
compile bug_11874_test.cpp ;
|
||||
|
@ -1,7 +1,10 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//Copyright (c) 2006-2017 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <boost/exception.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
@ -9,6 +9,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <string>
|
||||
#include <ios>
|
||||
|
||||
typedef boost::error_info<struct my_tag,int> my_info;
|
||||
|
||||
@ -73,7 +74,7 @@ derives_std_boost_exception:
|
||||
{
|
||||
}
|
||||
|
||||
char const * what() const throw()
|
||||
char const * what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return wh_;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ err:
|
||||
}
|
||||
|
||||
virtual
|
||||
~err() throw()
|
||||
~err() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
--exc_count;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ error1:
|
||||
boost::exception
|
||||
{
|
||||
char const *
|
||||
what() const throw()
|
||||
what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return "error1";
|
||||
}
|
||||
@ -45,7 +45,7 @@ error3:
|
||||
std::exception
|
||||
{
|
||||
char const *
|
||||
what() const throw()
|
||||
what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return "error3";
|
||||
}
|
||||
@ -57,7 +57,7 @@ error4:
|
||||
boost::exception
|
||||
{
|
||||
char const *
|
||||
what() const throw()
|
||||
what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return diagnostic_information_what(*this);
|
||||
}
|
||||
|
29
test/error_info_basic_test.cpp
Normal file
29
test/error_info_basic_test.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception/error_info.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
struct my_exception: virtual boost::exception {};
|
||||
typedef boost::error_info<struct error_info_string_, std::string> error_info_string;
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw my_exception() << error_info_string("doh");
|
||||
}
|
||||
catch( my_exception & e )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<error_info_string>(e) && !strcmp(boost::get_error_info<error_info_string>(e)->c_str(),"doh"));
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
13
test/error_info_lv_const_test.cpp
Normal file
13
test/error_info_lv_const_test.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
template <class E,class I>
|
||||
E const &
|
||||
add_info( E const & e, I const & i )
|
||||
{
|
||||
return e << i;
|
||||
}
|
||||
#include "error_info_test.hpp"
|
13
test/error_info_lv_test.cpp
Normal file
13
test/error_info_lv_test.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
template <class E,class I>
|
||||
E const &
|
||||
add_info( E const & e, I i )
|
||||
{
|
||||
return e << i;
|
||||
}
|
||||
#include "error_info_test.hpp"
|
28
test/error_info_rv_const_test.cpp
Normal file
28
test/error_info_rv_const_test.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
int
|
||||
main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
template <class I>
|
||||
I const
|
||||
rv_const( I i )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
template <class E,class I>
|
||||
E const &
|
||||
add_info( E const & e, I i )
|
||||
{
|
||||
return e << rv_const(i);
|
||||
}
|
||||
#include "error_info_test.hpp"
|
||||
#endif
|
22
test/error_info_rv_test.cpp
Normal file
22
test/error_info_rv_test.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
int
|
||||
main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
template <class E,class I>
|
||||
E const &
|
||||
add_info( E const & e, I i )
|
||||
{
|
||||
return e << std::move(i);
|
||||
}
|
||||
#include "error_info_test.hpp"
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under 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)
|
||||
@ -69,7 +69,7 @@ basic_test()
|
||||
try
|
||||
{
|
||||
test_exception x;
|
||||
x << test_1(1) << test_2(2u) << test_3(3.14159f);
|
||||
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
@ -86,7 +86,7 @@ basic_test()
|
||||
try
|
||||
{
|
||||
test_exception x;
|
||||
x << test_1(1) << test_2(2u) << test_3(3.14159f);
|
||||
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
@ -105,7 +105,7 @@ exception_safety_test()
|
||||
test_exception x;
|
||||
try
|
||||
{
|
||||
x << test_4(throws_on_copy());
|
||||
add_info(x,test_4(throws_on_copy()));
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
@ -124,13 +124,13 @@ throw_empty()
|
||||
void
|
||||
throw_test_1( char const * value )
|
||||
{
|
||||
throw test_exception() << test_5(std::string(value));
|
||||
throw add_info(test_exception(),test_5(std::string(value)));
|
||||
}
|
||||
|
||||
void
|
||||
throw_test_2()
|
||||
{
|
||||
throw test_exception() << test_6(non_printable());
|
||||
throw add_info(test_exception(),test_6(non_printable()));
|
||||
}
|
||||
|
||||
void
|
||||
@ -144,7 +144,7 @@ throw_catch_add_file_name( char const * name )
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
x << test_5(std::string(name));
|
||||
add_info(x,test_5(std::string(name)));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@ -256,10 +256,10 @@ test_add_tuple()
|
||||
typedef boost::tuple<test_1,test_2,test_3,test_5> tuple_test_1235;
|
||||
try
|
||||
{
|
||||
throw test_exception() << tuple_test_();
|
||||
throw add_info(test_exception(),tuple_test_());
|
||||
}
|
||||
catch(
|
||||
test_exception & x )
|
||||
test_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
@ -269,7 +269,7 @@ test_add_tuple()
|
||||
}
|
||||
try
|
||||
{
|
||||
throw test_exception() << tuple_test_1(42);
|
||||
throw add_info(test_exception(),tuple_test_1(42));
|
||||
}
|
||||
catch(
|
||||
test_exception & x )
|
||||
@ -283,7 +283,7 @@ test_add_tuple()
|
||||
}
|
||||
try
|
||||
{
|
||||
throw test_exception() << tuple_test_12(42,42u);
|
||||
throw add_info(test_exception(),tuple_test_12(42,42u));
|
||||
}
|
||||
catch(
|
||||
test_exception & x )
|
||||
@ -298,7 +298,7 @@ test_add_tuple()
|
||||
}
|
||||
try
|
||||
{
|
||||
throw test_exception() << tuple_test_123(42,42u,42.0f);
|
||||
throw add_info(test_exception(),tuple_test_123(42,42u,42.0f));
|
||||
}
|
||||
catch(
|
||||
test_exception & x )
|
||||
@ -314,7 +314,7 @@ test_add_tuple()
|
||||
}
|
||||
try
|
||||
{
|
||||
throw test_exception() << tuple_test_1235(42,42u,42.0f,std::string("42"));
|
||||
throw add_info(test_exception(),tuple_test_1235(42,42u,42.0f,std::string("42")));
|
||||
}
|
||||
catch(
|
||||
test_exception & x )
|
||||
@ -337,7 +337,7 @@ test_lifetime1()
|
||||
int count=0;
|
||||
try
|
||||
{
|
||||
throw test_exception() << test_7(user_data(count));
|
||||
throw add_info(test_exception(),test_7(user_data(count)));
|
||||
}
|
||||
catch(
|
||||
boost::exception & x )
|
||||
@ -359,7 +359,7 @@ test_lifetime2()
|
||||
int count=0;
|
||||
{
|
||||
boost::exception_ptr ep;
|
||||
test_exception e; e<<test_7(user_data(count));
|
||||
test_exception e; add_info(e,test_7(user_data(count)));
|
||||
ep=boost::copy_exception(e);
|
||||
BOOST_TEST(count>0);
|
||||
}
|
@ -87,7 +87,7 @@ exc:
|
||||
}
|
||||
|
||||
virtual
|
||||
~exc() throw()
|
||||
~exc() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
--exc_count;
|
||||
}
|
||||
@ -121,9 +121,42 @@ check( boost::shared_ptr<thread_handle> const & t )
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
test_deep_copy()
|
||||
{
|
||||
int const * p1=0;
|
||||
boost::exception_ptr p;
|
||||
try
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(exc() << answer(42));
|
||||
BOOST_ERROR("BOOST_THROW_EXCEPTION didn't throw");
|
||||
}
|
||||
catch(
|
||||
exc & e )
|
||||
{
|
||||
p1=boost::get_error_info<answer>(e);
|
||||
p=boost::current_exception();
|
||||
}
|
||||
BOOST_TEST(p1!=0);
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
boost::rethrow_exception(p);
|
||||
BOOST_ERROR("rethrow_exception didn't throw");
|
||||
}
|
||||
catch(
|
||||
exc & e )
|
||||
{
|
||||
int const * p2=boost::get_error_info<answer>(e);
|
||||
BOOST_TEST(p2!=0 && *p2==42);
|
||||
BOOST_TEST(p2!=p1);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test_deep_copy();
|
||||
BOOST_TEST(++exc_count==1);
|
||||
try
|
||||
{
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_4AEB7924CA2E11DC888A8C9355D89593
|
||||
#define UUID_4AEB7924CA2E11DC888A8C9355D89593
|
||||
#ifndef BOOST_EXCEPTION_4AEB7924CA2E11DC888A8C9355D89593
|
||||
#define BOOST_EXCEPTION_4AEB7924CA2E11DC888A8C9355D89593
|
||||
|
||||
namespace
|
||||
boost
|
||||
|
@ -20,7 +20,7 @@ boost
|
||||
}
|
||||
|
||||
derives_boost_exception::
|
||||
~derives_boost_exception() throw()
|
||||
~derives_boost_exception() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ boost
|
||||
}
|
||||
|
||||
derives_boost_exception_virtually::
|
||||
~derives_boost_exception_virtually() throw()
|
||||
~derives_boost_exception_virtually() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ boost
|
||||
}
|
||||
|
||||
derives_std_exception::
|
||||
~derives_std_exception() throw()
|
||||
~derives_std_exception() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
//Distributed under 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)
|
||||
|
||||
#ifndef UUID_BC765EB4CA2A11DCBDC5828355D89593
|
||||
#define UUID_BC765EB4CA2A11DCBDC5828355D89593
|
||||
#ifndef BOOST_EXCEPTION_BC765EB4CA2A11DCBDC5828355D89593
|
||||
#define BOOST_EXCEPTION_BC765EB4CA2A11DCBDC5828355D89593
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <exception>
|
||||
@ -21,7 +21,7 @@ boost
|
||||
public std::exception
|
||||
{
|
||||
explicit derives_boost_exception( int x );
|
||||
virtual ~derives_boost_exception() throw();
|
||||
virtual ~derives_boost_exception() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
int x_;
|
||||
};
|
||||
|
||||
@ -31,7 +31,7 @@ boost
|
||||
public std::exception
|
||||
{
|
||||
explicit derives_boost_exception_virtually( int x );
|
||||
virtual ~derives_boost_exception_virtually() throw();
|
||||
virtual ~derives_boost_exception_virtually() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
int x_;
|
||||
};
|
||||
|
||||
@ -40,7 +40,7 @@ boost
|
||||
public std::exception
|
||||
{
|
||||
explicit derives_std_exception( int x );
|
||||
virtual ~derives_std_exception() throw();
|
||||
virtual ~derives_std_exception() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
int x_;
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct
|
||||
@ -17,7 +17,7 @@ my_exception:
|
||||
std::exception
|
||||
{
|
||||
char const *
|
||||
what() const throw()
|
||||
what() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return "my_exception";
|
||||
}
|
||||
@ -39,7 +39,12 @@ boost
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_TEST(s.find("my_tag")!=std::string::npos);
|
||||
#endif
|
||||
exit(0);
|
||||
exit(boost::report_errors());
|
||||
}
|
||||
void
|
||||
throw_exception(std::exception const & x, boost::source_location const &)
|
||||
{
|
||||
throw_exception(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,25 @@ throw_unknown_exception()
|
||||
throw test_exception();
|
||||
}
|
||||
|
||||
struct
|
||||
user_defined_exception
|
||||
{
|
||||
user_defined_exception(int d):data(d){}
|
||||
int data;
|
||||
};
|
||||
|
||||
void
|
||||
throw_user_defined_exception()
|
||||
{
|
||||
throw user_defined_exception(42);
|
||||
}
|
||||
|
||||
void
|
||||
throw_builtin_exception()
|
||||
{
|
||||
throw 42;
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -138,5 +157,115 @@ main()
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
throw_user_defined_exception();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr ep=boost::current_exception();
|
||||
try
|
||||
{
|
||||
rethrow_exception(ep);
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
catch(
|
||||
user_defined_exception & x)
|
||||
{
|
||||
//Yay! std::current_exception to the rescue!
|
||||
BOOST_TEST( 42==x.data );
|
||||
}
|
||||
#else
|
||||
catch(
|
||||
boost::unknown_exception & )
|
||||
{
|
||||
//Boo! user defined exception was transported as a boost::unknown_exception
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
try
|
||||
{
|
||||
rethrow_exception(ep);
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
catch(
|
||||
user_defined_exception & x)
|
||||
{
|
||||
//Yay! std::current_exception to the rescue!
|
||||
BOOST_TEST( 42==x.data );
|
||||
}
|
||||
#else
|
||||
catch(
|
||||
boost::unknown_exception & )
|
||||
{
|
||||
//Boo! user defined exception was transported as a boost::unknown_exception
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
throw_builtin_exception();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr ep=boost::current_exception();
|
||||
try
|
||||
{
|
||||
rethrow_exception(ep);
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
catch(
|
||||
int & x)
|
||||
{
|
||||
//Yay! std::current_exception to the rescue!
|
||||
BOOST_TEST( 42==x );
|
||||
}
|
||||
#else
|
||||
catch(
|
||||
boost::unknown_exception & )
|
||||
{
|
||||
//Boo! builtin exception was transported as a boost::unknown_exception
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
try
|
||||
{
|
||||
rethrow_exception(ep);
|
||||
}
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
catch(
|
||||
int & x)
|
||||
{
|
||||
//Yay! std::current_exception to the rescue!
|
||||
BOOST_TEST( 42==x );
|
||||
}
|
||||
#else
|
||||
catch(
|
||||
boost::unknown_exception & )
|
||||
{
|
||||
//Boo! builtin exception was transported as a boost::unknown_exception
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user