From 4eeab96f105f12cfbecc305c3f46475b6724470c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Dec 2018 17:02:04 +0100 Subject: [PATCH] Cleanup: fix ATTR_FALLTHROUGH warnings. Ref D3960. --- intern/cycles/util/util_defines.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/intern/cycles/util/util_defines.h b/intern/cycles/util/util_defines.h index 429cfe647ef..2cb42d9bd56 100644 --- a/intern/cycles/util/util_defines.h +++ b/intern/cycles/util/util_defines.h @@ -69,10 +69,12 @@ # 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) +# ifndef ATTR_FALLTHROUGH +# if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ +# define ATTR_FALLTHROUGH __attribute__((fallthrough)) +# else +# define ATTR_FALLTHROUGH ((void) 0) +# endif # endif #endif /* __KERNEL_GPU__ */