From: Tim Kientzle Date: Mon, 5 May 2008 21:25:45 +0000 (-0400) Subject: A few people are reporting success building libarchive on Windows! X-Git-Tag: v2.6.0~267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=122c5637801adb55dec32124ae21a62ed64b4807;p=thirdparty%2Flibarchive.git A few people are reporting success building libarchive on Windows! Submitted by: Scott SVN-Revision: 25 --- diff --git a/libarchive/archive.h b/libarchive/archive.h index eed4a2b5d..e0bb98a45 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -28,9 +28,19 @@ #ifndef ARCHIVE_H_INCLUDED #define ARCHIVE_H_INCLUDED +/* + * Note: archive.h is for use outside of libarchive; the configuration + * headers (config.h, archive_platform.h, etc.) are purely internal. + * Do NOT use HAVE_XXX configuration macros to control the behavior of + * this header! If you must conditionalize, use predefined compiler and/or + * platform macros. + */ + #include /* Linux requires this for off_t */ -/* TODO: Conditionalize this include on platforms that don't support it. */ +#if !defined(__WATCOMC__) && !defined(_MSC_VER) +/* Header unavailable on Watcom C or MS Visual C++. */ #include /* int64_t, etc. */ +#endif #include /* For FILE * */ /* Get appropriate definitions of standard POSIX-style types. */ diff --git a/libarchive/archive_endian.h b/libarchive/archive_endian.h index 259f5de91..61af4161c 100644 --- a/libarchive/archive_endian.h +++ b/libarchive/archive_endian.h @@ -28,9 +28,23 @@ * Borrowed from FreeBSD's */ +/* Note: This is a purely internal header! */ +/* Do not use this outside of libarchive internal code! */ + #ifndef ARCHIVE_ENDIAN_H_INCLUDED #define ARCHIVE_ENDIAN_H_INCLUDED + +/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */ +#if defined( __WATCOMC__ ) + #define inline +#endif + +/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */ +#if defined(_MSC_VER) + #define inline +#endif + /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ static inline uint16_t diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index 5f7771ca7..f8601b9ee 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -28,6 +28,14 @@ #ifndef ARCHIVE_ENTRY_H_INCLUDED #define ARCHIVE_ENTRY_H_INCLUDED +/* + * Note: archive_entry.h is for use outside of libarchive; the + * configuration headers (config.h, archive_platform.h, etc.) are + * purely internal. Do NOT use HAVE_XXX configuration macros to + * control the behavior of this header! If you must conditionalize, + * use predefined compiler and/or platform macros. + */ + #include #include /* for wchar_t */ #include @@ -37,18 +45,25 @@ #ifdef _WIN32 #define __LA_UID_T unsigned int #define __LA_GID_T unsigned int -#define __LA_INO_T unsigned int #define __LA_DEV_T unsigned int #define __LA_MODE_T unsigned short #else #include #define __LA_UID_T uid_t #define __LA_GID_T gid_t -#define __LA_INO_T ino_t #define __LA_DEV_T dev_t #define __LA_MODE_T mode_t #endif +/* + * XXX Is this defined for all Windows compilers? If so, in what + * header? It would be nice to remove the __LA_INO_T indirection and + * just use plain ino_t everywhere. Likewise for the other types just + * above. + */ +#define __LA_INO_T ino_t + + /* * On Windows, define LIBARCHIVE_STATIC if you're building or using a * .lib. The default here assumes you're building a DLL. Only