Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libstdc++-v3 / libsupc++ / eh_personality.cc
index 729d688..e2ceb11 100644 (file)
@@ -1,7 +1,5 @@
 // -*- C++ -*- The GNU C++ exception personality routine.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-// 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-2013 Free Software Foundation, Inc.
 //
 // This file is part of GCC.
 //
@@ -332,11 +330,18 @@ namespace __cxxabiv1
 #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
 #define PERSONALITY_FUNCTION   __gxx_personality_sj0
 #define __builtin_eh_return_data_regno(x) x
+#elif defined(__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+#define PERSONALITY_FUNCTION   __gxx_personality_imp
 #else
 #define PERSONALITY_FUNCTION   __gxx_personality_v0
 #endif
 
-extern "C" _Unwind_Reason_Code
+#if defined (__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+static
+#else
+extern "C"
+#endif
+_Unwind_Reason_Code
 #ifdef __ARM_EABI_UNWINDER__
 PERSONALITY_FUNCTION (_Unwind_State state,
                      struct _Unwind_Exception* ue_header,
@@ -761,7 +766,7 @@ __cxa_call_unexpected (void *exc_obj_in)
       if (check_exception_spec (&info, __get_exception_header_from_obj
                                   (new_ptr)->exceptionType,
                                new_ptr, xh_switch_value))
-       __throw_exception_again;
+       { __throw_exception_again; }
 
       // If the exception spec allows std::bad_exception, throw that.
       // We don't have a thrown object to compare against, but since
@@ -778,4 +783,15 @@ __cxa_call_unexpected (void *exc_obj_in)
 }
 #endif
 
+#if defined (__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+extern "C"
+EXCEPTION_DISPOSITION
+__gxx_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
+                       PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)
+{
+  return _GCC_specific_handler (ms_exc, this_frame, ms_orig_context,
+                               ms_disp, __gxx_personality_imp);
+}
+#endif /* SEH */
+
 } // namespace __cxxabiv1