Browse files

MinGW defines a value of S_IFBLK which is both useless and wrong.

Comment out this sanity-check on MinGW.  (It already doesn't apply
to VC++ because Microsoft doesn't define S_IFBLK.)

test_entry sanity-checks that S_IFBLK has the expected value on every
platform, even though libarchive per se doesn't depend on this.  So far,
MinGW is the only platform that's ever broken one of these checks, which
is reassuring, since it means that clients can reasonably pass unaltered
st_mode values into libarchive.  Even on MinGW, it will work, since
MinGW can never actually set S_IFBLK (Windows filesystems don't support it).

SVN-Revision: 1585
  • Loading branch information...
1 parent 24dbace commit 56965e7a9b1d8b0d70e55d952bd16172e7738746 @kientzle kientzle committed Nov 7, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 libarchive/test/test_entry.c
@@ -73,7 +73,9 @@ DEFINE_TEST(test_entry)
#ifdef S_IFCHR
assertEqualInt(S_IFCHR, AE_IFCHR);
-#ifdef S_IFBLK
+/* Work around MinGW, which defines S_IFBLK wrong. */
+/* */
+#if defined(S_IFBLK) && !defined(_WIN32)
assertEqualInt(S_IFBLK, AE_IFBLK);
#ifdef S_IFDIR

0 comments on commit 56965e7

Please sign in to comment.