Skip to content

Fix print_verbose() macro conflicting with UtilityFunctions::print_verbose() #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions include/godot_cpp/core/print_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ void print_line_rich(const Variant &p_variant, Args... p_args) {
UtilityFunctions::print_rich(p_variant, p_args...);
}

template <typename... Args>
void print_verbose(const Variant &p_variant, Args... p_args) {
UtilityFunctions::print_verbose(p_variant, p_args...);
}

bool is_print_verbose_enabled();

// Checking the condition before evaluating the text to be printed avoids processing unless it actually has to be printed, saving some CPU usage.
#define print_verbose(m_variant) \
{ \
if (is_print_verbose_enabled()) { \
print_line(m_variant); \
} \
}
} // namespace godot

#endif // GODOT_PRINT_STRING_HPP