]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix msys2 build error and warnings (#1009)
authornanahi <redacted>
Sun, 16 Apr 2023 09:13:42 +0000 (17:13 +0800)
committerGitHub <redacted>
Sun, 16 Apr 2023 09:13:42 +0000 (11:13 +0200)
llama.cpp
llama_util.h

index be8c4cdc124569db716a4b8086716a2462469793..a0d7e5137c8689caf604b4fb7ebe95a84c9dff00 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -9,6 +9,7 @@
 #include "ggml.h"
 
 #include <array>
+#include <ctime>
 #include <cinttypes>
 #include <fstream>
 #include <random>
index 653bf71388bff2da970889eb378d3e3fbb774dd5..d2110ebb4f6422061735f0616b1a16c3bb7434d7 100755 (executable)
     } while (0)
 
 #ifdef __GNUC__
+#ifdef __MINGW32__
+__attribute__((format(gnu_printf, 1, 2)))
+#else
 __attribute__((format(printf, 1, 2)))
 #endif
+#endif
 static std::string format(const char * fmt, ...) {
     va_list ap, ap2;
     va_start(ap, fmt);
@@ -57,7 +61,7 @@ static std::string format(const char * fmt, ...) {
     va_end(ap2);
     va_end(ap);
     return std::string(buf.data(), size);
-};
+}
 
 struct llama_file {
     // use FILE * so we don't have to re-open the file to mmap