Skip to content

Commit

Permalink
Fix msys2 build error and warnings (ggerganov#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
na-na-hi authored Apr 16, 2023
1 parent 74f5899 commit 2d3481c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ggml.h"

#include <array>
#include <ctime>
#include <cinttypes>
#include <fstream>
#include <random>
Expand Down
6 changes: 5 additions & 1 deletion llama_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 2d3481c

Please sign in to comment.