Skip to content

Commit d2fe905

Browse files
committed
test: Drop x modifier in fsbridge::fopen call for mingw builds
The MinGW-w64 toolchain links executables to the old msvcrt C Runtime Library that does not support the `x` modifier for the _wfopen() function.
1 parent 11b436a commit d2fe905

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/streams_tests.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
2929
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
3030
}
3131
{
32-
AutoFile xor_file{raw_file("wbx"), xor_pat};
32+
#ifdef __MINGW64__
33+
// Our usage of mingw-w64 and the msvcrt runtime does not support
34+
// the x modifier for the _wfopen().
35+
const char* mode = "wb";
36+
#else
37+
const char* mode = "wbx";
38+
#endif
39+
AutoFile xor_file{raw_file(mode), xor_pat};
3340
xor_file << test1 << test2;
3441
}
3542
{

0 commit comments

Comments
 (0)