Commit 50d52cf5 authored by Lev Walkin's avatar Lev Walkin
Browse files

windows compatibility; suggested by github.com/sapien2

parent 0afe0735
......@@ -13,6 +13,17 @@
#endif
#endif
#ifdef _WIN32
int mkstemp(char *template) {
char *tmpFN = _mktemp(template);
if(tmpFN)
return open(tmpFN, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE);
else
return -1;
}
#undef HAVE_MKSTEMPS
#endif
#ifdef HAVE_MKSTEMPS
#undef mkstemp
#define mkstemp(foo) mkstemps(foo, 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment