From: Ken Brown <kbrown@cornell.edu>
To: cygwin-patches@cygwin.com
Subject: [PATCH 1/2] Cygwin: add header defining GCC exception codes
Date: Thu, 20 Aug 2020 10:55:59 -0400 [thread overview]
Message-ID: <20200820145600.21492-2-kbrown@cornell.edu> (raw)
In-Reply-To: <20200820145600.21492-1-kbrown@cornell.edu>
Include it in exceptions.cc instead of defining the exception codes
there.
---
winsup/cygwin/exceptions.cc | 10 +---------
winsup/cygwin/gcc_seh.h | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 9 deletions(-)
create mode 100644 winsup/cygwin/gcc_seh.h
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
--
2.28.0
next prev parent reply other threads:[~2020-08-20 14:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 14:55 [PATCH 0/2] " Ken Brown
2020-08-20 14:55 ` Ken Brown [this message]
2020-08-20 14:56 ` [PATCH 2/2] Cygwin: strace: ignore GCC exceptions Ken Brown
2020-08-20 17:29 ` [PATCH 0/2] GCC exception codes Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200820145600.21492-2-kbrown@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).