]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build failure without zlib.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 15 Dec 2012 23:01:37 +0000 (08:01 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 15 Dec 2012 23:01:37 +0000 (08:01 +0900)
libarchive/archive_write_disk_posix.c
libarchive/test/test_write_disk_appledouble.c
libarchive/test/test_write_disk_hfs_compression.c
libarchive/test/test_write_disk_mac_metadata.c
libarchive/test/test_write_disk_no_hfs_compression.c

index 8fa39cb74941e90ee8c8948b48fb421a302ad4f4..aaae72028525cfb2779af87ef9182a1fb25d85e7 100644 (file)
@@ -554,7 +554,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
                else
                        a->todo |= TODO_MAC_METADATA;
        }
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H)
        if ((a->flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) == 0) {
                unsigned long set, clear;
                archive_entry_fflags(a->entry, &set, &clear);
@@ -603,7 +603,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
 
        ret = restore_entry(a);
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H)
        /*
         * Check if the filesystem the file is restoring on supports
         * HFS+ Compression. If not, cancel HFS+ Compression.
@@ -839,7 +839,8 @@ write_data_block(struct archive_write_disk *a, const char *buff, size_t size)
        return (start_size - size);
 }
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
+       && defined(HAVE_ZLIB_H)
 
 /*
  * Set UF_COMPRESSED file flag.
@@ -1507,7 +1508,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
        } else if (a->fd_offset == a->filesize) {
                /* Last write ended at exactly the filesize; we're done. */
                /* Hopefully, this is the common case. */
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H)
        } else if (a->todo & TODO_HFS_COMPRESSION) {
                char null_d[1024];
                ssize_t r;
index e9ec6cb4932d7bbde507714b77510a71c2c3afaa..d604fbf2d51b59b2e0e42a943a016941a5107a6a 100644 (file)
@@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/xattr.h>
 #endif
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
+       && defined(HAVE_ZLIB_H)
 static int
 has_xattr(const char *filename, const char *xattrname)
 {
@@ -75,7 +76,8 @@ has_xattr(const char *filename, const char *xattrname)
  */
 DEFINE_TEST(test_write_disk_appledouble)
 {
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\
+       || !defined(HAVE_ZLIB_H)
        skipping("MacOS-specific AppleDouble test");
 #else
        const char *refname = "test_write_disk_appledouble.cpio.gz";
index dbb8a6fbce0a468fdb3eb475b9e61e99271afab2..24c13c4ed68a1818c99a43151fe6c515c557dbb4 100644 (file)
@@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/xattr.h>
 #endif
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
+       && defined(HAVE_ZLIB_H)
 static int
 has_xattr(const char *filename, const char *xattrname)
 {
@@ -87,7 +88,8 @@ get_rsrc_footer(const char *filename, char *buff, size_t s)
  */
 DEFINE_TEST(test_write_disk_hfs_compression)
 {
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\
+       || !defined(HAVE_ZLIB_H)
        skipping("MacOS-specific HFS+ Compression test");
 #else
        const char *refname = "test_write_disk_hfs_compression.tgz";
index aef6152ee2fbc542e9832be6ea466e8e8907d616..f9e47d6593639b6d0b4da20dae97b31e8355fb06 100644 (file)
@@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/xattr.h>
 #endif
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
+       && defined(HAVE_ZLIB_H)
 static int
 has_xattr(const char *filename, const char *xattrname)
 {
@@ -75,7 +76,8 @@ has_xattr(const char *filename, const char *xattrname)
  */
 DEFINE_TEST(test_write_disk_mac_metadata)
 {
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\
+       || !defined(HAVE_ZLIB_H)
        skipping("MacOS-specific Mac Metadata test");
 #else
        const char *refname = "test_write_disk_mac_metadata.tar.gz";
index 9c6d2c21a8657860e731a66b61566d791845ef1a..a1afb9bb290f0fdd5217790be5b35239d2dcfdd2 100644 (file)
@@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/xattr.h>
 #endif
 
-#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\
+       && defined(HAVE_ZLIB_H)
 static int
 has_xattr(const char *filename, const char *xattrname)
 {
@@ -71,7 +72,8 @@ has_xattr(const char *filename, const char *xattrname)
  */
 DEFINE_TEST(test_write_disk_no_hfs_compression)
 {
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\
+       || !defined(HAVE_ZLIB_H)
        skipping("MacOS-specific HFS+ Compression test");
 #else
        const char *refname = "test_write_disk_no_hfs_compression.tgz";