--- a/src/decompress.c
+++ b/src/decompress.c
@@ -1,6 +1,15 @@
 #include <string.h>
 #include <unistd.h>
 
+#if defined(__MINGW32__) && defined(__clang__)
+#include <windows.h>
+static inline size_t getpagesize() {
+    SYSTEM_INFO S;
+    GetNativeSystemInfo(&S);
+    return S.dwPageSize;
+}
+#endif
+
 #include "decompress.h"
 
 #ifdef HAVE_LZMA_H
