summaryrefslogtreecommitdiff
path: root/test/tmpfile.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-04-02 21:54:55 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2025-12-29 12:22:47 +0100
commit0333f2eca72dfa464a71033363bfd15773718b48 (patch)
tree817051e224f074961931dcc451d13e19f93e7377 /test/tmpfile.h
parentd7f6ce94c5cbdf03e1630c150f2fd34af9f15349 (diff)
WIPmsvc
Diffstat (limited to 'test/tmpfile.h')
-rw-r--r--test/tmpfile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/tmpfile.h b/test/tmpfile.h
index 0f83a20..5887e36 100644
--- a/test/tmpfile.h
+++ b/test/tmpfile.h
@@ -17,7 +17,12 @@ public:
while(!fp)
{
filename = tmp_file_template.string() + std::to_string(counter++);
+ // TODO: Use std::fstream.open() with openmode noreplace when using c++23
+#if defined(_WIN32)
+ fopen_s(&fp, filename.data(), "wx");
+#else
fp = std::fopen(filename.data(), "wx");
+#endif
}
std::fwrite(data.data(), data.size(), 1, fp);
std::fclose(fp);