Cleanup: fix ATTR_FALLTHROUGH warnings.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 21 Dec 2018 16:02:04 +0000 (17:02 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 21 Dec 2018 16:02:04 +0000 (17:02 +0100)
Ref D3960.

intern/cycles/util/util_defines.h

index 429cfe647efa699b27cad0a8e3f0b1accd5df6b6..2cb42d9bd56e192f27858c7b43267170ae7177b7 100644 (file)
 #  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__ */