long -> intptr_t for casts. WIP: mingw cross-compilation for Windows (see #162)

This commit is contained in:
John McCardle 2026-01-08 10:41:24 -05:00
commit 1f002e820c
15 changed files with 188 additions and 102 deletions

View file

@ -1,12 +1,12 @@
#ifndef __PLATFORM
#define __PLATFORM
#define __PLATFORM_SET_PYTHON_SEARCH_PATHS 0
#include <Windows.h>
#include <windows.h>
std::wstring executable_path()
{
wchar_t buffer[MAX_PATH];
GetModuleFileName(NULL, buffer, MAX_PATH);
GetModuleFileNameW(NULL, buffer, MAX_PATH); // Use explicit Unicode version
std::wstring exec_path = buffer;
size_t path_index = exec_path.find_last_of(L"\\/");
return exec_path.substr(0, path_index);
@ -15,7 +15,7 @@ std::wstring executable_path()
std::wstring executable_filename()
{
wchar_t buffer[MAX_PATH];
GetModuleFileName(NULL, buffer, MAX_PATH);
GetModuleFileNameW(NULL, buffer, MAX_PATH); // Use explicit Unicode version
std::wstring exec_path = buffer;
return exec_path;
}