unwind: remove last instance of -Wexpansion-to-defined
This unifies the definition of _LIBUNWIND_BUILD_SJLJ_APIS. It also further
generalises the definition to allow building these APIs on non-Apple targets
when `-fsjlj-excceptions` is used. The header is now clean of macros which
expand to defined checks.
git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@267509 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/config.h b/src/config.h
index f31769c..46bb08a 100644
--- a/src/config.h
+++ b/src/config.h
@@ -30,8 +30,6 @@
// Platform specific configuration defines.
#ifdef __APPLE__
- #define _LIBUNWIND_BUILD_SJLJ_APIS defined(__arm__)
-
#if defined(FOR_DYLD)
#define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
#define _LIBUNWIND_SUPPORT_DWARF_UNWIND 0
@@ -42,8 +40,6 @@
#define _LIBUNWIND_SUPPORT_DWARF_INDEX 0
#endif
#else
- #define _LIBUNWIND_BUILD_SJLJ_APIS 0
-
#if defined(__ARM_DWARF_EH__) || !defined(__arm__)
#define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 0
#define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
@@ -59,6 +55,12 @@
#define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
#define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
+#define _LIBUNWIND_BUILD_SJLJ_APIS 1
+#else
+#define _LIBUNWIND_BUILD_SJLJ_APIS 0
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
#define _LIBUNWIND_SUPPORT_FRAME_APIS 1
#else