From f93059b19f0e4ecaf11c22e59ea3f15b11c91a5d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 9 Feb 2022 14:07:32 -0800 Subject: [PATCH] venus: fix two VN_TRACE_SCOPE's in the same scope Make sure __LINE__ is expanded. Reviewed-by: Ryan Neph Reviewed-by: Yiwei Zhang Part-of: --- 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)