add typedef of WIN32_MEMORY_RANGE_ENTRY and PWIN32_MEMORY_RANGE_ENTRY to make it work under MinGW

This commit is contained in:
LIU Xiao 2024-07-05 17:43:08 +08:00
parent ead607e013
commit 35ee170413

View File

@ -1802,6 +1802,13 @@ struct llama_mmap {
if (prefetch > 0) {
// PrefetchVirtualMemory is only present on Windows 8 and above, so we dynamically load it
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
typedef struct _WIN32_MEMORY_RANGE_ENTRY {
PVOID VirtualAddress;
SIZE_T NumberOfBytes;
} WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY;
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
BOOL (WINAPI *pPrefetchVirtualMemory) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG);
HMODULE hKernel32 = GetModuleHandleW(L"kernel32.dll");