Skip to content

Commit abd894a

Browse files
common: fix warning (ggml-org#8036)
* common: fix warning * Update common/common.cpp Co-authored-by: slaren <slarengh@gmail.com> --------- Co-authored-by: slaren <slarengh@gmail.com>
1 parent de391e4 commit abd894a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

common/common.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "llama.h"
77

88
#include <algorithm>
9-
#include <cassert>
109
#include <cinttypes>
1110
#include <cmath>
1211
#include <codecvt>
@@ -2657,7 +2656,14 @@ static bool llama_download_file(const std::string & url, const std::string & pat
26572656
}
26582657

26592658
// Set the output file
2660-
std::unique_ptr<FILE, decltype(&fclose)> outfile(fopen(path_temporary.c_str(), "wb"), fclose);
2659+
2660+
struct FILE_deleter {
2661+
void operator()(FILE * f) const {
2662+
fclose(f);
2663+
}
2664+
};
2665+
2666+
std::unique_ptr<FILE, FILE_deleter> outfile(fopen(path_temporary.c_str(), "wb"));
26612667
if (!outfile) {
26622668
fprintf(stderr, "%s: error opening local file for writing: %s\n", __func__, path.c_str());
26632669
return false;

0 commit comments

Comments
 (0)