In archive_entry.h refer to "BY_HANDLE_FILE_INFORMATION *" using
"struct _BY_HANDLE_FILE_INFORMATION *" to avoid requiring the
includer to already have <windows.h>.
Resolve conflicts in favor of the upstream side where possible.
Resolve a logical conflict in archive_windows.h where the upstream
port to Watcom was done slightly differently from ours.
At least one compiler (Borland) defines mode_t as just "short" which is
signed. This breaks code like
switch(archive_entry_filetype(e)) {
case AE_IFREG:
...
}
if AE_IFREG and other constants have a longer signed type (int) because
sign extension of the mode_t return type from archive_entry_filetype
changes its value. Avoid the problem by ensuring the type of the
constants matches mode_t.
This change was originally made in commit a73acfbe (Fix for mode_t with
signed types, 2009-11-07). Port it to the new libarchive snapshot.
Make changes equivalent to those originally made by commits
bd56626a (Fixes for the OSF operating system build, 2010-09-08)
92c082b1 (Add a fix for the inline keyword on the osf os, 2010-09-10)
but based on the updated libarchive snapshot.
The commit "libarchive: Fix Borland integer constants" introduced use of
HAVE_* configured macros into archive.h and archive_entry.h where they
are not allowed. This commit replaces the logic with something that
does not depend on the configured macros.
Some versions of Borland provide <stdint.h>, so we use it when possible.
However, the 64-bit signed and unsigned integer min/max constants cause
overflow warnings from Borland itself! For these constants we fall back
on our default definitions.
This allows for a built in bzip and zip capability, so external tools
will not be needed for these packagers. The cmake -E tar xf should be
able to handle all compression types now as well.