diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # libarchive
 
+# 3.0.2.2
+
+  * Builds on Windows (changes due to Julian Ospald)
+
 # 3.0.2.1
 
   * Upgrade bundled `libarchive` to 3.5.1
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -26,3 +26,45 @@
 ## Performance
 
 `libarchive` is faster than `tar` or `tar-conduit` when unpacking archives.
+
+```
+benchmarking roundtrip/libarchive
+time                 248.5 μs   (247.0 μs .. 250.0 μs)
+                     0.999 R²   (0.999 R² .. 1.000 R²)
+mean                 249.7 μs   (248.2 μs .. 251.6 μs)
+std dev              5.637 μs   (4.385 μs .. 8.012 μs)
+variance introduced by outliers: 15% (moderately inflated)
+
+benchmarking roundtrip/tar
+time                 322.7 μs   (321.9 μs .. 323.7 μs)
+                     1.000 R²   (1.000 R² .. 1.000 R²)
+mean                 324.0 μs   (322.9 μs .. 325.1 μs)
+std dev              3.673 μs   (2.837 μs .. 5.119 μs)
+
+benchmarking unpack/libarchive (via bytestring)
+time                 1.146 ms   (1.133 ms .. 1.157 ms)
+                     0.999 R²   (0.997 R² .. 0.999 R²)
+mean                 1.110 ms   (1.096 ms .. 1.156 ms)
+std dev              72.18 μs   (30.15 μs .. 141.7 μs)
+variance introduced by outliers: 51% (severely inflated)
+
+benchmarking unpack/libarchive (C API)
+time                 1.009 ms   (994.1 μs .. 1.022 ms)
+                     0.999 R²   (0.997 R² .. 1.000 R²)
+mean                 1.002 ms   (999.0 μs .. 1.006 ms)
+std dev              11.81 μs   (8.603 μs .. 18.76 μs)
+
+benchmarking unpack/tar
+time                 3.600 ms   (3.271 ms .. 4.001 ms)
+                     0.939 R²   (0.898 R² .. 0.977 R²)
+mean                 4.119 ms   (3.814 ms .. 5.295 ms)
+std dev              1.631 ms   (541.5 μs .. 3.272 ms)
+variance introduced by outliers: 98% (severely inflated)
+
+benchmarking unpack/tarConduit
+time                 4.946 ms   (4.072 ms .. 6.308 ms)
+                     0.835 R²   (0.779 R² .. 0.988 R²)
+mean                 4.164 ms   (3.967 ms .. 4.574 ms)
+std dev              848.0 μs   (442.7 μs .. 1.620 ms)
+variance introduced by outliers: 88% (severely inflated)
+```
diff --git a/c/autoconf-windows/config.h b/c/autoconf-windows/config.h
new file mode 100644
--- /dev/null
+++ b/c/autoconf-windows/config.h
@@ -0,0 +1,1435 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Darwin ACL support */
+/* #undef ARCHIVE_ACL_DARWIN */
+
+/* FreeBSD ACL support */
+/* #undef ARCHIVE_ACL_FREEBSD */
+
+/* FreeBSD NFSv4 ACL support */
+/* #undef ARCHIVE_ACL_FREEBSD_NFS4 */
+
+/* Linux POSIX.1e ACL support via libacl */
+/* #undef ARCHIVE_ACL_LIBACL */
+
+/* Linux NFSv4 ACL support via librichacl */
+/* #undef ARCHIVE_ACL_LIBRICHACL */
+
+/* Solaris ACL support */
+/* #undef ARCHIVE_ACL_SUNOS */
+
+/* Solaris NFSv4 ACL support */
+/* #undef ARCHIVE_ACL_SUNOS_NFS4 */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_LIBC */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_LIBMD supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_LIBMD */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_LIBSYSTEM supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_LIBSYSTEM */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_MBEDTLS */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_NETTLE */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_MD5_OPENSSL */
+
+/* MD5 via ARCHIVE_CRYPTO_MD5_WIN supported. */
+#define ARCHIVE_CRYPTO_MD5_WIN 1
+
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_RMD160_LIBC */
+
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_LIBMD supported. */
+/* #undef ARCHIVE_CRYPTO_RMD160_LIBMD */
+
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_RMD160_MBEDTLS */
+
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_RMD160_NETTLE */
+
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_RMD160_OPENSSL */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_LIBC */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBMD supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_LIBMD */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBSYSTEM supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_LIBSYSTEM */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_MBEDTLS */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_NETTLE */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_SHA1_OPENSSL */
+
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_WIN supported. */
+#define ARCHIVE_CRYPTO_SHA1_WIN 1
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_LIBC */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC2 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_LIBC2 */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC3 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_LIBC3 */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBMD supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_LIBMD */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBSYSTEM supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_LIBSYSTEM */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_MBEDTLS */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_NETTLE */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_SHA256_OPENSSL */
+
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_WIN supported. */
+#define ARCHIVE_CRYPTO_SHA256_WIN 1
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_LIBC */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC2 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_LIBC2 */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC3 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_LIBC3 */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBSYSTEM supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_LIBSYSTEM */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_MBEDTLS */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_NETTLE */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_SHA384_OPENSSL */
+
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_WIN supported. */
+#define ARCHIVE_CRYPTO_SHA384_WIN 1
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_LIBC */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC2 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_LIBC2 */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC3 supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_LIBC3 */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBMD supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_LIBMD */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBSYSTEM supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_LIBSYSTEM */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_MBEDTLS supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_MBEDTLS */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_NETTLE supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_NETTLE */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_OPENSSL supported. */
+/* #undef ARCHIVE_CRYPTO_SHA512_OPENSSL */
+
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_WIN supported. */
+#define ARCHIVE_CRYPTO_SHA512_WIN 1
+
+/* AIX xattr support */
+/* #undef ARCHIVE_XATTR_AIX */
+
+/* Darwin xattr support */
+/* #undef ARCHIVE_XATTR_DARWIN */
+
+/* FreeBSD xattr support */
+/* #undef ARCHIVE_XATTR_FREEBSD */
+
+/* Linux xattr support */
+/* #undef ARCHIVE_XATTR_LINUX */
+
+/* Version number of bsdcat */
+#define BSDCAT_VERSION_STRING "3.5.1"
+
+/* Version number of bsdcpio */
+#define BSDCPIO_VERSION_STRING "3.5.1"
+
+/* Version number of bsdtar */
+#define BSDTAR_VERSION_STRING "3.5.1"
+
+/* Define to 1 if the system has the type `ace_t'. */
+/* #undef HAVE_ACE_T */
+
+/* Define to 1 if you have the `acl' function. */
+/* #undef HAVE_ACL */
+
+/* Define to 1 if the system has the type `aclent_t'. */
+/* #undef HAVE_ACLENT_T */
+
+/* Define to 1 if you have the `acl_add_flag_np' function. */
+/* #undef HAVE_ACL_ADD_FLAG_NP */
+
+/* Define to 1 if you have the `acl_add_perm' function. */
+/* #undef HAVE_ACL_ADD_PERM */
+
+/* Define to 1 if you have the `acl_clear_flags_np' function. */
+/* #undef HAVE_ACL_CLEAR_FLAGS_NP */
+
+/* Define to 1 if you have the `acl_clear_perms' function. */
+/* #undef HAVE_ACL_CLEAR_PERMS */
+
+/* Define to 1 if you have the `acl_create_entry' function. */
+/* #undef HAVE_ACL_CREATE_ENTRY */
+
+/* Define to 1 if you have the `acl_delete_def_file' function. */
+/* #undef HAVE_ACL_DELETE_DEF_FILE */
+
+/* Define to 1 if the system has the type `acl_entry_t'. */
+/* #undef HAVE_ACL_ENTRY_T */
+
+/* Define to 1 if you have the `acl_free' function. */
+/* #undef HAVE_ACL_FREE */
+
+/* Define to 1 if you have the `acl_get_brand_np' function. */
+/* #undef HAVE_ACL_GET_BRAND_NP */
+
+/* Define to 1 if you have the `acl_get_entry' function. */
+/* #undef HAVE_ACL_GET_ENTRY */
+
+/* Define to 1 if you have the `acl_get_entry_type_np' function. */
+/* #undef HAVE_ACL_GET_ENTRY_TYPE_NP */
+
+/* Define to 1 if you have the `acl_get_fd' function. */
+/* #undef HAVE_ACL_GET_FD */
+
+/* Define to 1 if you have the `acl_get_fd_np' function. */
+/* #undef HAVE_ACL_GET_FD_NP */
+
+/* Define to 1 if you have the `acl_get_file' function. */
+/* #undef HAVE_ACL_GET_FILE */
+
+/* Define to 1 if you have the `acl_get_flagset_np' function. */
+/* #undef HAVE_ACL_GET_FLAGSET_NP */
+
+/* Define to 1 if you have the `acl_get_flag_np' function. */
+/* #undef HAVE_ACL_GET_FLAG_NP */
+
+/* Define to 1 if you have the `acl_get_link_np' function. */
+/* #undef HAVE_ACL_GET_LINK_NP */
+
+/* Define to 1 if you have the `acl_get_perm' function. */
+/* #undef HAVE_ACL_GET_PERM */
+
+/* Define to 1 if you have the `acl_get_permset' function. */
+/* #undef HAVE_ACL_GET_PERMSET */
+
+/* Define to 1 if you have the `acl_get_perm_np' function. */
+/* #undef HAVE_ACL_GET_PERM_NP */
+
+/* Define to 1 if you have the `acl_get_qualifier' function. */
+/* #undef HAVE_ACL_GET_QUALIFIER */
+
+/* Define to 1 if you have the `acl_get_tag_type' function. */
+/* #undef HAVE_ACL_GET_TAG_TYPE */
+
+/* Define to 1 if you have the `acl_init' function. */
+/* #undef HAVE_ACL_INIT */
+
+/* Define to 1 if you have the `acl_is_trivial_np' function. */
+/* #undef HAVE_ACL_IS_TRIVIAL_NP */
+
+/* Define to 1 if you have the <acl/libacl.h> header file. */
+/* #undef HAVE_ACL_LIBACL_H */
+
+/* Define to 1 if the system has the type `acl_permset_t'. */
+/* #undef HAVE_ACL_PERMSET_T */
+
+/* Define to 1 if you have the `acl_set_entry_type_np' function. */
+/* #undef HAVE_ACL_SET_ENTRY_TYPE_NP */
+
+/* Define to 1 if you have the `acl_set_fd' function. */
+/* #undef HAVE_ACL_SET_FD */
+
+/* Define to 1 if you have the `acl_set_fd_np' function. */
+/* #undef HAVE_ACL_SET_FD_NP */
+
+/* Define to 1 if you have the `acl_set_file' function. */
+/* #undef HAVE_ACL_SET_FILE */
+
+/* Define to 1 if you have the `acl_set_link_np' function. */
+/* #undef HAVE_ACL_SET_LINK_NP */
+
+/* Define to 1 if you have the `acl_set_qualifier' function. */
+/* #undef HAVE_ACL_SET_QUALIFIER */
+
+/* Define to 1 if you have the `acl_set_tag_type' function. */
+/* #undef HAVE_ACL_SET_TAG_TYPE */
+
+/* Define to 1 if the system has the type `acl_t'. */
+/* #undef HAVE_ACL_T */
+
+/* Define to 1 if the system has the type `acl_tag_t'. */
+/* #undef HAVE_ACL_TAG_T */
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+/* #undef HAVE_ARC4RANDOM_BUF */
+
+/* Define to 1 if you have the <attr/xattr.h> header file. */
+/* #undef HAVE_ATTR_XATTR_H */
+
+/* Define to 1 if you have the <bcrypt.h> header file. */
+/* #undef HAVE_BCRYPT_H */
+
+/* Define to 1 if you have the <blake2.h> header file. */
+/* #undef HAVE_BLAKE2_H */
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
+/* Define to 1 if you have the `chflags' function. */
+/* #undef HAVE_CHFLAGS */
+
+/* Define to 1 if you have the `chown' function. */
+/* #undef HAVE_CHOWN */
+
+/* Define to 1 if you have the `chroot' function. */
+/* #undef HAVE_CHROOT */
+
+/* Define to 1 if you have the <copyfile.h> header file. */
+/* #undef HAVE_COPYFILE_H */
+
+/* Define to 1 if you have the `ctime_r' function. */
+/* #undef HAVE_CTIME_R */
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the `cygwin_conv_path' function. */
+/* #undef HAVE_CYGWIN_CONV_PATH */
+
+/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_ACE_GETACL */
+
+/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_ACE_GETACLCNT */
+
+/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_ACE_SETACL */
+
+/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
+   you don't. */
+/* #undef HAVE_DECL_ACL_SYNCHRONIZE */
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
+   you don't. */
+/* #undef HAVE_DECL_ACL_TYPE_EXTENDED */
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_ACL_TYPE_NFS4 */
+
+/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_ACL_USER */
+
+/* Define to 1 if you have the declaration of `EXTATTR_NAMESPACE_USER', and to
+   0 if you don't. */
+/* #undef HAVE_DECL_EXTATTR_NAMESPACE_USER */
+
+/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
+   */
+/* #undef HAVE_DECL_GETACL */
+
+/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
+   don't. */
+/* #undef HAVE_DECL_GETACLCNT */
+
+/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_INT32_MAX 1
+
+/* Define to 1 if you have the declaration of `INT32_MIN', and to 0 if you
+   don't. */
+#define HAVE_DECL_INT32_MIN 1
+
+/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_INT64_MAX 1
+
+/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
+   don't. */
+#define HAVE_DECL_INT64_MIN 1
+
+/* Define to 1 if you have the declaration of `INTMAX_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_INTMAX_MAX 1
+
+/* Define to 1 if you have the declaration of `INTMAX_MIN', and to 0 if you
+   don't. */
+#define HAVE_DECL_INTMAX_MIN 1
+
+/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
+   */
+/* #undef HAVE_DECL_SETACL */
+
+/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_SIZE_MAX 1
+
+/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_SSIZE_MAX 1
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+   don't. */
+#define HAVE_DECL_STRERROR_R 0
+
+/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_UINT32_MAX 1
+
+/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_UINT64_MAX 1
+
+/* Define to 1 if you have the declaration of `UINTMAX_MAX', and to 0 if you
+   don't. */
+#define HAVE_DECL_UINTMAX_MAX 1
+
+/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
+   you don't. */
+/* #undef HAVE_DECL_XATTR_NOFOLLOW */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+   */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have a dirfd function or macro */
+#define HAVE_DIRFD 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* #undef HAVE_DOPRNT */
+
+/* Define to 1 if nl_langinfo supports D_MD_ORDER */
+/* #undef HAVE_D_MD_ORDER */
+
+/* A possible errno value for invalid file format errors */
+/* #undef HAVE_EFTYPE */
+
+/* A possible errno value for invalid file format errors */
+#define HAVE_EILSEQ 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <expat.h> header file. */
+/* #undef HAVE_EXPAT_H */
+
+/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
+/* #undef HAVE_EXT2FS_EXT2_FS_H */
+
+/* Define to 1 if you have the `extattr_get_fd' function. */
+/* #undef HAVE_EXTATTR_GET_FD */
+
+/* Define to 1 if you have the `extattr_get_file' function. */
+/* #undef HAVE_EXTATTR_GET_FILE */
+
+/* Define to 1 if you have the `extattr_get_link' function. */
+/* #undef HAVE_EXTATTR_GET_LINK */
+
+/* Define to 1 if you have the `extattr_list_fd' function. */
+/* #undef HAVE_EXTATTR_LIST_FD */
+
+/* Define to 1 if you have the `extattr_list_file' function. */
+/* #undef HAVE_EXTATTR_LIST_FILE */
+
+/* Define to 1 if you have the `extattr_list_link' function. */
+/* #undef HAVE_EXTATTR_LIST_LINK */
+
+/* Define to 1 if you have the `extattr_set_fd' function. */
+/* #undef HAVE_EXTATTR_SET_FD */
+
+/* Define to 1 if you have the `extattr_set_link' function. */
+/* #undef HAVE_EXTATTR_SET_LINK */
+
+/* Define to 1 if you have the `facl' function. */
+/* #undef HAVE_FACL */
+
+/* Define to 1 if you have the `fchdir' function. */
+/* #undef HAVE_FCHDIR */
+
+/* Define to 1 if you have the `fchflags' function. */
+/* #undef HAVE_FCHFLAGS */
+
+/* Define to 1 if you have the `fchmod' function. */
+/* #undef HAVE_FCHMOD */
+
+/* Define to 1 if you have the `fchown' function. */
+/* #undef HAVE_FCHOWN */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fdopendir' function. */
+/* #undef HAVE_FDOPENDIR */
+
+/* Define to 1 if you have the `fgetea' function. */
+/* #undef HAVE_FGETEA */
+
+/* Define to 1 if you have the `fgetxattr' function. */
+/* #undef HAVE_FGETXATTR */
+
+/* Define to 1 if you have the `flistea' function. */
+/* #undef HAVE_FLISTEA */
+
+/* Define to 1 if you have the `flistxattr' function. */
+/* #undef HAVE_FLISTXATTR */
+
+/* Define to 1 if you have the `fork' function. */
+/* #undef HAVE_FORK */
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `fsetea' function. */
+/* #undef HAVE_FSETEA */
+
+/* Define to 1 if you have the `fsetxattr' function. */
+/* #undef HAVE_FSETXATTR */
+
+/* Define to 1 if you have the `fstat' function. */
+#define HAVE_FSTAT 1
+
+/* Define to 1 if you have the `fstatat' function. */
+/* #undef HAVE_FSTATAT */
+
+/* Define to 1 if you have the `fstatfs' function. */
+/* #undef HAVE_FSTATFS */
+
+/* Define to 1 if you have the `fstatvfs' function. */
+/* #undef HAVE_FSTATVFS */
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `futimens' function. */
+/* #undef HAVE_FUTIMENS */
+
+/* Define to 1 if you have the `futimes' function. */
+/* #undef HAVE_FUTIMES */
+
+/* Define to 1 if you have the `futimesat' function. */
+/* #undef HAVE_FUTIMESAT */
+
+/* Define to 1 if you have the `getea' function. */
+/* #undef HAVE_GETEA */
+
+/* Define to 1 if you have the `geteuid' function. */
+/* #undef HAVE_GETEUID */
+
+/* Define to 1 if you have the `getgrgid_r' function. */
+/* #undef HAVE_GETGRGID_R */
+
+/* Define to 1 if you have the `getgrnam_r' function. */
+/* #undef HAVE_GETGRNAM_R */
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getpwnam_r' function. */
+/* #undef HAVE_GETPWNAM_R */
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+/* #undef HAVE_GETPWUID_R */
+
+/* Define to 1 if you have the `getvfsbyname' function. */
+/* #undef HAVE_GETVFSBYNAME */
+
+/* Define to 1 if you have the `getxattr' function. */
+/* #undef HAVE_GETXATTR */
+
+/* Define to 1 if you have the `gmtime_r' function. */
+/* #undef HAVE_GMTIME_R */
+
+/* Define to 1 if you have the <grp.h> header file. */
+/* #undef HAVE_GRP_H */
+
+/* Define if you have the iconv() function and it works. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <iconv.h> header file. */
+/* #undef HAVE_ICONV_H */
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+#define HAVE_IO_H 1
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define to 1 if you have the `lchflags' function. */
+/* #undef HAVE_LCHFLAGS */
+
+/* Define to 1 if you have the `lchmod' function. */
+/* #undef HAVE_LCHMOD */
+
+/* Define to 1 if you have the `lchown' function. */
+/* #undef HAVE_LCHOWN */
+
+/* Define to 1 if you have the `lgetea' function. */
+/* #undef HAVE_LGETEA */
+
+/* Define to 1 if you have the `lgetxattr' function. */
+/* #undef HAVE_LGETXATTR */
+
+/* Define to 1 if you have the `acl' library (-lacl). */
+/* #undef HAVE_LIBACL */
+
+/* Define to 1 if you have the `b2' library (-lb2). */
+/* #undef HAVE_LIBB2 */
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
+/* Define to 1 if you have the `charset' library (-lcharset). */
+/* #undef HAVE_LIBCHARSET */
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+/* #undef HAVE_LIBCRYPTO */
+
+/* Define to 1 if you have the `eay32' library (-leay32). */
+/* #undef HAVE_LIBEAY32 */
+
+/* Define to 1 if you have the `eay64' library (-leay64). */
+/* #undef HAVE_LIBEAY64 */
+
+/* Define to 1 if you have the `expat' library (-lexpat). */
+/* #undef HAVE_LIBEXPAT */
+
+/* Define to 1 if you have the `lz4' library (-llz4). */
+/* #undef HAVE_LIBLZ4 */
+
+/* Define to 1 if you have the `lzma' library (-llzma). */
+/* #undef HAVE_LIBLZMA */
+
+/* Define to 1 if you have the `lzo2' library (-llzo2). */
+/* #undef HAVE_LIBLZO2 */
+
+/* Define to 1 if you have the `mbedcrypto' library (-lmbedcrypto). */
+/* #undef HAVE_LIBMBEDCRYPTO */
+
+/* Define to 1 if you have the `md' library (-lmd). */
+/* #undef HAVE_LIBMD */
+
+/* Define to 1 if you have the `nettle' library (-lnettle). */
+/* #undef HAVE_LIBNETTLE */
+
+/* Define to 1 if you have the `pcre' library (-lpcre). */
+/* #undef HAVE_LIBPCRE */
+
+/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */
+/* #undef HAVE_LIBPCREPOSIX */
+
+/* Define to 1 if you have the `regex' library (-lregex). */
+/* #undef HAVE_LIBREGEX */
+
+/* Define to 1 if you have the `richacl' library (-lrichacl). */
+/* #undef HAVE_LIBRICHACL */
+
+/* Define to 1 if you have the `xml2' library (-lxml2). */
+/* #undef HAVE_LIBXML2 */
+
+/* Define to 1 if you have the <libxml/xmlreader.h> header file. */
+/* #undef HAVE_LIBXML_XMLREADER_H */
+
+/* Define to 1 if you have the <libxml/xmlwriter.h> header file. */
+/* #undef HAVE_LIBXML_XMLWRITER_H */
+
+/* Define to 1 if you have the `z' library (-lz). */
+/* #undef HAVE_LIBZ */
+
+/* Define to 1 if you have the `zstd' library (-lzstd). */
+/* #undef HAVE_LIBZSTD */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `link' function. */
+/* #undef HAVE_LINK */
+
+/* Define to 1 if you have the <linux/fiemap.h> header file. */
+/* #undef HAVE_LINUX_FIEMAP_H */
+
+/* Define to 1 if you have the <linux/fs.h> header file. */
+/* #undef HAVE_LINUX_FS_H */
+
+/* Define to 1 if you have the <linux/magic.h> header file. */
+/* #undef HAVE_LINUX_MAGIC_H */
+
+/* Define to 1 if you have the <linux/types.h> header file. */
+/* #undef HAVE_LINUX_TYPES_H */
+
+/* Define to 1 if you have the `listea' function. */
+/* #undef HAVE_LISTEA */
+
+/* Define to 1 if you have the `listxattr' function. */
+/* #undef HAVE_LISTXATTR */
+
+/* Define to 1 if you have the `llistea' function. */
+/* #undef HAVE_LLISTEA */
+
+/* Define to 1 if you have the `llistxattr' function. */
+/* #undef HAVE_LLISTXATTR */
+
+/* Define to 1 if you have the <localcharset.h> header file. */
+/* #undef HAVE_LOCALCHARSET_H */
+
+/* Define to 1 if you have the `locale_charset' function. */
+/* #undef HAVE_LOCALE_CHARSET */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+/* #undef HAVE_LOCALTIME_R */
+
+/* Define to 1 if the system has the type `long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `lsetea' function. */
+/* #undef HAVE_LSETEA */
+
+/* Define to 1 if you have the `lsetxattr' function. */
+/* #undef HAVE_LSETXATTR */
+
+/* Define to 1 if you have the `lstat' function. */
+/* #undef HAVE_LSTAT */
+
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+   zero-length file name argument. */
+#define HAVE_LSTAT_EMPTY_STRING_BUG 1
+
+/* Define to 1 if you have the `lutimes' function. */
+/* #undef HAVE_LUTIMES */
+
+/* Define to 1 if you have the <lz4hc.h> header file. */
+/* #undef HAVE_LZ4HC_H */
+
+/* Define to 1 if you have the <lz4.h> header file. */
+/* #undef HAVE_LZ4_H */
+
+/* Define to 1 if you have the <lzma.h> header file. */
+/* #undef HAVE_LZMA_H */
+
+/* Define to 1 if you have the `lzma_stream_encoder_mt' function. */
+/* #undef HAVE_LZMA_STREAM_ENCODER_MT */
+
+/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
+/* #undef HAVE_LZO_LZO1X_H */
+
+/* Define to 1 if you have the <lzo/lzoconf.h> header file. */
+/* #undef HAVE_LZO_LZOCONF_H */
+
+/* Define to 1 if you have the <mbedtls/aes.h> header file. */
+/* #undef HAVE_MBEDTLS_AES_H */
+
+/* Define to 1 if you have the <mbedtls/md.h> header file. */
+/* #undef HAVE_MBEDTLS_MD_H */
+
+/* Define to 1 if you have the <mbedtls/pkcs5.h> header file. */
+/* #undef HAVE_MBEDTLS_PKCS5_H */
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#define HAVE_MBRTOWC 1
+
+/* Define to 1 if you have the `mbr_gid_to_uuid' function. */
+/* #undef HAVE_MBR_GID_TO_UUID */
+
+/* Define to 1 if you have the `mbr_uid_to_uuid' function. */
+/* #undef HAVE_MBR_UID_TO_UUID */
+
+/* Define to 1 if you have the `mbr_uuid_to_id' function. */
+/* #undef HAVE_MBR_UUID_TO_ID */
+
+/* Define to 1 if you have the <md5.h> header file. */
+/* #undef HAVE_MD5_H */
+
+/* Define to 1 if you have the <membership.h> header file. */
+/* #undef HAVE_MEMBERSHIP_H */
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* Define to 1 if you have the `mkfifo' function. */
+/* #undef HAVE_MKFIFO */
+
+/* Define to 1 if you have the `mknod' function. */
+/* #undef HAVE_MKNOD */
+
+/* Define to 1 if you have the `mkstemp' function. */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <nettle/aes.h> header file. */
+/* #undef HAVE_NETTLE_AES_H */
+
+/* Define to 1 if you have the <nettle/hmac.h> header file. */
+/* #undef HAVE_NETTLE_HMAC_H */
+
+/* Define to 1 if you have the <nettle/md5.h> header file. */
+/* #undef HAVE_NETTLE_MD5_H */
+
+/* Define to 1 if you have the <nettle/pbkdf2.h> header file. */
+/* #undef HAVE_NETTLE_PBKDF2_H */
+
+/* Define to 1 if you have the <nettle/ripemd160.h> header file. */
+/* #undef HAVE_NETTLE_RIPEMD160_H */
+
+/* Define to 1 if you have the <nettle/sha.h> header file. */
+/* #undef HAVE_NETTLE_SHA_H */
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+/* #undef HAVE_NL_LANGINFO */
+
+/* Define to 1 if you have the `openat' function. */
+/* #undef HAVE_OPENAT */
+
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+/* #undef HAVE_OPENSSL_EVP_H */
+
+/* Define to 1 if you have the <paths.h> header file. */
+/* #undef HAVE_PATHS_H */
+
+/* Define to 1 if you have the <pcreposix.h> header file. */
+/* #undef HAVE_PCREPOSIX_H */
+
+/* Define to 1 if you have the `pipe' function. */
+/* #undef HAVE_PIPE */
+
+/* Define to 1 if you have the `PKCS5_PBKDF2_HMAC_SHA1' function. */
+/* #undef HAVE_PKCS5_PBKDF2_HMAC_SHA1 */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef HAVE_POLL_H */
+
+/* Define to 1 if you have the `posix_spawnp' function. */
+/* #undef HAVE_POSIX_SPAWNP */
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#define HAVE_PTHREAD_H 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+/* #undef HAVE_PWD_H */
+
+/* Define to 1 if you have a POSIX compatible readdir_r */
+#define HAVE_READDIR_R 1
+
+/* Define to 1 if you have the `readlink' function. */
+/* #undef HAVE_READLINK */
+
+/* Define to 1 if you have the `readlinkat' function. */
+/* #undef HAVE_READLINKAT */
+
+/* Define to 1 if you have the `readpassphrase' function. */
+/* #undef HAVE_READPASSPHRASE */
+
+/* Define to 1 if you have the <readpassphrase.h> header file. */
+/* #undef HAVE_READPASSPHRASE_H */
+
+/* Define to 1 if you have the <regex.h> header file. */
+/* #undef HAVE_REGEX_H */
+
+/* Define to 1 if you have the `richacl_alloc' function. */
+/* #undef HAVE_RICHACL_ALLOC */
+
+/* Define to 1 if you have the `richacl_equiv_mode' function. */
+/* #undef HAVE_RICHACL_EQUIV_MODE */
+
+/* Define to 1 if you have the `richacl_free' function. */
+/* #undef HAVE_RICHACL_FREE */
+
+/* Define to 1 if you have the `richacl_get_fd' function. */
+/* #undef HAVE_RICHACL_GET_FD */
+
+/* Define to 1 if you have the `richacl_get_file' function. */
+/* #undef HAVE_RICHACL_GET_FILE */
+
+/* Define to 1 if you have the `richacl_set_fd' function. */
+/* #undef HAVE_RICHACL_SET_FD */
+
+/* Define to 1 if you have the `richacl_set_file' function. */
+/* #undef HAVE_RICHACL_SET_FILE */
+
+/* Define to 1 if you have the <ripemd.h> header file. */
+/* #undef HAVE_RIPEMD_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef HAVE_SETENV */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setxattr' function. */
+/* #undef HAVE_SETXATTR */
+
+/* Define to 1 if you have the <sha256.h> header file. */
+/* #undef HAVE_SHA256_H */
+
+/* Define to 1 if you have the <sha512.h> header file. */
+/* #undef HAVE_SHA512_H */
+
+/* Define to 1 if you have the <sha.h> header file. */
+/* #undef HAVE_SHA_H */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <spawn.h> header file. */
+/* #undef HAVE_SPAWN_H */
+
+/* Define to 1 if you have the `statfs' function. */
+/* #undef HAVE_STATFS */
+
+/* Define to 1 if you have the `statvfs' function. */
+/* #undef HAVE_STATVFS */
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+   zero-length file name argument. */
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+/* #undef HAVE_STRERROR_R */
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strncpy_s' function. */
+#define HAVE_STRNCPY_S 1
+
+/* Define to 1 if you have the `strnlen' function. */
+#define HAVE_STRNLEN 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if the system has the type `struct richace'. */
+/* #undef HAVE_STRUCT_RICHACE */
+
+/* Define to 1 if the system has the type `struct richacl'. */
+/* #undef HAVE_STRUCT_RICHACL */
+
+/* Define to 1 if `f_namemax' is a member of `struct statfs'. */
+/* #undef HAVE_STRUCT_STATFS_F_NAMEMAX */
+
+/* Define to 1 if `f_iosize' is a member of `struct statvfs'. */
+/* #undef HAVE_STRUCT_STATVFS_F_IOSIZE */
+
+/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC */
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_BLKSIZE */
+
+/* Define to 1 if `st_flags' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
+
+/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC */
+
+/* Define to 1 if `st_mtime_n' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIME_N */
+
+/* Define to 1 if `st_mtime_usec' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIME_USEC */
+
+/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC */
+
+/* Define to 1 if `st_umtime' is a member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_UMTIME */
+
+/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
+/* #undef HAVE_STRUCT_TM_TM_GMTOFF */
+
+/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */
+/* #undef HAVE_STRUCT_TM___TM_GMTOFF */
+
+/* Define to 1 if the system has the type `struct vfsconf'. */
+/* #undef HAVE_STRUCT_VFSCONF */
+
+/* Define to 1 if the system has the type `struct xvfsconf'. */
+/* #undef HAVE_STRUCT_XVFSCONF */
+
+/* Define to 1 if you have the `symlink' function. */
+/* #undef HAVE_SYMLINK */
+
+/* Define to 1 if you have the <sys/acl.h> header file. */
+/* #undef HAVE_SYS_ACL_H */
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#define HAVE_SYS_CDEFS_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ea.h> header file. */
+/* #undef HAVE_SYS_EA_H */
+
+/* Define to 1 if you have the <sys/extattr.h> header file. */
+/* #undef HAVE_SYS_EXTATTR_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+/* #undef HAVE_SYS_MKDEV_H */
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+/* #undef HAVE_SYS_MOUNT_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+/* #undef HAVE_SYS_POLL_H */
+
+/* Define to 1 if you have the <sys/richacl.h> header file. */
+/* #undef HAVE_SYS_RICHACL_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+/* #undef HAVE_SYS_STATFS_H */
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+/* #undef HAVE_SYS_STATVFS_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+/* #undef HAVE_SYS_SYSMACROS_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#define HAVE_SYS_UTIME_H 1
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+/* #undef HAVE_SYS_UTSNAME_H */
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+/* #undef HAVE_SYS_VFS_H */
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+/* #undef HAVE_SYS_XATTR_H */
+
+/* Define to 1 if you have the `timegm' function. */
+/* #undef HAVE_TIMEGM */
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the `tzset' function. */
+#define HAVE_TZSET 1
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#define HAVE_UINTMAX_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unlinkat' function. */
+/* #undef HAVE_UNLINKAT */
+
+/* Define to 1 if you have the `unsetenv' function. */
+/* #undef HAVE_UNSETENV */
+
+/* Define to 1 if the system has the type `unsigned long long'. */
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimensat' function. */
+/* #undef HAVE_UTIMENSAT */
+
+/* Define to 1 if you have the `utimes' function. */
+/* #undef HAVE_UTIMES */
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vfork' function. */
+/* #undef HAVE_VFORK */
+
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#define HAVE_WCHAR_T 1
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#define HAVE_WCRTOMB 1
+
+/* Define to 1 if you have the `wcscmp' function. */
+#define HAVE_WCSCMP 1
+
+/* Define to 1 if you have the `wcscpy' function. */
+#define HAVE_WCSCPY 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define to 1 if you have the `wctomb' function. */
+#define HAVE_WCTOMB 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#define HAVE_WCTYPE_H 1
+
+/* Define to 1 if you have the <wincrypt.h> header file. */
+#define HAVE_WINCRYPT_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+#define HAVE_WINDOWS_H 1
+
+/* Define to 1 if you have the <winioctl.h> header file. */
+#define HAVE_WINIOCTL_H 1
+
+/* Define to 1 if you have the `wmemcmp' function. */
+#define HAVE_WMEMCMP 1
+
+/* Define to 1 if you have the `wmemcpy' function. */
+#define HAVE_WMEMCPY 1
+
+/* Define to 1 if you have the `wmemmove' function. */
+#define HAVE_WMEMMOVE 1
+
+/* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
+/* #undef HAVE_WORKING_EXT2_IOC_GETFLAGS */
+
+/* Define to 1 if you have a working FS_IOC_GETFLAGS */
+/* #undef HAVE_WORKING_FS_IOC_GETFLAGS */
+
+/* Define to 1 if you have the <zlib.h> header file. */
+/* #undef HAVE_ZLIB_H */
+
+/* Define to 1 if you have the <zstd.h> header file. */
+/* #undef HAVE_ZSTD_H */
+
+/* Define to 1 if you have the `_ctime64_s' function. */
+#define HAVE__CTIME64_S 1
+
+/* Define to 1 if you have the `_fseeki64' function. */
+#define HAVE__FSEEKI64 1
+
+/* Define to 1 if you have the `_get_timezone' function. */
+/* #undef HAVE__GET_TIMEZONE */
+
+/* Define to 1 if you have the `_gmtime64_s' function. */
+#define HAVE__GMTIME64_S 1
+
+/* Define to 1 if you have the `_localtime64_s' function. */
+#define HAVE__LOCALTIME64_S 1
+
+/* Define to 1 if you have the `_mkgmtime64' function. */
+#define HAVE__MKGMTIME64 1
+
+/* Define as const if the declaration of iconv() needs const. */
+/* #undef ICONV_CONST */
+
+/* Version number of libarchive as a single integer */
+#define LIBARCHIVE_VERSION_NUMBER "3005001"
+
+/* Version number of libarchive */
+#define LIBARCHIVE_VERSION_STRING "3.5.1"
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+   slash. */
+/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+   */
+/* #undef MAJOR_IN_MKDEV */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+   <sysmacros.h>. */
+/* #undef MAJOR_IN_SYSMACROS */
+
+/* Define to '0x05020000' for Windows Server 2003 APIs. */
+#define NTDDI_VERSION 0x05020000
+
+/* Name of package */
+#define PACKAGE "libarchive"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "libarchive-discuss@googlegroups.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libarchive"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libarchive 3.5.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libarchive"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "3.5.1"
+
+/* Define to 1 if PCRE_STATIC needs to be defined. */
+/* #undef PCRE_STATIC */
+
+/* The size of `wchar_t', as computed by sizeof. */
+#define SIZEOF_WCHAR_T 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r returns char *. */
+/* #undef STRERROR_R_CHAR_P */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Version number of package */
+#define VERSION "3.5.1"
+
+/* Define to '0x0502' for Windows Server 2003 APIs. */
+#define WINVER 0x0502
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#define _FILE_OFFSET_BITS 64
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Define to '0x0502' for Windows Server 2003 APIs. */
+#define _WIN32_WINNT 0x0502
+
+/* Internal macro for sanity checks */
+#define __LIBARCHIVE_CONFIG_H_INCLUDED 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to match typeof st_gid field of struct stat if <sys/types.h> doesn't
+   define. */
+#define gid_t short
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#define id_t unsigned long
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int16_t */
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+   not define. */
+/* #undef intmax_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef mode_t */
+
+/* Define to `long long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to match typeof st_uid field of struct stat if <sys/types.h> doesn't
+   define. */
+#define uid_t short
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+   do not define. */
+/* #undef uintmax_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef uintptr_t */
diff --git a/libarchive.cabal b/libarchive.cabal
--- a/libarchive.cabal
+++ b/libarchive.cabal
@@ -1,12 +1,12 @@
 cabal-version:   3.0
 name:            libarchive
