[glib/wip/baedert/fallthrough-clang: 295/295] macros: Define G_GNUC_FALLTHROUGH for more compilers
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/baedert/fallthrough-clang: 295/295] macros: Define G_GNUC_FALLTHROUGH for more compilers
- Date: Fri, 28 Feb 2020 08:18:20 +0000 (UTC)
commit f04fff0309bd9c0819e630c7940d2314b4e97f2b
Author: Timm Bäder <mail baedert org>
Date: Fri Feb 28 08:59:23 2020 +0100
macros: Define G_GNUC_FALLTHROUGH for more compilers
Some compilers have __GNUC__ defined as a value less than 6, but do
support implicit-fallthrough via __attribute__((fallthrough)). Define
G_GNUC_FALLTHROUGH for those that support __has_attribute.
glib/gmacros.h | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 1f4d779be..76be83fb4 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -559,6 +559,8 @@
*/
#if __GNUC__ > 6
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
+#elif g_macro__has_attribute (fallthrough)
+#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
#else
#define G_GNUC_FALLTHROUGH
#endif /* __GNUC__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]