coarray_43.f90: Add "-latomic" option if libatomic_available.
[gcc.git] / libgcc / unwind-generic.h
index 4ff9017b88b6afbb5ce25b5ab2a98af64c3465d5..77dd5a90202d2ae4928e442ea6abf09541103d83 100644 (file)
@@ -1,5 +1,5 @@
 /* Exception handling and frame unwind runtime interface routines.
-   Copyright (C) 2001, 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
 #ifndef _UNWIND_H
 #define _UNWIND_H
 
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+/* Only for _GCC_specific_handler.  */
+#include <windows.h>
+#endif
+
 #ifndef HIDE_EXPORTS
 #pragma GCC visibility push(default)
 #endif
@@ -86,8 +91,13 @@ struct _Unwind_Exception
 {
   _Unwind_Exception_Class exception_class;
   _Unwind_Exception_Cleanup_Fn exception_cleanup;
+
+#if !defined (__USING_SJLJ_EXCEPTIONS__) && defined (__SEH__)
+  _Unwind_Word private_[6];
+#else
   _Unwind_Word private_1;
   _Unwind_Word private_2;
+#endif
 
   /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
      Taking that literally does not make much sense generically.  Instead we
@@ -211,8 +221,6 @@ _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
    compatible with the standard ABI for IA-64, we inline these.  */
 
 #ifdef __ia64__
-#include <stdlib.h>
-
 static inline _Unwind_Ptr
 _Unwind_GetDataRelBase (struct _Unwind_Context *_C)
 {
@@ -223,7 +231,7 @@ _Unwind_GetDataRelBase (struct _Unwind_Context *_C)
 static inline _Unwind_Ptr
 _Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
 {
-  abort ();
+  __builtin_abort ();
   return 0;
 }
 
@@ -265,6 +273,13 @@ extern void * _Unwind_FindEnclosingFunction (void *pc);
 # error "What type shall we use for _sleb128_t?"
 #endif
 
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+/* Handles the mapping from SEH to GCC interfaces.  */
+EXCEPTION_DISPOSITION _GCC_specific_handler (PEXCEPTION_RECORD, void *,
+                                            PCONTEXT, PDISPATCHER_CONTEXT,
+                                            _Unwind_Personality_Fn);
+#endif
+
 #ifdef __cplusplus
 }
 #endif