]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Shuffle the major/minor/makedev support a bit; this should work
authorTim Kientzle <kientzle@gmail.com>
Sat, 31 Oct 2009 17:16:37 +0000 (13:16 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sat, 31 Oct 2009 17:16:37 +0000 (13:16 -0400)
on both Windows and Haiku.

SVN-Revision: 1553

libarchive/archive_entry.c
libarchive/archive_entry_xattr.c
libarchive/archive_windows.h

index 579ae1f4fb92d3bf1ded58233357c5a3370532ed..bd2c4469e0302476cda19b8435935bee5eb79807 100644 (file)
@@ -32,12 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef MAJOR_IN_MKDEV
+#if MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
+#define HAVE_MAJOR
+#elif MAJOR_IN_SYSMACROS
 #include <sys/sysmacros.h>
-#endif
+#define HAVE_MAJOR
 #endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
@@ -75,6 +75,13 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
 #undef max
 #define        max(a, b)       ((a)>(b)?(a):(b))
 
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define        major(x) ((int)(0x00ff & ((x) >> 8)))
+#define        minor(x) ((int)(0xffff00ff & (x)))
+#define        makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
+
 /* Play games to come up with a suitable makedev() definition. */
 #ifdef __QNXNTO__
 /* QNX.  <sigh> */
index b6d3edc3acda23dec6305689a8b2db6c2acb5e7f..a929d37386297687deb5d752d193c514e287e93d 100644 (file)
@@ -32,13 +32,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
-#endif
-#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
index 04b25af6e58da29f096efdd8bbc82d040d58cf40..90116ed48ff98b42ea888d55f26dfa1058a6dae0 100644 (file)
 #endif
 #endif
 
-/* Replacement for major/minor/makedev. */
-#define        major(x) ((int)(0x00ff & ((x) >> 8)))
-#define        minor(x) ((int)(0xffff00ff & (x)))
-#define        makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
-
 /* Alias the Windows _function to the POSIX equivalent. */
 #define        access          _access
 #define        chdir           __la_chdir