]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
A few people are reporting success building libarchive on Windows!
authorTim Kientzle <kientzle@gmail.com>
Mon, 5 May 2008 21:25:45 +0000 (17:25 -0400)
committerTim Kientzle <kientzle@gmail.com>
Mon, 5 May 2008 21:25:45 +0000 (17:25 -0400)
Submitted by: Scott

SVN-Revision: 25

libarchive/archive.h
libarchive/archive_endian.h
libarchive/archive_entry.h

index eed4a2b5d1c8974311ee1712015a92877407e7e2..e0bb98a45969db469eb41700e65a550e39ccb6dd 100644 (file)
 #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 <sys/types.h>  /* 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 <inttypes.h> /* int64_t, etc. */
+#endif
 #include <stdio.h> /* For FILE * */
 
 /* Get appropriate definitions of standard POSIX-style types. */
index 259f5de91ea3b4321034e8d7e622c98cf6dc6bd9..61af4161c3798d49ac5d40212a390c3db5bbcff4 100644 (file)
  * Borrowed from FreeBSD's <sys/endian.h>
  */
 
+/* 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
index 5f7771ca79df1ccff87f2d762957e1b5be012e9b..f8601b9ee284ff296061add51910ad9871d5242e 100644 (file)
 #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 <sys/types.h>
 #include <stddef.h>  /* for wchar_t */
 #include <time.h>
 #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 <unistd.h>
 #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