blob: 9a724c1cb242d63a7c9c36b4e38220a614f0143e [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
2
3//Distributed under the Boost Software License, Version 1.0. (See accompanying
4//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
Jeff Thompson2491bd62013-10-15 17:10:24 -07006#ifndef NDNBOOST_UUID_7E83C166200811DE885E826156D89593
7#define NDNBOOST_UUID_7E83C166200811DE885E826156D89593
Jeff Thompson3d613fd2013-10-15 15:39:04 -07008#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS)
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07009#pragma GCC system_header
10#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -070011#if defined(_MSC_VER) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS)
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070012#pragma warning(push,1)
13#endif
14
15namespace
16ndnboost
17 {
18 template <class E>
19 inline
20 E *
21 current_exception_cast()
22 {
23 try
24 {
25 throw;
26 }
27 catch(
28 E & e )
29 {
30 return &e;
31 }
32 catch(
33 ...)
34 {
35 return 0;
36 }
37 }
38 }
39
Jeff Thompson3d613fd2013-10-15 15:39:04 -070040#if defined(_MSC_VER) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS)
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070041#pragma warning(pop)
42#endif
43#endif