From f6725490eb023174d0ec6d3e0763000275108d46 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 19 Jul 2009 15:49:44 -0400 Subject: [PATCH] Include archive_windows.h directly via archive_platform.h, in preparation for removing this include from the cmake-generated config.h. SVN-Revision: 1244 --- libarchive/archive_platform.h | 8 ++++++++ libarchive/archive_windows.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/libarchive/archive_platform.h b/libarchive/archive_platform.h index 763c29657..88bcfd505 100644 --- a/libarchive/archive_platform.h +++ b/libarchive/archive_platform.h @@ -50,6 +50,14 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* It should be possible to get rid of this by extending the feature-test + * macros to cover Windows API functions, probably along with non-trivial + * refactoring of code to find structures that sit more cleanly on top of + * either Windows or Posix APIs. */ +#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) +#include "archive_windows.h" +#endif + /* * The config files define a lot of feature macros. The following * uses those macros to select/define replacements and include key diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h index 1a15a773d..c1bff32a8 100644 --- a/libarchive/archive_windows.h +++ b/libarchive/archive_windows.h @@ -309,8 +309,17 @@ extern "C" { /* Implementation POSIX function */ extern int link (const char *from, const char *to); extern int symlink (const char *from, const char *to); +#ifndef HAVE_FTRUNCATE +#define HAVE_FTRUNCATE 1 +#endif extern int ftruncate(int fd, off_t length); +#ifndef HAVE_FUTIMES +#define HAVE_FUTIMES 1 +#endif extern int futimes(int fd, const struct __timeval *times); +#ifndef HAVE_UTIMES +#define HAVE_UTIMES 1 +#endif extern int utimes(const char *name, const struct __timeval *times); /* Replacement POSIX function */ -- 2.47.3