diff --git a/System/EasyFile/Missing.hs b/System/EasyFile/Missing.hs
--- a/System/EasyFile/Missing.hs
+++ b/System/EasyFile/Missing.hs
@@ -164,6 +164,8 @@
 #endif
 
 -- | Getting the size of the file.
+--
+--   Since: 0.2.0.
 getFileSize :: FilePath -> IO Word64
 #if defined(mingw32_HOST_OS) || defined(__MINGW32__)
 getFileSize file = withFileForInfo file $ \fh ->
@@ -173,12 +175,18 @@
 #endif
 
 -- | Setting the size of the file.
+--
+--   Since: 0.2.4.
 setFileSize :: FilePath -> Word64 -> IO ()
-#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
+#if (defined(mingw32_HOST_OS) || defined(__MINGW32__))
+# if MIN_VERSION_Win32(2, 6, 2)
 setFileSize file siz = do
     hdl <- createFile file gENERIC_WRITE fILE_SHARE_NONE Nothing oPEN_EXISTING fILE_ATTRIBUTE_NORMAL Nothing
     _ <- setFilePointerEx hdl (fromIntegral siz) fILE_CURRENT
     setEndOfFile hdl
+# else
+setFileSize _ _ = error "GHC 8.10.5 or earlier does not provide setFilePointerEx"
+# endif
 #else
 setFileSize file siz = P.setFileSize file $ fromIntegral siz
 #endif
diff --git a/easy-file.cabal b/easy-file.cabal
--- a/easy-file.cabal
+++ b/easy-file.cabal
@@ -1,6 +1,6 @@
 Cabal-Version:          >= 1.10
 Name:                   easy-file
-Version:                0.2.4
+Version:                0.2.5
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
