From 2bd955903676822f6308516bdcb13cb0886fa0ef Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Mon, 11 Mar 2024 22:12:35 +0100 Subject: export working unix --- src/export.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/export.cpp') 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 +#ifndef _WIN32 +#include +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) -- cgit v1.2.3-70-g09d2