shithub: aacdec

Download patch

ref: 5a036511227b01a6957fe8e42016b5552ac9f7a6
parent: f27df30594f3751d36c95f9d2e58a42a924b3413
author: LoRd_MuldeR <mulder2@gmx.de>
date: Sat Dec 16 14:43:55 EST 2017

Fixed compilation of functions 'bswap32' and 'bswap16' on Win32.

--- a/frontend/mp4read.c
+++ b/frontend/mp4read.c
@@ -45,17 +45,29 @@
 
 static FILE *g_fin = NULL;
 
-static inline uint32_t bswap32(uint32_t u32)
+static inline uint32_t bswap32(const uint32_t u32)
 {
 #ifndef WORDS_BIGENDIAN
+#ifdef _MSC_VER
+	return _byteswap_ulong(u32);
+#else
     return __builtin_bswap32(u32);
 #endif
+#else
+	return u32;
+#endif
 }
 
-static inline uint16_t bswap16(uint16_t u16)
+static inline uint16_t bswap16(const uint16_t u16)
 {
 #ifndef WORDS_BIGENDIAN
-    return __builtin_bswap16(u16);
+#ifdef _MSC_VER
+	return _byteswap_ushort(u16);
+#else
+	return __builtin_bswap16(u16);
+#endif
+#else
+	return u16;
 #endif
 }