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-06 17:06:18 +0100
commit738ea8dc05aef2d354680068715eb88d96351cf3 (patch)
tree6062368b04c55d2a958f28964d38c403d680cf48 /test/tmpfile.h
parentfa99825fa800f0faf4a6e6b1d639b261c7aa43c9 (diff)
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);