From 9f56f5fee030779a771c48dea615eea68662da9f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Tue, 12 Dec 2023 00:26:13 +0200 Subject: [PATCH] Switch the Windows build to x86-64 --- Makefile | 6 +++--- OpenDialog/windows.c | 2 +- SDL/main.c | 4 ++++ Windows/stdio.h | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e28de16..51d31ec 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ endif ifeq ($(PLATFORM),windows32) _ := $(shell chcp 65001) EXESUFFIX:=.exe -NATIVE_CC = clang -IWindows -Wno-deprecated-declarations --target=i386-pc-windows +NATIVE_CC = clang -IWindows -Wno-deprecated-declarations --target=x86_64-pc-windows SDL_AUDIO_DRIVERS ?= xaudio2 xaudio2_7 sdl else EXESUFFIX:= @@ -220,8 +220,8 @@ GL_LDFLAGS := $(shell $(PKG_CONFIG) --libs gl || echo -lGL) endif ifeq ($(PLATFORM),windows32) -CFLAGS += -IWindows -Drandom=rand --target=i386-pc-windows -LDFLAGS += -lmsvcrt -lcomdlg32 -luser32 -lshell32 -lole32 -lSDL2main -Wl,/MANIFESTFILE:NUL --target=i386-pc-windows +CFLAGS += -IWindows -Drandom=rand --target=x86_64-pc-windows +LDFLAGS += -lmsvcrt -lcomdlg32 -luser32 -lshell32 -lole32 -lSDL2main -Wl,/MANIFESTFILE:NUL --target=x86_64-pc-windows SDL_LDFLAGS := -lSDL2 GL_LDFLAGS := -lopengl32 else diff --git a/OpenDialog/windows.c b/OpenDialog/windows.c index 5a0af0e..19ca442 100644 --- a/OpenDialog/windows.c +++ b/OpenDialog/windows.c @@ -56,7 +56,7 @@ char *do_open_folder_dialog(void) if (SHGetPathFromIDListW(list, filename)) { ret = wc_to_utf8_alloc(filename); } - CoTaskMemFree(list); + CoTaskMemFree((void *)list); } if (SUCCEEDED(hrOleInit)) OleUninitialize(); diff --git a/SDL/main.c b/SDL/main.c index 5b2164d..08bc17d 100644 --- a/SDL/main.c +++ b/SDL/main.c @@ -555,10 +555,12 @@ static void debugger_interrupt(int ignore) GB_debugger_break(&gb); } +#ifndef _WIN32 static void debugger_reset(int ignore) { pending_command = GB_SDL_RESET_COMMAND; } +#endif static void gb_audio_callback(GB_gameboy_t *gb, GB_sample_t *sample) { @@ -1024,7 +1026,9 @@ int main(int argc, char **argv) } signal(SIGINT, debugger_interrupt); +#ifndef _WIN32 signal(SIGUSR1, debugger_reset); +#endif SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO); if ((console_supported = CON_start(completer))) { diff --git a/Windows/stdio.h b/Windows/stdio.h index aeb7ec8..b8be393 100755 --- a/Windows/stdio.h +++ b/Windows/stdio.h @@ -11,6 +11,10 @@ #include #include +#if _WIN64 +#define fseek(...) _fseeki64(__VA_ARGS__) +#endif + int access(const char *filename, int mode); #define R_OK 4 #define W_OK 2