Skip to content

Commit 2d3481c

Browse files
authored
Fix msys2 build error and warnings (#1009)
1 parent 74f5899 commit 2d3481c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llama.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "ggml.h"
1010

1111
#include <array>
12+
#include <ctime>
1213
#include <cinttypes>
1314
#include <fstream>
1415
#include <random>

llama_util.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@
4343
} while (0)
4444

4545
#ifdef __GNUC__
46+
#ifdef __MINGW32__
47+
__attribute__((format(gnu_printf, 1, 2)))
48+
#else
4649
__attribute__((format(printf, 1, 2)))
4750
#endif
51+
#endif
4852
static std::string format(const char * fmt, ...) {
4953
va_list ap, ap2;
5054
va_start(ap, fmt);
@@ -57,7 +61,7 @@ static std::string format(const char * fmt, ...) {
5761
va_end(ap2);
5862
va_end(ap);
5963
return std::string(buf.data(), size);
60-
};
64+
}
6165

6266
struct llama_file {
6367
// use FILE * so we don't have to re-open the file to mmap

0 commit comments

Comments
 (0)