git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 12655cb50c27fb6d6c79b856023f6b78af22dc87
parent f47e143e7547cf1a7fdc563a21a35e01a5f957e8
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Mon, 25 Jul 2022 22:21:44 +0300

Fix Windows build

Diffstat:
MSDL/main.c3++-
MWindows/unistd.h2++
MWindows/utf8_compat.c8++++++++
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/SDL/main.c b/SDL/main.c @@ -2,6 +2,7 @@ #include <stdio.h> #include <signal.h> #include <ctype.h> +#include <unistd.h> #include <errno.h> #include <OpenDialog/open_dialog.h> #include <SDL.h> @@ -13,7 +14,7 @@ #include "console.h" #ifndef _WIN32 -#include <unistd.h> +#include <fcntl.h> #else #include <Windows.h> #endif diff --git a/Windows/unistd.h b/Windows/unistd.h @@ -6,3 +6,5 @@ #define read(...) _read(__VA_ARGS__) #define write(...) _write(__VA_ARGS__) #define isatty(...) _isatty(__VA_ARGS__) +#define close(...) _close(__VA_ARGS__) +#define creat(...) _creat(__VA_ARGS__) diff --git a/Windows/utf8_compat.c b/Windows/utf8_compat.c @@ -22,3 +22,11 @@ int access(const char *filename, int mode) return _waccess(w_filename, mode); } +int creat(const char *filename, int mode) +{ + wchar_t w_filename[MAX_PATH] = {0,}; + MultiByteToWideChar(CP_UTF8, 0, filename, -1, w_filename, sizeof(w_filename) / sizeof(w_filename[0])); + + return _wcreat(w_filename, mode); +} +

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.