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-04-07 19:27:21 +0200
commit70346bc46cdc69783aee7db9fa6a2197a979c348 (patch)
tree52da2805a88f1f1c481b3e5f3619f8157d08e9f2 /test/tmpfile.h
parentcd6c3ea1c3ca853fc38da4fa5fd62545c31aa92d (diff)
WIP
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..486cf2e 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);