File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,10 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa
440440#endif // ^^^ !defined(_M_CEE_PURE) ^^^
441441#endif // !defined(_PREPARE_CONSTRAINED_REGIONS)
442442
443+ // Note: PrepareConstrainedRegions is not supported in .NET versions 6.0 and later. /clr:pure is
444+ // also not supported in /clr:netcore mode (which targets .NET 8.0 and later), so
445+ // _PREPARE_CONSTRAINED_REGIONS == 0 in that case.
446+
443447#if _PREPARE_CONSTRAINED_REGIONS
444448#define _BEGIN_LOCK (_Kind ) \
445449 { \
Original file line number Diff line number Diff line change 1010#include < Windows.h>
1111
1212#ifdef _M_CEE
13+ #if _PREPARE_CONSTRAINED_REGIONS
14+ #define _CRT_SUPPRESS_C4950
15+ #define _CRT_RESTORE_C4950
16+ #else // ^^^ _PREPARE_CONSTRAINED_REGIONS / !_PREPARE_CONSTRAINED_REGIONS vvv
17+ // Constrained regions are obsolete in .NET 6 and above.
18+ #define _CRT_SUPPRESS_C4950 __pragma (warning(push)) _pragma(warning(disable : 4950 ))
19+ #define _CRT_RESTORE_C4950 __pragma (warning(pop))
20+ #endif // ^^^ !_PREPARE_CONSTRAINED_REGIONS ^^^
1321#define _RELIABILITY_CONTRACT \
22+ _CRT_SUPPRESS_C4950 \
1423 [System::Runtime::ConstrainedExecution::ReliabilityContract( \
1524 System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \
16- System::Runtime::ConstrainedExecution::Cer::Success)]
25+ System::Runtime::ConstrainedExecution::Cer::Success)] /* */ \
26+ _CRT_RESTORE_C4950
1727#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv
1828#define _RELIABILITY_CONTRACT
1929#endif // ^^^ !defined(_M_CEE) ^^^
You can’t perform that action at this time.
0 commit comments