diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-04-02 21:54:55 +0200 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-23 18:32:57 +0100 |
| commit | 4d0fa88d4b189d12005f36b076173d01a0d7bb87 (patch) | |
| tree | 4fae3689d84c5858630be01d806adb6d142a434c /test/tmpfile.h | |
| parent | a43e4eeb6a8c1b0906f5af0b964a301d2ec0321b (diff) | |
Diffstat (limited to 'test/tmpfile.h')
| -rw-r--r-- | test/tmpfile.h | 5 |
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); |
