From dfdd5773a95b634e4d1811db879f028910f01fee Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sun, 17 Nov 2024 19:46:51 +0800 Subject: [PATCH] WIN32 hack did not work --- CMakeLists.txt | 4 ---- src/tools/twbl_probe.cpp | 5 ++++- src/twbl/hotreload.cpp | 8 +++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89e2dea..7aeb45a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,10 +59,6 @@ if(TARGET_OS STREQUAL "windows") add_compile_definitions(${target} PRIVATE _WIN32_WINNT=0x0600) # Minimum OS version (old macro, both must be defined) add_compile_definitions(${target} PRIVATE UNICODE) # Windows headers add_compile_definitions(${target} PRIVATE _UNICODE) # C-runtime - - # twbl specific hack for #ifdef WIN32 checks - # to avoid detect.h on windows systems that dont define WIN32 like mingw - add_compile_definitions(${target} PRIVATE WIN32) endif() set(LINK_FLAGS_PLATFORM "") diff --git a/src/tools/twbl_probe.cpp b/src/tools/twbl_probe.cpp index 888c85d..3333131 100644 --- a/src/tools/twbl_probe.cpp +++ b/src/tools/twbl_probe.cpp @@ -1,5 +1,8 @@ // TODO: windows https://github.com/dlfcn-win32/dlfcn-win32 -#ifdef WIN32 + +#include + +#ifdef CONF_FAMILY_WINDOWS int main() { return 0; } diff --git a/src/twbl/hotreload.cpp b/src/twbl/hotreload.cpp index cd80163..4984a5c 100644 --- a/src/twbl/hotreload.cpp +++ b/src/twbl/hotreload.cpp @@ -1,7 +1,9 @@ #include #include -#ifdef WIN32 +#include + +#ifdef CONF_FAMILY_WINDOWS // TODO: windows api #else #include @@ -59,7 +61,7 @@ void *CHotreloader::LoadTick(FTwbl_BotTick *ppfnBotTick) UnloadTick(); -#ifdef WIN32 +#ifdef CONF_FAMILY_WINDOWS return nullptr; #else char aTickfunc[512]; @@ -106,7 +108,7 @@ void *CHotreloader::LoadTick(FTwbl_BotTick *ppfnBotTick) int CHotreloader::CloseHandle(void *pHandle) { -#ifdef WIN32 +#ifdef CONF_FAMILY_WINDOWS return 0; #else return dlclose(pHandle);