diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-11 22:12:35 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-11 22:12:35 +0100 |
| commit | 2bd955903676822f6308516bdcb13cb0886fa0ef (patch) | |
| tree | 666b3e9a547cfb7032c03c380534f2564823a913 /src/export.cpp | |
| parent | 089f1d902c1f1c89b5b39fd3cf093313be3ebc7f (diff) | |
export working unix
Diffstat (limited to 'src/export.cpp')
| -rw-r--r-- | src/export.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/export.cpp b/src/export.cpp index 23e7bf6..4fc390d 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -3,6 +3,19 @@ #include "config.h" #include <stdio.h> +#ifndef _WIN32 +#include <errno.h> +static int fopen_s(FILE **f, const char *name, const char *mode) { + int ret = 0; + assert(f); + *f = fopen(name, mode); + /* Can't be sure about 1-to-1 mapping of errno and MS' errno_t */ + if (!*f) + ret = errno; + return ret; +} +#endif + static bool _str_has_extension(const utf8_int8_t *str, const utf8_int8_t *suffix) { if (!str || !suffix) |
