mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-12 12:26: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:
|
* 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
|
* This allows declaring case statement to explicitly fall through in switch
|
||||||
* statements. To enable this feature, use `-Wimplicit-fallthrough` during
|
* statements. To enable this feature, use `-Wimplicit-fallthrough` during
|
||||||
* compilation.
|
* compilation.
|
||||||
@ -559,6 +559,8 @@
|
|||||||
*/
|
*/
|
||||||
#if __GNUC__ > 6
|
#if __GNUC__ > 6
|
||||||
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
|
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
|
||||||
|
#elif g_macro__has_attribute (fallthrough)
|
||||||
|
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
|
||||||
#else
|
#else
|
||||||
#define G_GNUC_FALLTHROUGH
|
#define G_GNUC_FALLTHROUGH
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user