clang-10: use AFS_FALLTHROUGH for case fallthrough
[openafs.git] / src / config / stds.h
index 18ab2e3..254856d 100644 (file)
@@ -307,6 +307,14 @@ hdr_static_inline(unsigned long long) afs_printable_uint64_lu(afs_uint64 d) { re
 # define AFS_NONNULL(x)
 #endif
 
+#if defined(AFS_LINUX26_ENV) && defined(fallthrough)
+# define AFS_FALLTHROUGH fallthrough
+#elif defined(HAVE_FUNC_ATTRIBUTE_FALLTHROUGH)
+# define AFS_FALLTHROUGH __attribute__((fallthrough))
+#else
+# define AFS_FALLTHROUGH do {} while(0)
+#endif
+
 /*
  * Conditionally remove unreached statements under Solaris Studio.
  */