From 680a1df2143199c0655b1fb530f90d6430992c07 Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Sat, 10 Jul 2021 14:47:31 +0200
Subject: [PATCH] [#79] Next try to fix MinGW issues

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 config/lib/vma/vma.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/config/lib/vma/vma.cpp b/config/lib/vma/vma.cpp
index ab440b90..93df5359 100644
--- a/config/lib/vma/vma.cpp
+++ b/config/lib/vma/vma.cpp
@@ -1,16 +1,24 @@
 
-#include <mutex>
-
 #ifndef NDEBUG
 #define _DEBUG
 #endif
 
-#ifndef _WIN32
+#ifdef __MINGW32__
 
-#ifndef _aligned_malloc
-#define _aligned_malloc(alignment, size) aligned_alloc((alignment), (size))
-#endif
+#include <mutex>
+
+class VmaMutex {
+public:
+	void Lock() { m_Mutex.lock(); }
+	void Unlock() { m_Mutex.unlock(); }
+private:
+	std::mutex m_Mutex;
+};
+
+#define VMA_MUTEX VmaMutex
 
+#define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (aligned_alloc((alignment), (size) ))
+#define VMA_SYSTEM_FREE(ptr) free(ptr)
 #endif
 
 #define VMA_IMPLEMENTATION
-- 
GitLab