diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index 0c282412695..8de1be161e3 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -13,9 +13,11 @@ #pragma warning(1 : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' // All STL headers should protect themselves from macroized new. +#if !(defined(__CUDACC__) && defined(__clang__)) #pragma push_macro("new") #undef new #define new WILL NOT COMPILE +#endif // !(defined(__CUDACC__) && defined(__clang__)) // VSO-768746: mbctype.h macroizes _MS, _MP, _M1, and _M2. Include it first for test coverage. #ifndef _MSVC_TESTING_NVCC @@ -232,7 +234,9 @@ #endif // _M_CEE_PURE #endif // _MSVC_TESTING_NVCC +#if !(defined(__CUDACC__) && defined(__clang__)) #pragma pop_macro("new") +#endif // !(defined(__CUDACC__) && defined(__clang__)) #pragma warning(pop) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 28ff4d915c4..9c5863e1d35 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -584,7 +584,7 @@ #define _MSVC_STL_UPDATE 202112L #ifndef _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -#ifdef __CUDACC__ +#if defined(__CUDACC__) && defined(__CUDACC_VER_MAJOR__) #if __CUDACC_VER_MAJOR__ < 10 \ || (__CUDACC_VER_MAJOR__ == 10 \ && (__CUDACC_VER_MINOR__ < 1 || (__CUDACC_VER_MINOR__ == 1 && __CUDACC_VER_BUILD__ < 243)))