mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
Merge branch 'wip/baedert/fallthrough-clang' into 'master'
macros: Define G_GNUC_FALLTHROUGH for more compilers See merge request GNOME/glib!1396
This commit is contained in:
commit
51953dd857
@ -532,7 +532,7 @@
|
||||
/**
|
||||
* G_GNUC_FALLTHROUGH:
|
||||
*
|
||||
* Expands to the GNU C `fallthrough` statement attribute if the compiler is gcc.
|
||||
* Expands to the GNU C `fallthrough` statement attribute if the compiler supports it.
|
||||
* This allows declaring case statement to explicitly fall through in switch
|
||||
* statements. To enable this feature, use `-Wimplicit-fallthrough` during
|
||||
* compilation.
|
||||
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user