]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Fix problem with fallthrough attribute on macos 10.x.
authorChris Hanson <org/chris-hanson/cph>
Mon, 15 Feb 2021 06:45:11 +0000 (22:45 -0800)
committerChris Hanson <org/chris-hanson/cph>
Mon, 15 Feb 2021 07:22:26 +0000 (23:22 -0800)
(cherry picked from commit 0db6a7b19baa1b327f6656832c193ff072aa5286)

src/microcode/confshared.h

index f83671a4315efba284a729edafa43dbade24208a..900a7c62144e3de016422102e04ec3b10ff284d8 100644 (file)
@@ -150,11 +150,22 @@ USA.
 #  define NORETURN
 #endif
 
-#if (((defined (__GNUC__)) && (__GNUC__ >= 7)) || \
-       ((defined (__clang__)) && (__clang_major__ >= 10)))
+/* This detection should probably be done in configure.ac rather than here. */
+#if (defined (__APPLE__))
+#  if ((defined (__clang_major__)) && (__clang_major__ >= 12))
+#    define HAVE_FALLTHROUGH_ATTRIBUTE 1
+#  endif
+#else
+#  if (((defined (__GNUC__)) && (__GNUC__ >= 7)) \
+       || ((defined (__clang_major__)) && (__clang_major__ >= 10)))
+#    define HAVE_FALLTHROUGH_ATTRIBUTE 1
+#  endif
+#endif
+
+#if (defined (HAVE_FALLTHROUGH_ATTRIBUTE))
 #  define FALLTHROUGH() ATTRIBUTE ((__fallthrough__))
 #else
-#  define FALLTHROUGH() ((void)0)
+#  define FALLTHROUGH() ((void) 0)
 #endif
 \f
 /* Operating System / Machine dependencies: