#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. */
* 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
#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