From: Michihiro NAKAJIMA Date: Thu, 4 Feb 2010 01:30:44 +0000 (-0500) Subject: Fix build failure on msys. X-Git-Tag: v3.0.0a~1288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646d8fcdbcc063b149d2a427d588bc735c95648c;p=thirdparty%2Flibarchive.git Fix build failure on msys. SVN-Revision: 1865 --- diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c index 8e1dfdb28..c48be83be 100644 --- a/libarchive/archive_read_disk_entry_from_file.c +++ b/libarchive/archive_read_disk_entry_from_file.c @@ -744,6 +744,13 @@ exit_setup_sparse: /* * Windows sparse interface. */ +#if defined(__MINGW32__) && !defined(FSCTL_QUERY_ALLOCATED_RANGES) +#define FSCTL_QUERY_ALLOCATED_RANGES 0x940CF +typedef struct { + LARGE_INTEGER FileOffset; + LARGE_INTEGER Length; +} FILE_ALLOCATED_RANGE_BUFFER; +#endif static int setup_sparse(struct archive_read_disk *a, diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 56c16de68..16f2cf30c 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -53,12 +53,14 @@ struct sparse { }; #if defined(_WIN32) && !defined(__CYGWIN__) - +#include /* * Create a sparse file on Windows. */ +#if !defined(PATH_MAX) #define PATH_MAX MAX_PATH +#endif #if !defined(__BORLANDC__) #define getcwd _getcwd #endif