From ca1dfac948d99724bd4737a45c6f0a9f17c03bfd Mon Sep 17 00:00:00 2001 From: Stephen Hurd <deuce@synchro.net> Date: Tue, 8 Feb 2022 23:14:04 -0500 Subject: [PATCH] Smore more Win32 fixes Sketchiest thing is using _mkgmtime32 instead of _mkgmtime... This is aliased on Vista or above, but apparently we're not targeting that? --- ciolib/CMakeLists.txt | 14 ++++++++++---- xpdev/datewrap.c | 1 + xpdev/datewrap.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ciolib/CMakeLists.txt b/ciolib/CMakeLists.txt index ede224b..6915387 100644 --- a/ciolib/CMakeLists.txt +++ b/ciolib/CMakeLists.txt @@ -53,14 +53,16 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") endif() if(X11_FOUND) - list(APPEND SOURCE x_events.c x_cio.c scale.c) + list(APPEND SOURCE x_events.c x_cio.c) set(NEED_BITMAP TRUE) set(NEED_DLOPEN TRUE) + set(NEED_SCALE TRUE) endif() -if(SDL2_FOUND) +if(SDL2_INCLUDE_DIRS) list(APPEND SOURCE sdl_con.c) list(APPEND SOURCE sdlfuncs.c) + set(NEED_SCALE TRUE) if(WIN32) list(APPEND SOURCE SDL_win32_main.c) endif() @@ -75,6 +77,10 @@ if(NEED_BITMAP) list(APPEND SOURCE bitmap_con.c) endif() +if(NEED_SCALE) + list(APPEND SOURCE scale.c) +endif() + add_library(ciolib OBJECT ${SOURCE}) target_include_directories(ciolib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -84,8 +90,8 @@ else() target_compile_definitions(ciolib PRIVATE NO_X) endif() -if(SDL2_FOUND) - target_include_directories(ciolib PRIVATE ${SDL2_INCLUDE_DIRS}) +if(SDL2_INCLUDE_DIRS) + target_include_directories(ciolib PUBLIC ${SDL2_INCLUDE_DIRS}) set(WITH_SDL TRUE PARENT_SCOPE) endif() diff --git a/xpdev/datewrap.c b/xpdev/datewrap.c index 3c2e916..5f3759e 100644 --- a/xpdev/datewrap.c +++ b/xpdev/datewrap.c @@ -114,6 +114,7 @@ struct tm* localtime32(const time32_t* t32, struct tm* tm) #if defined(_WIN32) #include <windows.h> /* SYSTEMTIME and GetLocalTime() */ + #include <time.h> /* _mkgmtime */ #else #include <sys/time.h> /* stuct timeval, gettimeofday() */ #endif diff --git a/xpdev/datewrap.h b/xpdev/datewrap.h index c57cd94..843de23 100644 --- a/xpdev/datewrap.h +++ b/xpdev/datewrap.h @@ -57,7 +57,7 @@ DLLEXPORT struct tm* localtime32(const time32_t* t, struct tm* tm); /* Microsoft's equivalent of GLIBC/BSD timegm() */ #if defined(_MSC_VER) || defined(__MINGW32__) - #define timegm _mkgmtime + #define timegm _mkgmtime32 #endif /***********************************/ -- GitLab