Skip to content

Commit

Permalink
test: Drop x modifier in fsbridge::fopen call for mingw builds
Browse files Browse the repository at this point in the history
The MinGW-w64 toolchain links executables to the old msvcrt C Runtime
Library that does not support the `x` modifier for the _wfopen()
function.
  • Loading branch information
hebasto committed Feb 26, 2024
1 parent 11b436a commit d2fe905
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/streams_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
}
{
AutoFile xor_file{raw_file("wbx"), xor_pat};
#ifdef __MINGW64__
// Our usage of mingw-w64 and the msvcrt runtime does not support
// the x modifier for the _wfopen().
const char* mode = "wb";
#else
const char* mode = "wbx";
#endif
AutoFile xor_file{raw_file(mode), xor_pat};
xor_file << test1 << test2;
}
{
Expand Down

0 comments on commit d2fe905

Please sign in to comment.