Skip to content

Commit

Permalink
[SYCL] Fix macro definition conflicting with MSVC (#6798)
Browse files Browse the repository at this point in the history
The _CONCAT macro is defined in MSVC headers so to avoid redefinition
warnings this commit changes the naming in the PI mock plugin from
_CONCAT to _PI_MOCK_PLUGIN_CONCAT.

Signed-off-by: Larsen, Steffen <[email protected]>
  • Loading branch information
steffenlarsen authored Sep 15, 2022
1 parent 398571a commit 6647cfd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sycl/unittests/helpers/PiMockPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,15 +899,15 @@ inline pi_result mock_piPluginGetLastError(char **message) {
return PI_SUCCESS;
}

#define _CONCAT(A, B) A##B
#define CONCAT(A, B) _CONCAT(A, B)
#define _PI_MOCK_PLUGIN_CONCAT(A, B) A##B
#define PI_MOCK_PLUGIN_CONCAT(A, B) _PI_MOCK_PLUGIN_CONCAT(A, B)

inline pi_plugin::FunctionPointers getMockedFunctionPointers() {
return {
#define _PI_API(api) CONCAT(mock_, api),
#define _PI_API(api) PI_MOCK_PLUGIN_CONCAT(mock_, api),
#include <sycl/detail/pi.def>
};
}

#undef CONCAT
#undef _CONCAT
#undef PI_MOCK_PLUGIN_CONCAT
#undef _PI_MOCK_PLUGIN_CONCAT

0 comments on commit 6647cfd

Please sign in to comment.