Mesa (main): venus: fix two VN_TRACE_SCOPE's in the same scope
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 10 05:23:17 UTC 2022
Module: Mesa
Branch: main
Commit: f93059b19f0e4ecaf11c22e59ea3f15b11c91a5d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f93059b19f0e4ecaf11c22e59ea3f15b11c91a5d
Author: Chia-I Wu <olvaffe at gmail.com>
Date: Wed Feb 9 14:07:32 2022 -0800
venus: fix two VN_TRACE_SCOPE's in the same scope
Make sure __LINE__ is expanded.
Reviewed-by: Ryan Neph <ryanneph at google.com>
Reviewed-by: Yiwei Zhang <zzyiwei at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14960>
---
src/virtio/vulkan/vn_common.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/virtio/vulkan/vn_common.h b/src/virtio/vulkan/vn_common.h
index 272311493a1..35b80789c80 100644
--- a/src/virtio/vulkan/vn_common.h
+++ b/src/virtio/vulkan/vn_common.h
@@ -67,8 +67,11 @@
#if __has_attribute(cleanup) && __has_attribute(unused)
+#define VN_TRACE_SCOPE_VAR_CONCAT(name, suffix) name##suffix
+#define VN_TRACE_SCOPE_VAR(suffix) \
+ VN_TRACE_SCOPE_VAR_CONCAT(_vn_trace_scope_, suffix)
#define VN_TRACE_SCOPE(name) \
- int _vn_trace_scope_##__LINE__ \
+ int VN_TRACE_SCOPE_VAR(__LINE__) \
__attribute__((cleanup(vn_trace_scope_end), unused)) = \
vn_trace_scope_begin(name)
More information about the mesa-commit
mailing list