From 23abb5a3b6c5cc01c36282b2ca5b7d1bfaa00f03 Mon Sep 17 00:00:00 2001 From: redcode Date: Sun, 27 Oct 2024 17:09:11 +0100 Subject: [PATCH] =?UTF-8?q?`Z80=5FWITH=5FWINDOWS=5FDLL=5FMAIN`=20=E2=86=92?= =?UTF-8?q?=20`Z80=5FWITH=5FWINDOWS=5FDLL=5FMAIN=5FCRT=5FSTARTUP`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- sources/Z80.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8787e8d..1afca94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,7 +202,7 @@ else() if(${PROJECT_NAME}_NOSTDLIB_FLAGS STREQUAL "Auto") if(MSVC) - target_compile_definitions(${PROJECT_NAME} PRIVATE Z80_WITH_WINDOWS_DLL_MAIN) + target_compile_definitions(${PROJECT_NAME} PRIVATE Z80_WITH_WINDOWS_DLL_MAIN_CRT_STARTUP) target_link_options(${PROJECT_NAME} PRIVATE "/NODEFAULTLIB") elseif(APPLE) if(CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU)$") diff --git a/sources/Z80.c b/sources/Z80.c index d94f979..7187694 100644 --- a/sources/Z80.c +++ b/sources/Z80.c @@ -2932,7 +2932,7 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles) } -#ifdef Z80_WITH_WINDOWS_DLL_MAIN +#ifdef Z80_WITH_WINDOWS_DLL_MAIN_CRT_STARTUP int Z_MICROSOFT_STD_CALL _DllMainCRTStartup(void *hDllHandle, unsigned long dwReason, void *lpReserved) {return 1;} #endif