Author: kientzle
Date: Sat Mar  7 00:36:50 2009
New Revision: 189465
URL: http://svn.freebsd.org/changeset/base/189465

Log:
  Merge r283,r529 from libarchive.googlecode.com: Fix ext2_fs.h includes
  for Linux.

Modified:
  head/lib/libarchive/archive_entry.c
  head/lib/libarchive/archive_write_disk.c

Modified: head/lib/libarchive/archive_entry.c
==============================================================================
--- head/lib/libarchive/archive_entry.c Sat Mar  7 00:25:33 2009        
(r189464)
+++ head/lib/libarchive/archive_entry.c Sat Mar  7 00:36:50 2009        
(r189465)
@@ -39,18 +39,22 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysmacros.h>
 #endif
 #endif
-#ifdef HAVE_EXT2FS_EXT2_FS_H
-#include <ext2fs/ext2_fs.h>    /* for Linux file flags */
-#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
 #ifdef HAVE_LINUX_FS_H
 #include <linux/fs.h>  /* for Linux file flags */
 #endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
 #ifdef HAVE_LINUX_EXT2_FS_H
 #include <linux/ext2_fs.h>     /* for Linux file flags */
 #endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h>    /* for Linux file flags */
+#endif
 #include <stddef.h>
 #include <stdio.h>
 #ifdef HAVE_STDLIB_H

Modified: head/lib/libarchive/archive_write_disk.c
==============================================================================
--- head/lib/libarchive/archive_write_disk.c    Sat Mar  7 00:25:33 2009        
(r189464)
+++ head/lib/libarchive/archive_write_disk.c    Sat Mar  7 00:36:50 2009        
(r189465)
@@ -51,10 +51,6 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_SYS_UTIME_H
 #include <sys/utime.h>
 #endif
-
-#ifdef HAVE_EXT2FS_EXT2_FS_H
-#include <ext2fs/ext2_fs.h>    /* for Linux file flags */
-#endif
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
@@ -67,6 +63,16 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_LINUX_FS_H
 #include <linux/fs.h>  /* for Linux file flags */
 #endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h>     /* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h>    /* Linux file flags, broken on Cygwin */
+#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to