diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-28 21:48:09 +0100 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2026-02-06 18:26:55 +0100 |
| commit | a7a3ab9ad4fb452d7af83816551bcfcddee0df56 (patch) | |
| tree | e948b357ce8aef1741b253abdd1ddc277f6342af /test/tmpfile.h | |
| parent | 668158a83bc9e5af7bf65fe88d22d1958e33443f (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); |
