From 75e5da071c3da5034da29f273c0705f6e5cef2d2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 29 Aug 2023 19:18:22 +0300 Subject: [PATCH] engine: platform: win32: fix calculating RVAs for LLP64 --- engine/platform/win32/lib_win.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/platform/win32/lib_win.h b/engine/platform/win32/lib_win.h index 429dd4f8..1761b5cd 100644 --- a/engine/platform/win32/lib_win.h +++ b/engine/platform/win32/lib_win.h @@ -16,9 +16,10 @@ GNU General Public License for more details. #include "library.h" #include #include +#include STDINT_H -#define CALCULATE_ADDRESS( base, offset ) ( ( DWORD )( base ) + ( DWORD )( offset ) ) +#define CALCULATE_ADDRESS( base, offset ) ((uint8_t *)( base ) + (uintptr_t)( offset )) FARPROC MemoryGetProcAddress( void *module, const char *name ); void MemoryFreeLibrary( void *hInstance ); -void *MemoryLoadLibrary( const char *name ); \ No newline at end of file +void *MemoryLoadLibrary( const char *name );