-version:         3.0.2.1
+version:         3.0.2.2
 license:         BSD-3-Clause
 license-file:    LICENSE
 copyright:       Copyright: (c) 2018-2020 Vanessa McHale
 maintainer:      vamchale@gmail.com
 author:          Vanessa McHale
-tested-with:     ghc ==7.10.3 ghc ==8.0.2 ghc == 8.2.2 ghc ==8.4.4 ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.3
+tested-with:     ghc ==7.10.3 ghc ==8.0.2 ghc == 8.2.2 ghc ==8.4.4 ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.4 ghc ==9.0.1
 bug-reports:     https://github.com/vmchale/libarchive/issues
 synopsis:        Haskell interface to libarchive
 description:
@@ -19,11 +19,12 @@
     CHANGELOG.md
 
 extra-source-files:
-  c/autoconf-darwin/config.h
-  c/autoconf-linux/config.h
-  c/autoconf-freebsd/config.h
-  c/*.c
-  c/*.h
+  ./c/autoconf-darwin/config.h
+  ./c/autoconf-linux/config.h
+  ./c/autoconf-freebsd/config.h
+  ./c/autoconf-windows/config.h
+  ./c/*.c
+  ./c/*.h
   test/data/aarch64-linux-dist.tar
 
 source-repository head
@@ -83,8 +84,12 @@
         unix-compat >=0.1.2.1,
         deepseq >=1.4.0.0
 
+    if os(windows)
+        cc-options: -U__GCC_ASM_FLAG_OUTPUTS__
+
     if !flag(cross)
         build-tool-depends: c2hs:c2hs >=0.26.1
+                          , cpphs:cpphs
 
     if !impl(ghc >=8.0)
         build-depends:
@@ -108,135 +113,135 @@
     if !flag(system-libarchive)
         -- version 3.5.0
         c-sources:
-          c/archive_acl.c
-          c/archive_blake2sp_ref.c
-          c/archive_blake2s_ref.c
-          c/archive_check_magic.c
-          c/archive_cmdline.c
-          c/archive_cryptor.c
-          c/archive_digest.c
-          c/archive_disk_acl_darwin.c
-          c/archive_disk_acl_freebsd.c
-          c/archive_disk_acl_linux.c
-          c/archive_disk_acl_sunos.c
-          c/archive_entry.c
-          c/archive_entry_copy_bhfi.c
-          c/archive_entry_copy_stat.c
-          c/archive_entry_link_resolver.c
-          c/archive_entry_sparse.c
-          c/archive_entry_stat.c
-          c/archive_entry_strmode.c
-          c/archive_entry_xattr.c
-          c/archive_getdate.c
-          c/archive_hmac.c
-          c/archive_match.c
-          c/archive_options.c
-          c/archive_pack_dev.c
-          c/archive_pathmatch.c
-          c/archive_ppmd7.c
-          c/archive_ppmd8.c
-          c/archive_random.c
-          c/archive_rb.c
-          c/archive_read_add_passphrase.c
-          c/archive_read_append_filter.c
-          c/archive_read.c
-          c/archive_read_data_into_fd.c
-          c/archive_read_disk_entry_from_file.c
-          c/archive_read_disk_posix.c
-          c/archive_read_disk_set_standard_lookup.c
-          c/archive_read_disk_windows.c
-          c/archive_read_extract2.c
-          c/archive_read_extract.c
-          c/archive_read_open_fd.c
-          c/archive_read_open_file.c
-          c/archive_read_open_filename.c
-          c/archive_read_open_memory.c
-          c/archive_read_set_format.c
-          c/archive_read_set_options.c
-          c/archive_read_support_filter_all.c
-          c/archive_read_support_filter_by_code.c
-          c/archive_read_support_filter_bzip2.c
-          c/archive_read_support_filter_compress.c
-          c/archive_read_support_filter_grzip.c
-          c/archive_read_support_filter_gzip.c
-          c/archive_read_support_filter_lrzip.c
-          c/archive_read_support_filter_lz4.c
-          c/archive_read_support_filter_lzop.c
-          c/archive_read_support_filter_none.c
-          c/archive_read_support_filter_program.c
-          c/archive_read_support_filter_rpm.c
-          c/archive_read_support_filter_uu.c
-          c/archive_read_support_filter_xz.c
-          c/archive_read_support_filter_zstd.c
-          c/archive_read_support_format_7zip.c
-          c/archive_read_support_format_all.c
-          c/archive_read_support_format_ar.c
-          c/archive_read_support_format_by_code.c
-          c/archive_read_support_format_cab.c
-          c/archive_read_support_format_cpio.c
-          c/archive_read_support_format_empty.c
-          c/archive_read_support_format_iso9660.c
-          c/archive_read_support_format_lha.c
-          c/archive_read_support_format_mtree.c
-          c/archive_read_support_format_rar5.c
-          c/archive_read_support_format_rar.c
-          c/archive_read_support_format_raw.c
-          c/archive_read_support_format_tar.c
-          c/archive_read_support_format_warc.c
-          c/archive_read_support_format_xar.c
-          c/archive_read_support_format_zip.c
-          c/archive_string.c
-          c/archive_string_sprintf.c
-          c/archive_util.c
-          c/archive_version_details.c
-          c/archive_virtual.c
-          c/archive_windows.c
-          c/archive_write_add_filter_b64encode.c
-          c/archive_write_add_filter_by_name.c
-          c/archive_write_add_filter_bzip2.c
-          c/archive_write_add_filter.c
-          c/archive_write_add_filter_compress.c
-          c/archive_write_add_filter_grzip.c
-          c/archive_write_add_filter_gzip.c
-          c/archive_write_add_filter_lrzip.c
-          c/archive_write_add_filter_lz4.c
-          c/archive_write_add_filter_lzop.c
-          c/archive_write_add_filter_none.c
-          c/archive_write_add_filter_program.c
-          c/archive_write_add_filter_uuencode.c
-          c/archive_write_add_filter_xz.c
-          c/archive_write_add_filter_zstd.c
-          c/archive_write.c
-          c/archive_write_disk_posix.c
-          c/archive_write_disk_set_standard_lookup.c
-          c/archive_write_disk_windows.c
-          c/archive_write_open_fd.c
-          c/archive_write_open_file.c
-          c/archive_write_open_filename.c
-          c/archive_write_open_memory.c
-          c/archive_write_set_format_7zip.c
-          c/archive_write_set_format_ar.c
-          c/archive_write_set_format_by_name.c
-          c/archive_write_set_format.c
-          c/archive_write_set_format_cpio.c
-          c/archive_write_set_format_cpio_newc.c
-          c/archive_write_set_format_filter_by_ext.c
-          c/archive_write_set_format_gnutar.c
-          c/archive_write_set_format_iso9660.c
-          c/archive_write_set_format_mtree.c
-          c/archive_write_set_format_pax.c
-          c/archive_write_set_format_raw.c
-          c/archive_write_set_format_shar.c
-          c/archive_write_set_format_ustar.c
-          c/archive_write_set_format_v7tar.c
-          c/archive_write_set_format_warc.c
-          c/archive_write_set_format_xar.c
-          c/archive_write_set_format_zip.c
-          c/archive_write_set_options.c
-          c/archive_write_set_passphrase.c
-          c/filter_fork_posix.c
-          c/filter_fork_windows.c
-          c/xxhash.c
+          ./c/archive_acl.c
+          ./c/archive_blake2sp_ref.c
+          ./c/archive_blake2s_ref.c
+          ./c/archive_check_magic.c
+          ./c/archive_cmdline.c
+          ./c/archive_cryptor.c
+          ./c/archive_digest.c
+          ./c/archive_disk_acl_darwin.c
+          ./c/archive_disk_acl_freebsd.c
+          ./c/archive_disk_acl_linux.c
+          ./c/archive_disk_acl_sunos.c
+          ./c/archive_entry.c
+          ./c/archive_entry_copy_bhfi.c
+          ./c/archive_entry_copy_stat.c
+          ./c/archive_entry_link_resolver.c
+          ./c/archive_entry_sparse.c
+          ./c/archive_entry_stat.c
+          ./c/archive_entry_strmode.c
+          ./c/archive_entry_xattr.c
+          ./c/archive_getdate.c
+          ./c/archive_hmac.c
+          ./c/archive_match.c
+          ./c/archive_options.c
+          ./c/archive_pack_dev.c
+          ./c/archive_pathmatch.c
+          ./c/archive_ppmd7.c
+          ./c/archive_ppmd8.c
+          ./c/archive_random.c
+          ./c/archive_rb.c
+          ./c/archive_read_add_passphrase.c
+          ./c/archive_read_append_filter.c
+          ./c/archive_read.c
+          ./c/archive_read_data_into_fd.c
+          ./c/archive_read_disk_entry_from_file.c
+          ./c/archive_read_disk_posix.c
+          ./c/archive_read_disk_set_standard_lookup.c
+          ./c/archive_read_disk_windows.c
+          ./c/archive_read_extract2.c
+          ./c/archive_read_extract.c
+          ./c/archive_read_open_fd.c
+          ./c/archive_read_open_file.c
+          ./c/archive_read_open_filename.c
+          ./c/archive_read_open_memory.c
+          ./c/archive_read_set_format.c
+          ./c/archive_read_set_options.c
+          ./c/archive_read_support_filter_all.c
+          ./c/archive_read_support_filter_by_code.c
+          ./c/archive_read_support_filter_bzip2.c
+          ./c/archive_read_support_filter_compress.c
+          ./c/archive_read_support_filter_grzip.c
+          ./c/archive_read_support_filter_gzip.c
+          ./c/archive_read_support_filter_lrzip.c
+          ./c/archive_read_support_filter_lz4.c
+          ./c/archive_read_support_filter_lzop.c
+          ./c/archive_read_support_filter_none.c
+          ./c/archive_read_support_filter_program.c
+          ./c/archive_read_support_filter_rpm.c
+          ./c/archive_read_support_filter_uu.c
+          ./c/archive_read_support_filter_xz.c
+          ./c/archive_read_support_filter_zstd.c
+          ./c/archive_read_support_format_7zip.c
+          ./c/archive_read_support_format_all.c
+          ./c/archive_read_support_format_ar.c
+          ./c/archive_read_support_format_by_code.c
+          ./c/archive_read_support_format_cab.c
+          ./c/archive_read_support_format_cpio.c
+          ./c/archive_read_support_format_empty.c
+          ./c/archive_read_support_format_iso9660.c
+          ./c/archive_read_support_format_lha.c
+          ./c/archive_read_support_format_mtree.c
+          ./c/archive_read_support_format_rar5.c
+          ./c/archive_read_support_format_rar.c
+          ./c/archive_read_support_format_raw.c
+          ./c/archive_read_support_format_tar.c
+          ./c/archive_read_support_format_warc.c
+          ./c/archive_read_support_format_xar.c
+          ./c/archive_read_support_format_zip.c
+          ./c/archive_string.c
+          ./c/archive_string_sprintf.c
+          ./c/archive_util.c
+          ./c/archive_version_details.c
+          ./c/archive_virtual.c
+          ./c/archive_windows.c
+          ./c/archive_write_add_filter_b64encode.c
+          ./c/archive_write_add_filter_by_name.c
+          ./c/archive_write_add_filter_bzip2.c
+          ./c/archive_write_add_filter.c
+          ./c/archive_write_add_filter_compress.c
+          ./c/archive_write_add_filter_grzip.c
+          ./c/archive_write_add_filter_gzip.c
+          ./c/archive_write_add_filter_lrzip.c
+          ./c/archive_write_add_filter_lz4.c
+          ./c/archive_write_add_filter_lzop.c
+          ./c/archive_write_add_filter_none.c
+          ./c/archive_write_add_filter_program.c
+          ./c/archive_write_add_filter_uuencode.c
+          ./c/archive_write_add_filter_xz.c
+          ./c/archive_write_add_filter_zstd.c
+          ./c/archive_write.c
+          ./c/archive_write_disk_posix.c
+          ./c/archive_write_disk_set_standard_lookup.c
+          ./c/archive_write_disk_windows.c
+          ./c/archive_write_open_fd.c
+          ./c/archive_write_open_file.c
+          ./c/archive_write_open_filename.c
+          ./c/archive_write_open_memory.c
+          ./c/archive_write_set_format_7zip.c
+          ./c/archive_write_set_format_ar.c
+          ./c/archive_write_set_format_by_name.c
+          ./c/archive_write_set_format.c
+          ./c/archive_write_set_format_cpio.c
+          ./c/archive_write_set_format_cpio_newc.c
+          ./c/archive_write_set_format_filter_by_ext.c
+          ./c/archive_write_set_format_gnutar.c
+          ./c/archive_write_set_format_iso9660.c
+          ./c/archive_write_set_format_mtree.c
+          ./c/archive_write_set_format_pax.c
+          ./c/archive_write_set_format_raw.c
+          ./c/archive_write_set_format_shar.c
+          ./c/archive_write_set_format_ustar.c
+          ./c/archive_write_set_format_v7tar.c
+          ./c/archive_write_set_format_warc.c
+          ./c/archive_write_set_format_xar.c
+          ./c/archive_write_set_format_zip.c
+          ./c/archive_write_set_options.c
+          ./c/archive_write_set_passphrase.c
+          ./c/filter_fork_posix.c
+          ./c/filter_fork_windows.c
+          ./c/xxhash.c
 
         if os(darwin)
           include-dirs: c/autoconf-darwin
@@ -244,6 +249,8 @@
           include-dirs: c/autoconf-linux
         elif os(freebsd)
           include-dirs: c/autoconf-freebsd
+        elif os(windows)
+          include-dirs: c/autoconf-windows
         else
           build-depends: unbuildable<0
           buildable: False
@@ -271,6 +278,7 @@
         base -any,
         libarchive -any,
         hspec -any,
+        hspec-core -any,
         bytestring -any,
         directory >=1.2.5.0,
         filepath -any,
diff --git a/mem/Mem.hs b/mem/Mem.hs
--- a/mem/Mem.hs
+++ b/mem/Mem.hs
@@ -20,8 +20,7 @@
     (readArchiveFile "test/data/llvm-9.0.0.src.tar")
 
 readArcBS :: IO ()
-readArcBS = forceList =<< fmap (either throw id)
-    (readArchiveBSL <$> BSL.readFile "test/data/llvm-9.0.0.src.tar")
+readArcBS = (forceList . either throw id) . readArchiveBSL =<< BSL.readFile "test/data/llvm-9.0.0.src.tar"
 
 readWriteArc :: IO ()
 readWriteArc = forceList . BSL.toChunks =<< throwArchiveM
diff --git a/src/Codec/Archive/Foreign/ArchiveEntry.chs b/src/Codec/Archive/Foreign/ArchiveEntry.chs
--- a/src/Codec/Archive/Foreign/ArchiveEntry.chs
+++ b/src/Codec/Archive/Foreign/ArchiveEntry.chs
@@ -241,7 +241,7 @@
 {#default in `CWString' [wchar_t*] castPtr#}
 {#default out `CWString' [wchar_t*] castPtr#}
 
-ft :: CMode -> Maybe FileType
+ft :: Permissions -> Maybe FileType
 ft 0 = Nothing
 ft i = Just $ toEnum (fromIntegral i)
 
@@ -275,14 +275,22 @@
 {# fun archive_entry_hardlink_w as ^ { `ArchiveEntryPtr' } -> `CWString' #}
 {# fun archive_entry_ino as ^ { `ArchiveEntryPtr' } -> `LaInt64' #}
 {# fun archive_entry_ino64 as ^ { `ArchiveEntryPtr' } -> `LaInt64' #}
+#ifdef mingw32_HOST_OS
+{# fun archive_entry_mode as ^ { `ArchiveEntryPtr' } -> `CUShort' #}
+#else
 {# fun archive_entry_mode as ^ { `ArchiveEntryPtr' } -> `CMode' #}
+#endif
 {# fun archive_entry_mtime as ^ { `ArchiveEntryPtr' } -> `CTime' #}
 {# fun archive_entry_mtime_nsec as ^ { `ArchiveEntryPtr' } -> `CLong' #}
 {# fun archive_entry_nlink as ^ { `ArchiveEntryPtr' } -> `CUInt' #}
 {# fun archive_entry_pathname as ^ { `ArchiveEntryPtr' } -> `CString' #}
 {# fun archive_entry_pathname_utf8 as ^ { `ArchiveEntryPtr' } -> `CString' #}
 {# fun archive_entry_pathname_w as ^ { `ArchiveEntryPtr' } -> `CWString' #}
+#ifdef mingw32_HOST_OS
+{# fun archive_entry_perm as ^ { `ArchiveEntryPtr' } -> `CUShort' #}
+#else
 {# fun archive_entry_perm as ^ { `ArchiveEntryPtr' } -> `CMode' #}
+#endif
 {# fun archive_entry_rdev as ^ { `ArchiveEntryPtr' } -> `CDev' #}
 {# fun archive_entry_rdevmajor as ^ { `ArchiveEntryPtr' } -> `CDev' #}
 {# fun archive_entry_rdevminor as ^ { `ArchiveEntryPtr' } -> `CDev' #}
@@ -328,7 +336,11 @@
 {# fun archive_entry_set_link_utf8 as ^ { `ArchiveEntryPtr', `CString' } -> `()' #}
 {# fun archive_entry_copy_link as ^ { `ArchiveEntryPtr', `CString' } -> `()' #}
 {# fun archive_entry_copy_link_w as ^ { `ArchiveEntryPtr', `CWString' } -> `()' #}
+#ifdef mingw32_HOST_OS
+{# fun archive_entry_set_mode as ^ { `ArchiveEntryPtr', `CUShort' } -> `()' #}
+#else
 {# fun archive_entry_set_mode as ^ { `ArchiveEntryPtr', `CMode' } -> `()' #}
+#endif
 {# fun archive_entry_set_mtime as ^ { `ArchiveEntryPtr', `CTime', `CLong' } -> `()' #}
 {# fun archive_entry_unset_mtime as ^ { `ArchiveEntryPtr' } -> `()' #}
 {# fun archive_entry_set_nlink as ^ { `ArchiveEntryPtr', `CUInt' } -> `()' #}
@@ -336,7 +348,11 @@
 {# fun archive_entry_set_pathname_utf8 as ^ { `ArchiveEntryPtr', `CString' } -> `()' #}
 {# fun archive_entry_copy_pathname as ^ { `ArchiveEntryPtr', `CString' } -> `()' #}
 {# fun archive_entry_copy_pathname_w as ^ { `ArchiveEntryPtr', `CWString' } -> `()' #}
+#ifdef mingw32_HOST_OS
+{# fun archive_entry_set_perm as ^ { `ArchiveEntryPtr', `CUShort' } -> `()' #}
+#else
 {# fun archive_entry_set_perm as ^ { `ArchiveEntryPtr', `CMode' } -> `()' #}
+#endif
 {# fun archive_entry_set_rdev as ^ { `ArchiveEntryPtr', `CDev' } -> `()' #}
 {# fun archive_entry_set_rdevmajor as ^ { `ArchiveEntryPtr', `CDev' } -> `()' #}
 {# fun archive_entry_set_rdevminor as ^ { `ArchiveEntryPtr', `CDev' } -> `()' #}
diff --git a/src/Codec/Archive/Internal/Pack/Common.hs b/src/Codec/Archive/Internal/Pack/Common.hs
--- a/src/Codec/Archive/Internal/Pack/Common.hs
+++ b/src/Codec/Archive/Internal/Pack/Common.hs
@@ -23,4 +23,4 @@
 mkEntry fp = do
     status <- getFileStatus fp
     content' <- mkContent fp status
-    pure $ Entry fp content' (fileMode status) (Ownership Nothing Nothing (fromIntegral $ fileOwner status) (fromIntegral $ fileGroup status)) Nothing
+    pure $ Entry fp content' (fromIntegral (fileMode status)) (Ownership Nothing Nothing (fromIntegral $ fileOwner status) (fromIntegral $ fileGroup status)) Nothing
diff --git a/src/Codec/Archive/Types.cpphs b/src/Codec/Archive/Types.cpphs
new file mode 100644
--- /dev/null
+++ b/src/Codec/Archive/Types.cpphs
@@ -0,0 +1,75 @@
+module Codec.Archive.Types ( -- * Concrete (Haskell) data types
+                             Entry (..)
+                           , EntryContent (..)
+                           , Ownership (..)
+                           , ModTime
+                           , Id
+                           , Permissions
+                           , ArchiveEncryption (..)
+                           , ArchiveResult (..)
+                           , ArchiveEntryDigest (..)
+                           -- * Foreign types
+                           , module Codec.Archive.Types.Foreign
+                           -- * Callbacks
+                           , ArchiveOpenCallback
+                           , ArchiveCloseCallback
+                           , ArchiveSwitchCallback
+                           , ArchiveFreeCallback
+                           -- * Marshalling functions
+                           , resultToErr
+                           ) where
+
+import           Codec.Archive.Types.Foreign
+import           Data.Int                    (Int64)
+import           Foreign.C.Types             (CInt, CLong, CTime, CUShort)
+import           Foreign.Ptr                 (Ptr)
+import           System.Posix.Types          (CMode (..))
+
+type ArchiveOpenCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
+type ArchiveCloseCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
+type ArchiveSwitchCallback a b = Ptr Archive -> Ptr a -> Ptr b -> IO ArchiveResult
+type ArchiveFreeCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
+
+resultToErr :: ArchiveResult -> CInt
+resultToErr = fromIntegral . fromEnum
+
+data ArchiveEncryption = HasEncryption
+                       | NoEncryption
+                       | EncryptionUnsupported
+                       | EncryptionUnknown
+                       deriving (Eq)
+
+-- TODO: support everything here: http://hackage.haskell.org/package/tar/docs/Codec-Archive-Tar-Entry.html#t:EntryContent
+data EntryContent fp e = NormalFile e
+                       | Directory
+                       | Symlink !fp !Symlink
+                       | Hardlink !fp
+    deriving (Show, Eq, Ord)
+
+-- | @e@ is the type of entry contents, for instance 'BSL.ByteString'
+--
+-- @fp@ is the type of file paths, for instance 'FilePath'
+data Entry fp e = Entry { filepath    :: !fp -- TODO: bytestring? functorial?
+                        , content     :: EntryContent fp e
+                        , permissions :: !Permissions
+                        , ownership   :: !Ownership
+                        , time        :: !(Maybe ModTime)
+                        }
+    deriving (Show, Eq, Ord)
+
+data Ownership = Ownership { userName  :: !(Maybe String)
+                           , groupName :: !(Maybe String)
+                           , ownerId   :: !Id
+                           , groupId   :: !Id
+                           }
+    deriving (Eq, Show, Ord)
+
+#ifdef mingw32_HOST_OS
+type Permissions = CUShort
+#else
+type Permissions = CMode
+#endif
+type ModTime = (CTime, CLong)
+
+-- | A user or group ID
+type Id = Int64
diff --git a/src/Codec/Archive/Types.hs b/src/Codec/Archive/Types.hs
deleted file mode 100644
--- a/src/Codec/Archive/Types.hs
+++ /dev/null
@@ -1,71 +0,0 @@
-module Codec.Archive.Types ( -- * Concrete (Haskell) data types
-                             Entry (..)
-                           , EntryContent (..)
-                           , Ownership (..)
-                           , ModTime
-                           , Id
-                           , Permissions
-                           , ArchiveEncryption (..)
-                           , ArchiveResult (..)
-                           , ArchiveEntryDigest (..)
-                           -- * Foreign types
-                           , module Codec.Archive.Types.Foreign
-                           -- * Callbacks
-                           , ArchiveOpenCallback
-                           , ArchiveCloseCallback
-                           , ArchiveSwitchCallback
-                           , ArchiveFreeCallback
-                           -- * Marshalling functions
-                           , resultToErr
-                           ) where
-
-import           Codec.Archive.Types.Foreign
-import           Data.Int                    (Int64)
-import           Foreign.C.Types             (CInt, CLong, CTime)
-import           Foreign.Ptr                 (Ptr)
-import           System.Posix.Types          (CMode (..))
-
-type ArchiveOpenCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
-type ArchiveCloseCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
-type ArchiveSwitchCallback a b = Ptr Archive -> Ptr a -> Ptr b -> IO ArchiveResult
-type ArchiveFreeCallback a = Ptr Archive -> Ptr a -> IO ArchiveResult
-
-resultToErr :: ArchiveResult -> CInt
-resultToErr = fromIntegral . fromEnum
-
-data ArchiveEncryption = HasEncryption
-                       | NoEncryption
-                       | EncryptionUnsupported
-                       | EncryptionUnknown
-                       deriving (Eq)
-
--- TODO: support everything here: http://hackage.haskell.org/package/tar/docs/Codec-Archive-Tar-Entry.html#t:EntryContent
-data EntryContent fp e = NormalFile e
-                       | Directory
-                       | Symlink !fp !Symlink
-                       | Hardlink !fp
-    deriving (Show, Eq, Ord)
-
--- | @e@ is the type of entry contents, for instance 'BSL.ByteString'
---
--- @fp@ is the type of file paths, for instance 'FilePath'
-data Entry fp e = Entry { filepath    :: !fp -- TODO: bytestring? functorial?
-                        , content     :: EntryContent fp e
-                        , permissions :: !Permissions
-                        , ownership   :: !Ownership
-                        , time        :: !(Maybe ModTime)
-                        }
-    deriving (Show, Eq, Ord)
-
-data Ownership = Ownership { userName  :: !(Maybe String)
-                           , groupName :: !(Maybe String)
-                           , ownerId   :: !Id
-                           , groupId   :: !Id
-                           }
-    deriving (Eq, Show, Ord)
-
-type Permissions = CMode
-type ModTime = (CTime, CLong)
-
--- | A user or group ID
-type Id = Int64
diff --git a/test/Spec.cpphs b/test/Spec.cpphs
--- a/test/Spec.cpphs
+++ b/test/Spec.cpphs
@@ -11,7 +11,16 @@
 import           System.Directory        (doesDirectoryExist, listDirectory)
 import           System.FilePath         ((</>))
 import           System.IO.Temp          (withSystemTempDirectory)
+#ifdef mingw32_HOST_OS
+import           System.Environment
+import           Test.Hspec  hiding ( parallel )
+import           Test.Hspec.Core.Runner
+
+parallel :: SpecWith a -> SpecWith a
+parallel = id
+#else
 import           Test.Hspec
+#endif
 
 testFp :: FilePath -> Spec
 testFp fp = parallel $ it ("sucessfully unpacks/packs (" ++ fp ++ ")") $
@@ -59,7 +68,7 @@
     tarballs <- if dir then listDirectory "test/data" else pure []
     let tarPaths = ("test/data" </>) <$> tarballs
 
-    hspec $
+    hspec' $
         describe "roundtrip" $ do
 
             traverse_ testFp tarPaths
@@ -107,3 +116,9 @@
                 [ stripOwnership (simpleFile "a.txt" (NormalFile "text")) ]
             xcontext "having entry without timestamp" . itPacksUnpacks $
                 [ stripTime (simpleFile "a.txt" (NormalFile "text")) ]
+  where
+#ifdef mingw32_HOST_OS
+    hspec' spec = getArgs >>= readConfig defaultConfig >>= (\c -> withArgs [] . runSpec spec $ c{ configConcurrentJobs = Nothing }) >>= evaluateSummary
+#else
+    hspec' = hspec
+#endif
