Use std::ios::binary mode in embedtool.cpp

Required for it to work properly on Windows.
This commit is contained in:
刘皓 2025-03-03 10:41:01 -05:00
parent 22d2a7db08
commit 7182a57fe1
No known key found for this signature in database
GPG key ID: 7901753DB465B711
2 changed files with 3 additions and 3 deletions

View file

@ -31,12 +31,12 @@ int main(int argc, char **argv) {
const char *output = argv[2];
const char *arrayname = argv[3];
std::ifstream inputf(input);
std::ifstream inputf(input, std::ios::binary);
if (!inputf.is_open()) {
return 2;
}
std::ofstream outputf(output);
std::ofstream outputf(output, std::ios::binary);
if (!outputf.is_open()) {
return 3;
}

View file

@ -112,7 +112,7 @@ global_args += '-DMKXPZ_INIT_GL_LATER'
subdir('src')
embedtool = executable('embedtool', sources: 'embedtool.cpp', native: true, override_options: [])
embedtool = executable('embedtool', sources: 'embedtool.cpp', native: true, override_options: ['buildtype=release', 'b_coverage=false', 'b_lto=false', 'b_ndebug=false', 'b_pgo=off', 'b_sanitize=none'])
subdir('binding')
subdir('shader')