]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common header file not applicable to open-vm-tools.
authorKruti Pendharkar <kp025370@broadcom.com>
Wed, 8 Jan 2025 06:05:52 +0000 (22:05 -0800)
committerKruti Pendharkar <kp025370@broadcom.com>
Wed, 8 Jan 2025 06:05:52 +0000 (22:05 -0800)
open-vm-tools/lib/include/vm_basic_defs.h

index 90ac5cd7520b7868d4cf2aeb941a03d5daf379dc..9941e68b8bd772172c151f895341b15e42ed2fed 100644 (file)
@@ -1029,18 +1029,21 @@ typedef int pid_t;
 #define VMW_CLANG_ANALYZER_NORETURN() ((void)0)
 #endif
 
-/* VMW_FALLTHROUGH
+/*
+ * VMW_FALLTHROUGH
  *
  *   Instructs capable compilers to not warn when a case label of a
  *   'switch' statement falls through to the next label.
  *
  *   If not a matched compiler, expands to nothing.
  */
-#if (defined(__GNUC__) && (__GNUC__ >= 9)) ||           \
-    (defined(__clang__) && (__clang_major__ >= 13))
-#define VMW_FALLTHROUGH() __attribute__((fallthrough))
+#if __cplusplus >= 201703L
+   #define VMW_FALLTHROUGH() [[fallthrough]]
+#elif (defined(__GNUC__) && (__GNUC__ >= 9)) ||           \
+      (defined(__clang__) && (__clang_major__ >= 13))
+   #define VMW_FALLTHROUGH() __attribute__((fallthrough))
 #else
-#define VMW_FALLTHROUGH()
+   #define VMW_FALLTHROUGH()
 #endif
 
 #endif // ifndef _VM_BASIC_DEFS_H_