Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
39a3c346
Commit
39a3c346
authored
Jan 04, 2016
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #274 from zarvox/msvc2015-exception-count
Support extracting the current exception count on MSVC2015.
parents
00aed556
15a01ad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
exception.c++
c++/src/kj/exception.c++
+14
-6
No files found.
c++/src/kj/exception.c++
View file @
39a3c346
...
...
@@ -550,23 +550,31 @@ uint uncaughtExceptionCount() {
#elif _MSC_VER
#if 0
// TODO(msvc): The below was copied from:
// https://github.com/panaseleus/stack_unwinding/blob/master/boost/exception/uncaught_exception_count.hpp
// Alas, it doesn not appera to work on MSVC2015. The linker claims _getptd() doesn't exist.
#if _MSC_VER >= 1900
// MSVC14 has a refactored CRT which now provides a direct accessor for this value.
// See https://svn.boost.org/trac/boost/ticket/10158 for a brief discussion.
extern
"C"
int
*
__cdecl
__processing_throw
();
uint
uncaughtExceptionCount
()
{
return
static_cast
<
uint
>
(
*
__processing_throw
());
}
#elif _MSC_VER >= 1400
// The below was copied from:
// https://github.com/panaseleus/stack_unwinding/blob/master/boost/exception/uncaught_exception_count.hpp
extern
"C"
char
*
__cdecl
_getptd
();
uint
uncaughtExceptionCount
()
{
return
*
reinterpret_cast
<
uint
*>
(
_getptd
()
+
(
sizeof
(
void
*
)
==
8
?
0x100
:
0x90
));
}
#endif
#else
uint
uncaughtExceptionCount
()
{
// Since the above doesn't work, fall back to uncaught_exception(). This will produce incorrect
// results in very obscure cases that Cap'n Proto doesn't really rely on anyway.
return
std
::
uncaught_exception
();
}
#endif
#else
#error "This needs to be ported to your compiler / C++ ABI."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment