Skip to content

[XPTI] Don't define macro with reserved name #15722

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 3, 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
14 changes: 4 additions & 10 deletions xpti/include/xpti/xpti_trace_framework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ typedef void *xpti_plugin_function_t;
#endif
#endif

/// Insert something when compiled with msvc
/// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
#ifdef _MSC_VER
#define __XPTI_INSERT_IF_MSVC(x) x
#else
#define __XPTI_INSERT_IF_MSVC(x)
#endif

namespace xpti {
namespace utils {
/// @class StringHelper
Expand Down Expand Up @@ -219,7 +211,9 @@ class PlatformHelper {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
__XPTI_INSERT_IF_MSVC(__pragma(warning(suppress : 4996)))
#ifdef _MSC_VER
#pragma warning(suppress : 4996)
#endif
const char *val = std::getenv(var.c_str());
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
Expand Down Expand Up @@ -1779,4 +1773,4 @@ class tracepoint_t {
///
/// @param self A pointer to the current function.
///
#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true);
#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true);
Loading