Skip to content

Commit 3292da0

Browse files
authored
ui: fix ETag truncation with MSVC compiler (ggml-org#23917)
1 parent e6123e2 commit 3292da0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tools/ui/embed.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <fstream>
1010
#include <string>
1111
#include <vector>
12+
#include <cinttypes>
1213
#include <cstdint>
1314

1415
// Computes FNV-1a hash of the data
@@ -126,10 +127,10 @@ int main(int argc, char ** argv) {
126127
append_bytes_hex(cpp, bytes);
127128
const auto hash = fnv_hash(bytes.data(), bytes.size());
128129

129-
cpp += fmt("};\nstatic const size_t asset_%d_size = %lu;\n",
130-
i, static_cast<unsigned long>(bytes.size()));
131-
cpp += fmt("static const char asset_%d_etag[] = \"\\\"0x%016lx\\\"\";\n\n",
132-
i, static_cast<unsigned long>(hash));
130+
cpp += fmt("};\nstatic const size_t asset_%d_size = %zu;\n",
131+
i, bytes.size());
132+
cpp += fmt("static const char asset_%d_etag[] = \"\\\"0x%016" PRIx64 "\\\"\";\n\n",
133+
i, hash);
133134
}
134135

135136
cpp += "static const llama_ui_asset g_assets[] = {\n";

0 commit comments

Comments
 (0)