Only expose attribute name if not already defined
@@ -57,7 +57,6 @@ extern "C" {
/* https://en.cppreference.com/w/c/language/attributes/fallthrough */
-#ifndef fallthrough
#if PORTABLE_HAS_C_ATTRIBUTE(__fallthrough__)
# define pattribute_fallthrough [[__fallthrough__]]
#elif PORTABLE_HAS_ATTRIBUTE(__fallthrough__)
@@ -65,15 +64,18 @@ extern "C" {
#else
# define pattribute_fallthrough ((void)0)
#endif
-#endif
#define pattribute(x) pattribute_##x
#if PORTABLE_EXPOSE_ATTRIBUTES
+
+#ifndef fallthrough
# define fallthrough pattribute(fallthrough)
#endif
+#endif
+
#ifdef __cplusplus
}
