[libmad] Fix libmad header for non-x86 MSVC targets (#8959)

This commit is contained in:
Michał Janiszewski 2019-11-19 20:03:05 +01:00 committed by Robert Schumacher
parent 9d1048e612
commit b92ebdce15
3 changed files with 31 additions and 5 deletions

View File

@ -0,0 +1,25 @@
diff --git a/mad.h b/mad.h
index 9ef6cc8..5e3f7aa 100644
--- a/mad.h
+++ b/mad.h
@@ -24,7 +24,11 @@
extern "C" {
# endif
+#ifdef _WIN64
+# define FPM_64BIT
+#else
# define FPM_INTEL
+#endif
@@ -184,7 +188,7 @@ typedef mad_fixed_t mad_sample_t;
# elif defined(FPM_INTEL)
-# if defined(_MSC_VER)
+# if defined(_MSC_VER) && defined(_M_IX86)
# pragma warning(push)
# pragma warning(disable: 4035) /* no return value */
static __forceinline

View File

@ -1,3 +1,3 @@
Source: libmad
Version: 0.15.1-4
Version: 0.15.1-5
Description: high-quality MPEG audio decoder

View File

@ -11,14 +11,15 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
OUT_SOURCE_PATH SOURCE_PATH
PATCHES
0001-Fix-MSVC-ARM.patch
)
#The archive only contains a Visual Studio 6.0 era DSP project file, so use a custom CMakeLists.txt
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
#Use the msvc++ config.h and mad.h header
#Use the msvc++ config.h header
file(COPY ${SOURCE_PATH}/msvc++/config.h DESTINATION ${SOURCE_PATH})
file(COPY ${SOURCE_PATH}/msvc++/mad.h DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}