diff --git a/ports/libarchive/fix-xxhash-inline-for-visual-studio.patch b/ports/libarchive/fix-xxhash-inline-for-visual-studio.patch new file mode 100644 index 00000000000000..bc30d810a504bc --- /dev/null +++ b/ports/libarchive/fix-xxhash-inline-for-visual-studio.patch @@ -0,0 +1,17 @@ +diff --git a/libarchive/xxhash.c b/libarchive/xxhash.c +index 70750bae..f96e9d93 100644 +--- a/libarchive/xxhash.c ++++ b/libarchive/xxhash.c +@@ -150,7 +150,11 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S; + #if GCC_VERSION >= 409 + __attribute__((__no_sanitize_undefined__)) + #endif +-static inline U32 A32(const void * x) ++#if defined(_MSC_VER) ++static __inline U32 A32(const void * x) ++#else ++static inline U32 A32(const void* x) ++#endif + { + return (((const U32_S *)(x))->v); + } diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 4e6a5fd852d892..d577cee844a026 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( fix-dependencies.patch fix-cpu-set.patch disable-warnings.patch + fix-xxhash-inline-for-visual-studio.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS