Remove Undefined preprocessor behaviour
This commit is contained in:
committed by
David Chisnall
parent
98dd9573c7
commit
9104f81285
@@ -7,6 +7,13 @@
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# define NOMINMAX
|
# define NOMINMAX
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
// VirtualAlloc2 is exposed in RS5 headers.
|
||||||
|
# ifdef NTDDI_WIN10_RS5
|
||||||
|
# if (NTDDI_VERSION >= NTDDI_WIN10_RS5) && (WINVER >= _WIN32_WINNT_WIN10)\
|
||||||
|
&& !defined(USE_SYSTEMATIC_TESTING)
|
||||||
|
# define PLATFORM_HAS_VIRTUALALLOC2
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
namespace snmalloc
|
namespace snmalloc
|
||||||
{
|
{
|
||||||
@@ -73,8 +80,7 @@ namespace snmalloc
|
|||||||
if (committed)
|
if (committed)
|
||||||
flags |= MEM_COMMIT;
|
flags |= MEM_COMMIT;
|
||||||
|
|
||||||
# if defined(NTDDI_WIN10_RS5) && (NTDDI_VERSION >= NTDDI_WIN10_RS5) && \
|
# ifdef PLATFORM_HAS_VIRTUALALLOC2
|
||||||
(WINVER >= _WIN32_WINNT_WIN10) && !defined(USE_SYSTEMATIC_TESTING)
|
|
||||||
// If we're on Windows 10 or newer, we can use the VirtualAlloc2
|
// If we're on Windows 10 or newer, we can use the VirtualAlloc2
|
||||||
// function. The FromApp variant is useable by UWP applications and
|
// function. The FromApp variant is useable by UWP applications and
|
||||||
// cannot allocate executable memory.
|
// cannot allocate executable memory.
|
||||||
|
|||||||
Reference in New Issue
Block a user