From 836a7cbdd731a547b076accafb77562181faa0a6 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sat, 9 Mar 2024 11:59:28 -0500 Subject: [PATCH] Fix --help and improve console launch param --- Makefile | 2 +- src/pc/pc_main.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 21856129..5e0ab752 100644 --- a/Makefile +++ b/Makefile @@ -856,7 +856,7 @@ ifeq ($(TARGET_N64),1) endif ifeq ($(WINDOWS_BUILD),1) - LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static + LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static -mconsole ifeq ($(CROSS),) LDFLAGS += -no-pie endif diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index 625a0cb6..58b25324 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -338,12 +338,10 @@ int main(int argc, char *argv[]) { #if defined(_WIN32) || defined(_WIN64) // Handle Windows console - if (gCLIOpts.Console && AllocConsole()) { - FILE* fDummy; - freopen_s(&fDummy, "CONOUT$", "w", stdout); - freopen_s(&fDummy, "CONOUT$", "w", stderr); - freopen_s(&fDummy, "CONIN$", "r", stdin); + if (!gCLIOpts.Console) { + FreeConsole(); } + #endif // Create the window straight away