summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Van Patten <timvp@google.com> 2025-01-10 16:03:17 -0700
committer Tim Van Patten <timvp@google.com> 2025-01-13 16:04:08 -0700
commitf591be70ecf6441037bfe40bfc5baae1cc68baa8 (patch)
treeb76b9a23c8470b5b002261b418b7ba38f91216c5
parent87320a613f2b6994beaf45954b7f2733bb2519b8 (diff)
vkjson: Move redefinition of FALLTHROUGH_INTENDED
The macro FALLTHROUGH_INTENDED is defined in both vulkan/vkjson/vkjson.h and android-base/macros.h, causing build errors for any other modules that include both header files. Move the redefinition to vkjson.cc. Note that <android-base/macros.h> is not available for the libvkjson_ndk build, so we cannot use that version of the macro and eliminate the redefinition entirely. Bug: 372694741 Test: CQ Flag: EXEMPT bugfix Change-Id: I02a0f2a50f3807ca932e84a5a002598b04c5f92a
-rw-r--r--vulkan/vkjson/vkjson.cc6
-rw-r--r--vulkan/vkjson/vkjson.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc
index 3cb94050af..8c0cce26ba 100644
--- a/vulkan/vkjson/vkjson.cc
+++ b/vulkan/vkjson/vkjson.cc
@@ -38,6 +38,12 @@
namespace {
+/*
+ * Annotation to tell clang that we intend to fall through from one case to
+ * another in a switch. Sourced from android-base/macros.h.
+ */
+#define FALLTHROUGH_INTENDED [[clang::fallthrough]]
+
inline bool IsIntegral(double value) {
#if defined(ANDROID)
// Android NDK doesn't provide std::trunc yet
diff --git a/vulkan/vkjson/vkjson.h b/vulkan/vkjson/vkjson.h
index 28de680a99..5818c73b16 100644
--- a/vulkan/vkjson/vkjson.h
+++ b/vulkan/vkjson/vkjson.h
@@ -33,12 +33,6 @@
#undef max
#endif
-/*
- * Annotation to tell clang that we intend to fall through from one case to
- * another in a switch. Sourced from android-base/macros.h.
- */
-#define FALLTHROUGH_INTENDED [[clang::fallthrough]]
-
struct VkJsonLayer {
VkLayerProperties properties;
std::vector<VkExtensionProperties> extensions;