Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2020-08-20 17:35:43 +0300
committerKen Brown <kbrown@cornell.edu>2020-08-20 17:46:23 +0300
commit14c0a4c67d4e8c296dac2f1fc6fb86da3b76d7fb (patch)
treea541b7dad1bb4f74156651481ff8d59263b58633
parent74cf7dabcb69ea0608163ba84ecc3d798d5b0421 (diff)
Cygwin: add header defining GCC exception codes
Include it in exceptions.cc instead of defining the exception codes there.
-rw-r--r--winsup/cygwin/exceptions.cc10
-rw-r--r--winsup/cygwin/gcc_seh.h19
2 files changed, 20 insertions, 9 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 61406e5d1..bb7704f94 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -28,6 +28,7 @@ details. */
#include "ntdll.h"
#include "exception.h"
#include "posix_timer.h"
+#include "gcc_seh.h"
/* Definitions for code simplification */
#ifdef __x86_64__
@@ -763,15 +764,6 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
return ExceptionContinueExecution;
#ifdef __x86_64__
-/* From the GCC source file libgcc/unwind-seh.c. */
-#define STATUS_USER_DEFINED (1U << 29)
-#define GCC_MAGIC (('G' << 16) | ('C' << 8) | 'C')
-#define GCC_EXCEPTION(TYPE) \
- (STATUS_USER_DEFINED | ((TYPE) << 24) | GCC_MAGIC)
-#define STATUS_GCC_THROW GCC_EXCEPTION (0)
-#define STATUS_GCC_UNWIND GCC_EXCEPTION (1)
-#define STATUS_GCC_FORCED GCC_EXCEPTION (2)
-
case STATUS_GCC_THROW:
case STATUS_GCC_UNWIND:
case STATUS_GCC_FORCED:
diff --git a/winsup/cygwin/gcc_seh.h b/winsup/cygwin/gcc_seh.h
new file mode 100644
index 000000000..fb779ef73
--- /dev/null
+++ b/winsup/cygwin/gcc_seh.h
@@ -0,0 +1,19 @@
+/* gcc_seh.h: GCC exception codes.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#pragma once
+
+/* From the GCC source file libgcc/unwind-seh.c. */
+
+#ifdef __x86_64__
+#define STATUS_USER_DEFINED (1U << 29)
+#define GCC_MAGIC (('G' << 16) | ('C' << 8) | 'C')
+#define GCC_EXCEPTION(TYPE) \
+ (STATUS_USER_DEFINED | ((TYPE) << 24) | GCC_MAGIC)
+#define STATUS_GCC_THROW GCC_EXCEPTION (0)
+#define STATUS_GCC_UNWIND GCC_EXCEPTION (1)
+#define STATUS_GCC_FORCED GCC_EXCEPTION (2)
+#endif