From: Tim Kientzle Date: Sun, 19 Jul 2009 19:49:44 +0000 (-0400) Subject: Include archive_windows.h directly via archive_platform.h, in preparation for removin... X-Git-Tag: v2.8.0~517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6725490eb023174d0ec6d3e0763000275108d46;p=thirdparty%2Flibarchive.git Include archive_windows.h directly via archive_platform.h, in preparation for removing this include from the cmake-generated config.h. SVN-Revision: 1244 --- 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 */