Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | //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 Thompson | 2491bd6 | 2013-10-15 17:10:24 -0700 | [diff] [blame^] | 6 | #ifndef NDNBOOST_UUID_7E83C166200811DE885E826156D89593 |
| 7 | #define NDNBOOST_UUID_7E83C166200811DE885E826156D89593 |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 8 | #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 9 | #pragma GCC system_header |
| 10 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 11 | #if defined(_MSC_VER) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 12 | #pragma warning(push,1) |
| 13 | #endif |
| 14 | |
| 15 | namespace |
| 16 | ndnboost |
| 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 40 | #if defined(_MSC_VER) && !defined(NDNBOOST_EXCEPTION_ENABLE_WARNINGS) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 41 | #pragma warning(pop) |
| 42 | #endif |
| 43 | #endif |