fix mingw
This commit is contained in:
@@ -72,6 +72,8 @@ if(NOT MSVC)
|
||||
target_compile_options(snmalloc_lib INTERFACE -mcx16)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
|
||||
target_compile_options(snmalloc_lib INTERFACE -mcx16)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
|
||||
target_compile_options(snmalloc_lib INTERFACE -mcx16)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
|
||||
target_compile_options(snmalloc_lib INTERFACE -mcx16)
|
||||
# XXX elseif ARM?
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
#if defined(_WIN32) && defined(__GNUC__)
|
||||
#define USE_CLZLL
|
||||
#endif
|
||||
#ifdef pause
|
||||
# undef pause
|
||||
#endif
|
||||
@@ -75,6 +77,8 @@ namespace snmalloc
|
||||
|
||||
return BITS - index - 1;
|
||||
# endif
|
||||
#elif defined(USE_CLZLL)
|
||||
return static_cast<size_t>(__builtin_clzll(x));
|
||||
#else
|
||||
return static_cast<size_t>(__builtin_clzl(x));
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
#include "../mem/allocconfig.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef _MSC_VER
|
||||
# include <cstdio>
|
||||
# endif
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define NOMINMAX
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# include <windows.h>
|
||||
// VirtualAlloc2 is exposed in RS5 headers.
|
||||
# ifdef NTDDI_WIN10_RS5
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define NOMINMAX
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# include <windows.h>
|
||||
// Needs to be included after windows.h
|
||||
# include <psapi.h>
|
||||
|
||||
Reference in New Issue
Block a user