Updated FAAD binary to v2.8.6 (2017-10-10), compiled with ICL 18.0 and MSVC 15.5.
[LameXP.git] / etc / Patches / FAAD-v2.8.6-Win32-ByteSwap-Fix.diff
blob9607d76084636fd827d10e4a76dbdc41cff60c4c
1 frontend/mp4read.c | 18 +++++++++++++++---
2 1 file changed, 15 insertions(+), 3 deletions(-)
4 diff --git a/frontend/mp4read.c b/frontend/mp4read.c
5 index 9d92bf5..c8ca530 100644
6 --- a/frontend/mp4read.c
7 +++ b/frontend/mp4read.c
8 @@ -45,17 +45,29 @@ mp4config_t mp4config = { 0 };
10 static FILE *g_fin = NULL;
12 -static inline uint32_t bswap32(uint32_t u32)
13 +static inline uint32_t bswap32(const uint32_t u32)
15 #ifndef WORDS_BIGENDIAN
16 +#ifdef _MSC_VER
17 + return _byteswap_ulong(u32);
18 +#else
19 return __builtin_bswap32(u32);
20 #endif
21 +#else
22 + return u32;
23 +#endif
26 -static inline uint16_t bswap16(uint16_t u16)
27 +static inline uint16_t bswap16(const uint16_t u16)
29 #ifndef WORDS_BIGENDIAN
30 - return __builtin_bswap16(u16);
31 +#ifdef _MSC_VER
32 + return _byteswap_ushort(u16);
33 +#else
34 + return __builtin_bswap16(u16);
35 +#endif
36 +#else
37 + return u16;
38 #endif