From: Tim Kientzle Date: Sat, 31 Oct 2009 17:16:37 +0000 (-0400) Subject: Shuffle the major/minor/makedev support a bit; this should work X-Git-Tag: v2.8.0~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f64eae40dc9b1c909afc75861834ba93c967148;p=thirdparty%2Flibarchive.git Shuffle the major/minor/makedev support a bit; this should work on both Windows and Haiku. SVN-Revision: 1553 --- diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index 579ae1f4f..bd2c4469e 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -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 #endif -#ifdef MAJOR_IN_MKDEV +#if MAJOR_IN_MKDEV #include -#else -#ifdef MAJOR_IN_SYSMACROS +#define HAVE_MAJOR +#elif MAJOR_IN_SYSMACROS #include -#endif +#define HAVE_MAJOR #endif #ifdef HAVE_LIMITS_H #include @@ -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. */ diff --git a/libarchive/archive_entry_xattr.c b/libarchive/archive_entry_xattr.c index b6d3edc3a..a929d3738 100644 --- a/libarchive/archive_entry_xattr.c +++ b/libarchive/archive_entry_xattr.c @@ -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 #endif -#ifdef MAJOR_IN_MKDEV -#include -#else -#ifdef MAJOR_IN_SYSMACROS -#include -#endif -#endif #ifdef HAVE_LIMITS_H #include #endif diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h index 04b25af6e..90116ed48 100644 --- a/libarchive/archive_windows.h +++ b/libarchive/archive_windows.h @@ -89,11 +89,6 @@ #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