Skip to content

Commit 1e2baaf

Browse files
committed
add typedef of WIN32_MEMORY_RANGE_ENTRY and PWIN32_MEMORY_RANGE_ENTRY to make it work under MinGW
1 parent 0c6ddf4 commit 1e2baaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/llama.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,13 @@ struct llama_mmap {
17441744

17451745
if (prefetch > 0) {
17461746
// PrefetchVirtualMemory is only present on Windows 8 and above, so we dynamically load it
1747+
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
1748+
typedef struct _WIN32_MEMORY_RANGE_ENTRY {
1749+
PVOID VirtualAddress;
1750+
SIZE_T NumberOfBytes;
1751+
} WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY;
1752+
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
1753+
17471754
BOOL (WINAPI *pPrefetchVirtualMemory) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG);
17481755
HMODULE hKernel32 = GetModuleHandleW(L"kernel32.dll");
17491756

0 commit comments

Comments
 (0)