diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-24 18:23:54 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-24 18:23:54 +0300 |
commit | 55c15ad9ded2707d16cb88eea2dc2a62e4ec2359 (patch) | |
tree | 9f4c1bf3392e5b69b84d5214f7f1b9b8d875222b /intern/cycles/util | |
parent | 3de9db96508309646d2d715eee483ca5ff909b87 (diff) |
Cycles: Use falltrhough attribute to help catching missing break statements
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_types.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 0039c59ec48..a5d1d7152d5 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -68,6 +68,13 @@ # define ccl_never_inline __attribute__((noinline)) # define ccl_maybe_unused __attribute__((used)) # endif /* _WIN32 && !FREE_WINDOWS */ + +/* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */ +# if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ +# define ATTR_FALLTHROUGH __attribute__((fallthrough)) +# else +# define ATTR_FALLTHROUGH ((void)0) +# endif #endif /* __KERNEL_GPU__ */ /* Standard Integer Types */ |