]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
On Windows, now archive_read_disk_set_standard_lookup.c is linked.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Jan 2009 23:42:22 +0000 (18:42 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Jan 2009 23:42:22 +0000 (18:42 -0500)
We call archive_read_disk_set_standard_lookup() function on
libarchive_test again, and check a value which that function
returns to what the feature is available.
This aims that programs which use libarchive shouldn't have to
to know what features are available on a particular platform.

Suggested by Tim

SVN-Revision: 402

libarchive/archive_read_disk_set_standard_lookup.c
libarchive/test/test_read_disk.c
windows/vc71/libarchive.vcproj
windows/vc80/libarchive.vcproj
windows/vc90/libarchive.vcproj

index 8af42b0e384e02ca35466f8a1dcaa4e73cc93528..3c6723add2eb6ef0355777d9582863e58f3589c4 100644 (file)
@@ -47,6 +47,14 @@ __FBSDID("$FreeBSD$");
 
 #include "archive.h"
 
+#ifdef _WIN32
+int
+archive_read_disk_set_standard_lookup(struct archive *a)
+{
+       archive_set_error(a, -1, "Standard lookups not available on Windows");
+       return (ARCHIVE_FATAL);
+}
+#else
 #define        name_cache_size 127
 
 static const char * const NO_NAME = "(noname)";
@@ -218,3 +226,4 @@ lookup_gname_helper(struct archive *a, id_t id)
 
        return strdup(grent.gr_name);
 }
+#endif /* _WIN32 */
\ No newline at end of file
index 95ba4532aef42072562db3926db8374357b2e859..1332408dec923d5b8d25458fa826047b3898d877 100644 (file)
@@ -94,13 +94,13 @@ DEFINE_TEST(test_read_disk)
            archive_read_disk_set_uname_lookup(a, NULL, NULL, NULL));
        assertEqualInt(umagic, 0x2345);
 
-#ifndef _WIN32
        /* Try the standard lookup functions. */
-       assertEqualInt(ARCHIVE_OK,
-           archive_read_disk_set_standard_lookup(a));
-#endif
-       assertEqualString(archive_read_disk_uname(a, 0), "root");
-       assertEqualString(archive_read_disk_gname(a, 0), "wheel");
+       if (archive_read_disk_set_standard_lookup(a) != ARCHIVE_OK) {
+               skipping("standard uname/gname lookup");
+       } else {
+               assertEqualString(archive_read_disk_uname(a, 0), "root");
+               assertEqualString(archive_read_disk_gname(a, 0), "wheel");
+       }
 
        /* Deregister again and verify the default lookups again. */
        assertEqualInt(ARCHIVE_OK,
index f79edd0d8717400b3a87e636e7e7556bde29483e..6edeccb967245fd31f4d2d2f67190e807f9645ee 100644 (file)
                        <File\r
                                RelativePath="..\..\libarchive\archive_read_disk.c">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\libarchive\archive_read_extract.c">\r
                        </File>\r
index c344ffcae545da0882d38b0806fc148c5c532dfe..12f4d4e04a20a8160a3008d8cdf342869dfd66f2 100644 (file)
                                RelativePath="..\..\libarchive\archive_read_disk.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\libarchive\archive_read_extract.c"\r
                                >\r
index dc372f6594860595d1422d1a6746af576b50ad0a..6a5499eb098374e1078b1b87ebd0b92f83c4beee 100644 (file)
                                RelativePath="..\..\libarchive\archive_read_disk.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\libarchive\archive_read_disk_set_standard_lookup.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\libarchive\archive_read_extract.c"\r
                                >\r