mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
fix to enable successful build with mingw64
This commit is contained in:
parent
0c97e5f2c2
commit
f4840adf3d
@ -47,7 +47,15 @@ namespace ue2 {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* get us a posix_memalign from somewhere */
|
/* get us a posix_memalign from somewhere */
|
||||||
#if !defined(HAVE_POSIX_MEMALIGN)
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <intrin.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#define posix_memalign(A, B, C) ((*A = (void *)__mingw_aligned_malloc(C, B)) == nullptr)
|
||||||
|
|
||||||
|
#elif !defined(HAVE_POSIX_MEMALIGN)
|
||||||
# if defined(HAVE_MEMALIGN)
|
# if defined(HAVE_MEMALIGN)
|
||||||
#define posix_memalign(A, B, C) ((*A = (void *)memalign(B, C)) == nullptr)
|
#define posix_memalign(A, B, C) ((*A = (void *)memalign(B, C)) == nullptr)
|
||||||
# elif defined(HAVE__ALIGNED_MALLOC)
|
# elif defined(HAVE__ALIGNED_MALLOC)
|
||||||
@ -77,7 +85,11 @@ void aligned_free_internal(void *ptr) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
__mingw_aligned_free(ptr);
|
||||||
|
#else
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief 64-byte aligned, zeroed malloc.
|
/** \brief 64-byte aligned, zeroed malloc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user