From c863da08dd1dccaa4b635d91d2e7722cc15c580d Mon Sep 17 00:00:00 2001 From: anth64 Date: Tue, 20 Jan 2026 21:53:33 +0100 Subject: [PATCH] fix(platform): address C89 warnings and Windows pointer casting - Include so Windows does not complain about int types. - Cast GetProcAddress return through intptr_t to satisfy -Wpedantic. - Moved work_path for *nix only macros. --- src/platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform.c b/src/platform.c index 47f8f74..02fe1a9 100644 --- a/src/platform.c +++ b/src/platform.c @@ -1,4 +1,5 @@ #include "stk.h" +#include #include #include #include @@ -341,7 +342,7 @@ void platform_unload_library(void *handle) void *platform_get_symbol(void *handle, const char *symbol) { #ifdef _WIN32 - return (void *)GetProcAddress((HMODULE)handle, symbol); + return (void *)(intptr_t)GetProcAddress((HMODULE)handle, symbol); #else return dlsym(handle, symbol); #endif @@ -649,7 +650,6 @@ stk_module_event_t *platform_directory_watch_check( char (*platform_directory_init_scan(const char *mod_dir, size_t *out_count)) [STK_PATH_MAX] { char (*file_list)[STK_PATH_MAX] = NULL; - char work_path[STK_PATH_MAX_OS]; size_t count = 0, index = 0; #if defined(_WIN32) @@ -706,6 +706,7 @@ char (*platform_directory_init_scan(const char *mod_dir, size_t *out_count)) } while (FindNextFileW(find_handle, &find_data) && index < count); FindClose(find_handle); #else + char work_path[STK_PATH_MAX_OS]; DIR *dir; struct dirent *entry; struct stat file_stat;