summaryrefslogtreecommitdiff
path: root/test/tmpfile.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-12-28 21:48:09 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2026-01-02 13:20:17 +0100
commitfe9183b22f09254a756cb47d6897b1475ad811b1 (patch)
tree18fe5c6f16e97bfbf952cdbbcfb12a8f0b410042 /test/tmpfile.h
parente4f612979e9361e006f049ff445e9c78497adbbd (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);