* common: fix warning
* Update common/common.cpp
Co-authored-by: slaren <redacted>
---------
Co-authored-by: slaren <redacted>
#include "llama.h"
#include <algorithm>
-#include <cassert>
#include <cinttypes>
#include <cmath>
#include <codecvt>
}
// Set the output file
- std::unique_ptr<FILE, decltype(&fclose)> outfile(fopen(path_temporary.c_str(), "wb"), fclose);
+
+ struct FILE_deleter {
+ void operator()(FILE * f) const {
+ fclose(f);
+ }
+ };
+
+ std::unique_ptr<FILE, FILE_deleter> outfile(fopen(path_temporary.c_str(), "wb"));
if (!outfile) {
fprintf(stderr, "%s: error opening local file for writing: %s\n", __func__, path.c_str());
return false;