From: Michihiro NAKAJIMA Date: Sat, 24 Dec 2011 12:54:52 +0000 (-0500) Subject: Fix build failure using __packed on MSVC. X-Git-Tag: v3.0.4~2^2~169^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee19476f952aeee770e7846e8206490ce26f7ded;p=thirdparty%2Flibarchive.git Fix build failure using __packed on MSVC. SVN-Revision: 3981 --- diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c index a24c5d320..23a2025d0 100644 --- a/libarchive/archive_read_support_format_cpio.c +++ b/libarchive/archive_read_support_format_cpio.c @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_cpio.c 20116 #include "archive_private.h" #include "archive_read_private.h" +#ifdef _MSC_VER +#define __packed +#pragma pack(push, 1) +#endif struct cpio_bin_header { unsigned char c_magic[2]; unsigned char c_dev[2]; @@ -87,6 +91,11 @@ struct cpio_newc_header { char c_crc[8]; } __packed; +#ifdef _MSC_VER +#undef __packed +#pragma pack(pop) +#endif + struct links_entry { struct links_entry *next; struct links_entry *previous;