diff --git a/src/llama.cpp b/src/llama.cpp index bc88c8487..6caf74e51 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -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");