Skip to content
Snippets Groups Projects
Verified Commit a6e00a4d authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#100] Fix for Windows being special of course

parent 27780b2d
No related branches found
No related tags found
1 merge request!82Resolve "Upscaling Module"
Pipeline #26415 passed
......@@ -2,7 +2,14 @@
#include "vkcv/File.hpp"
#include <stdlib.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include "vkcv/Logger.hpp"
namespace vkcv {
......@@ -15,13 +22,25 @@ namespace vkcv {
}
char name [16] = "vkcv_tmp_XXXXXX";
#ifdef _WIN32
int err = _mktemp_s(name, 16);
if (err != 0) {
vkcv_log(LogLevel::ERROR, "Temporary file path could not be generated");
return "";
}
#else
int fd = mkstemp(name);
if (fd == -1) {
vkcv_log(LogLevel::ERROR, "Temporary file path could not be generated");
return "";
}
close(fd);
#endif
return tmp / name;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment