Skip to content
Snippets Groups Projects
Verified Commit 9a2e2ecc authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#93] Corrected types of integers to be included with stdint.h

parent 79584934
No related branches found
No related tags found
1 merge request!80Resolve "MinGW corrections for the hacks"
Pipeline #26386 passed
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef _MSVC_LANG #ifndef _MSVC_LANG
#ifdef __MINGW32__ #ifdef __MINGW32__
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
class VmaMutex { class VmaMutex {
...@@ -32,20 +33,20 @@ T* custom_overestimate_malloc(size_t size) { ...@@ -32,20 +33,20 @@ T* custom_overestimate_malloc(size_t size) {
void* custom_aligned_malloc(size_t alignment, size_t size) { void* custom_aligned_malloc(size_t alignment, size_t size) {
if (alignment > 4) { if (alignment > 4) {
return custom_overestimate_malloc<u_int64_t>(size); return custom_overestimate_malloc<uint64_t>(size);
} else } else
if (alignment > 2) { if (alignment > 2) {
return custom_overestimate_malloc<u_int32_t>(size); return custom_overestimate_malloc<uint32_t>(size);
} else } else
if (alignment > 1) { if (alignment > 1) {
return custom_overestimate_malloc<u_int16_t>(size); return custom_overestimate_malloc<uint16_t>(size);
} else { } else {
return custom_overestimate_malloc<u_int8_t>(size); return custom_overestimate_malloc<uint8_t>(size);
} }
} }
void custom_free(void *ptr) { void custom_free(void *ptr) {
delete[] reinterpret_cast<u_int8_t*>(ptr); delete[] reinterpret_cast<uint8_t*>(ptr);
} }
#define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (custom_aligned_malloc(alignment, size)) #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (custom_aligned_malloc(alignment, size))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment