]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Add MinGW support
authorlnyan <redacted>
Sun, 9 Oct 2022 14:26:37 +0000 (22:26 +0800)
committerlnyan <redacted>
Sun, 9 Oct 2022 14:26:37 +0000 (22:26 +0800)
ggml.c
whisper.cpp

diff --git a/ggml.c b/ggml.c
index a87e8dbc9f3b726d14b1a44393819a9e1f88bc3f..d2853ebabcb1285a1eed37ce58d3f7e2408ef427 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -1,6 +1,11 @@
 #include "ggml.h"
 
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include <malloc.h> // using malloc.h with MSC/MINGW
+#else
 #include <alloca.h>
+#endif
+
 #include <assert.h>
 #include <time.h>
 #include <math.h>
index 81da46944f7d383560f23b69ddb837d29a4c9247..4137685e0ea08ac6f1707958e578ff2d4e8cb12f 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <algorithm>
 #include <cassert>
+#define _USE_MATH_DEFINES
 #include <cmath>
 #include <cstdio>
 #include <cstring>