From: nanahi Date: Sun, 16 Apr 2023 09:13:42 +0000 (+0800) Subject: Fix msys2 build error and warnings (#1009) X-Git-Tag: gguf-v0.4.0~945 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2d3481c72125cd388258864c7ad8d7d36777bad7;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix msys2 build error and warnings (#1009) --- diff --git a/llama.cpp b/llama.cpp index be8c4cdc..a0d7e513 100644 --- a/llama.cpp +++ b/llama.cpp @@ -9,6 +9,7 @@ #include "ggml.h" #include +#include #include #include #include diff --git a/llama_util.h b/llama_util.h index 653bf713..d2110ebb 100755 --- a/llama_util.h +++ b/llama_util.h @@ -43,8 +43,12 @@ } 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