Compare commits

...

2 Commits

Author SHA1 Message Date
William Bell
a96023ced1 fix for winblows 2025-08-18 15:03:11 +01:00
William Bell
1908d9bbbb fix for winblows 2025-08-18 14:43:49 +01:00

View File

@@ -3,10 +3,6 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#if defined(_WIN32) || defined(_WIN64)
#else
#include "../external/linenoise/linenoise.h"
#endif
#include "./lexer/lexer.h"
#include "./runtime/call/call.h"
#include "./runtime/objects/functions/functions.h"
@@ -22,6 +18,27 @@
#if defined(__linux__)
#include <malloc.h>
#endif
#if defined(_WIN32) || defined(_WIN64)
FILE *fmemopen(void *buf, size_t size, const char *mode) {
if (strchr(mode, 'r') == NULL) {
return NULL;
}
FILE *tmp = tmpfile();
if (!tmp) return NULL;
if (fwrite(buf, 1, size, tmp) != size) {
fclose(tmp);
return NULL;
}
rewind(tmp);
return tmp;
}
#else
#include "../external/linenoise/linenoise.h"
#endif
volatile sig_atomic_t interrupted = 0;