build: fixes for mingw support (#373)

This commit is contained in:
qruf 2023-09-16 20:15:31 +01:00 committed by GitHub
parent 0509c9a790
commit d189145a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -707,8 +707,8 @@ bool need_swap(std::ios_base &os)
void *q_aligned_malloc(size_t align, size_t size)
{
#ifdef _mm_malloc
return _mm_malloc(size, align);
#ifdef _WIN32
return _aligned_malloc(size, align);
#elif __STDC_VERSION__ >= 201112L
return aligned_alloc(align, size);
#else
@ -722,8 +722,8 @@ void *q_aligned_malloc(size_t align, size_t size)
void q_aligned_free(void *ptr)
{
#ifdef _mm_malloc
_mm_free(ptr);
#ifdef _WIN32
_aligned_free(ptr);
#else
free(ptr);
#endif

View File

@ -6,7 +6,7 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <windows.h>
#endif
static std::unique_ptr<tbb::global_control> tbbGlobalControl;

View File

@ -20,6 +20,7 @@
#pragma once
#include <array>
#include <cstdint>
#include <cstring> // for memcpy()
#include <string>
#include <string_view>

View File

@ -21,6 +21,7 @@
#include <cfloat>
#include <cmath>
#include <cstdint>
#include <vector>
#include <algorithm>