]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : fix cross-compile Linux -> Window with mingw (#168)
authorGeorgi Gerganov <redacted>
Wed, 23 Nov 2022 20:27:49 +0000 (22:27 +0200)
committerGeorgi Gerganov <redacted>
Wed, 23 Nov 2022 20:28:41 +0000 (22:28 +0200)
README.md
ggml.c

index 2619a6a879d4e6dbd2b0349aba8350f20cbf6257..5a20073f9f9a2524c9dcb2e2449b5eca221c626a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Supported platforms:
 - [x] [iOS](examples/whisper.objc)
 - [x] Linux
 - [x] [WebAssembly](examples/whisper.wasm)
-- [x] Windows ([MSVC](https://github.com/ggerganov/whisper.cpp/blob/master/.github/workflows/build.yml#L117-L144) and [MinGW](https://github.com/ggerganov/whisper.cpp/issues/5)]
+- [x] Windows ([MSVC](https://github.com/ggerganov/whisper.cpp/blob/master/.github/workflows/build.yml#L117-L144) and [MinGW](https://github.com/ggerganov/whisper.cpp/issues/168)]
 - [x] [Raspberry Pi](https://github.com/ggerganov/whisper.cpp/discussions/166)
 - [x] [Android](https://github.com/ggerganov/whisper.cpp/issues/30)
 
diff --git a/ggml.c b/ggml.c
index 17f324e03176449281857fe4df3989a7271d799d..6f06023a30cf04d48619cabe201e38368a8cba59 100644 (file)
--- a/ggml.c
+++ b/ggml.c
 #include <stdio.h>
 
 #if defined _MSC_VER || defined(__MINGW32__)
+
+#ifndef(__MINGW32__)
 #include <Windows.h>
+#else
+// ref: https://github.com/ggerganov/whisper.cpp/issues/168
+#include <windows.h>
+#include <errno.h>
+#endif
 
 typedef volatile LONG atomic_int;
 typedef atomic_int atomic_bool;