Skip to content

Commit 2f9db35

Browse files
authored
[XPTI] Don't define macro with reserved name (#15722)
__XPTI_INSERT_IF_MSVC is a reserved name. Additionally this macro was only used once, right next to some gcc and clang conditional inclusion of a similar form, so it makes sense to just delete the definition and expand the use.
1 parent 45c33e9 commit 2f9db35

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

xpti/include/xpti/xpti_trace_framework.hpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ typedef void *xpti_plugin_function_t;
5555
#endif
5656
#endif
5757

58-
/// Insert something when compiled with msvc
59-
/// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
60-
#ifdef _MSC_VER
61-
#define __XPTI_INSERT_IF_MSVC(x) x
62-
#else
63-
#define __XPTI_INSERT_IF_MSVC(x)
64-
#endif
65-
6658
namespace xpti {
6759
namespace utils {
6860
/// @class StringHelper
@@ -219,7 +211,9 @@ class PlatformHelper {
219211
#pragma GCC diagnostic push
220212
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
221213
#endif
222-
__XPTI_INSERT_IF_MSVC(__pragma(warning(suppress : 4996)))
214+
#ifdef _MSC_VER
215+
#pragma warning(suppress : 4996)
216+
#endif
223217
const char *val = std::getenv(var.c_str());
224218
#if defined(__GNUC__) || defined(__clang__)
225219
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)