Skip to content

Commit 40cba90

Browse files
committed
Merge pull request #112823 from Ivorforce/tracy-unique-name
Fix `GodotProfileZone` with tracy backend failing with shadowed variable name warnings
2 parents f14c189 + 98caaeb commit 40cba90

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

core/profiling/profiling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
// Define tracing macros.
5353
#define GodotProfileFrameMark FrameMark
54-
#define GodotProfileZone(m_zone_name) ZoneScopedN(m_zone_name)
54+
#define GodotProfileZone(m_zone_name) ZoneNamedN(GD_UNIQUE_NAME(__godot_tracy_szone_), m_zone_name, true)
5555
#define GodotProfileZoneGroupedFirst(m_group_name, m_zone_name) ZoneNamedN(__godot_tracy_zone_##m_group_name, m_zone_name, true)
5656
#define GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name) __godot_tracy_zone_##m_group_name.~ScopedZone();
5757
#ifndef TRACY_CALLSTACK

core/typedefs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,8 @@ constexpr bool is_fully_defined_v = is_fully_defined<T>::value;
465465
#else
466466
#define STATIC_ASSERT_INCOMPLETE_TYPE(m_keyword, m_type)
467467
#endif
468+
469+
#define _GD_VARNAME_CONCAT_B_(m_ignore, m_name) m_name
470+
#define _GD_VARNAME_CONCAT_A_(m_a, m_b, m_c) _GD_VARNAME_CONCAT_B_(hello there, m_a##m_b##m_c)
471+
#define _GD_VARNAME_CONCAT_(m_a, m_b, m_c) _GD_VARNAME_CONCAT_A_(m_a, m_b, m_c)
472+
#define GD_UNIQUE_NAME(m_name) _GD_VARNAME_CONCAT_(m_name, _, __COUNTER__)

modules/mono/utils/macros.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030

3131
#pragma once
3232

33-
#define _GD_VARNAME_CONCAT_B_(m_ignore, m_name) m_name
34-
#define _GD_VARNAME_CONCAT_A_(m_a, m_b, m_c) _GD_VARNAME_CONCAT_B_(hello there, m_a##m_b##m_c)
35-
#define _GD_VARNAME_CONCAT_(m_a, m_b, m_c) _GD_VARNAME_CONCAT_A_(m_a, m_b, m_c)
36-
#define GD_UNIQUE_NAME(m_name) _GD_VARNAME_CONCAT_(m_name, _, __COUNTER__)
33+
#include "core/typedefs.h"
3734

3835
// unreachable
3936

0 commit comments

Comments
 (0)