Skip to content

Commit

Permalink
[Fix] Fix u_char for Windows build (#1848)
Browse files Browse the repository at this point in the history
Prior to this PR, `u_char` was used while it is not a standard
type in C++, which causes Windows build failure.

This PR fixes it by using `unsigned char`.
  • Loading branch information
MasterJH5574 authored Feb 27, 2024
1 parent 1cbd67b commit 607dc5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/serve/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ inline void TokenToLogProbJSON(const Tokenizer& tokenizer, const TokenProbPair&
(*os) << "\"bytes\": [";
int token_len = token.size();
for (int pos = 0; pos < token_len; ++pos) {
(*os) << static_cast<int>(static_cast<u_char>(token[pos]));
(*os) << static_cast<int>(static_cast<unsigned char>(token[pos]));
if (pos != token_len - 1) {
(*os) << ", ";
}
Expand Down

0 comments on commit 607dc5a

Please sign in to comment.