Skip to content

Commit

Permalink
WIN32 hack did not work
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Nov 17, 2024
1 parent ea90832 commit dfdd577
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
5 changes: 4 additions & 1 deletion src/tools/twbl_probe.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// TODO: windows https://github.com/dlfcn-win32/dlfcn-win32
#ifdef WIN32

#include <twbl/teeworlds/base/detect.h>

#ifdef CONF_FAMILY_WINDOWS

int main() { return 0; }

Expand Down
8 changes: 5 additions & 3 deletions src/twbl/hotreload.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include <cstdio>
#include <cstdlib>

#ifdef WIN32
#include <twbl/teeworlds/base/detect.h>

#ifdef CONF_FAMILY_WINDOWS
// TODO: windows api
#else
#include <dlfcn.h>
Expand Down Expand Up @@ -59,7 +61,7 @@ void *CHotreloader::LoadTick(FTwbl_BotTick *ppfnBotTick)

UnloadTick();

#ifdef WIN32
#ifdef CONF_FAMILY_WINDOWS
return nullptr;
#else
char aTickfunc[512];
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit dfdd577

Please sign in to comment.