From 359cd5d59379b04f396b522f01fb69d8293b6398 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 10 Apr 2022 14:00:04 +0300
Subject: [PATCH] dr_mp3.h: sync with mainstream
---
src/dr_mp3.h | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/dr_mp3.h b/src/dr_mp3.h
index 22348b0..6fcc7e8 100644
--- a/src/dr_mp3.h
+++ b/src/dr_mp3.h
@@ -1,6 +1,6 @@
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
-dr_mp3 - v0.6.32 - 2021-12-11
+dr_mp3 - v0.6.33 - 2022-04-10
David Reid - mackron@gmail.com
@@ -101,7 +101,7 @@ extern "C" {
#define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6
-#define DRMP3_VERSION_REVISION 32
+#define DRMP3_VERSION_REVISION 33
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@@ -232,16 +232,25 @@ typedef drmp3_int32 drmp3_result;
#ifdef _MSC_VER
#define DRMP3_INLINE __forceinline
-#elif (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))) || defined(__clang__)
+#elif defined(__GNUC__)
/*
I've had a bug report where GCC is emitting warnings about functions possibly not being inlineable. This warning happens when
the __attribute__((always_inline)) attribute is defined without an "inline" statement. I think therefore there must be some
case where "__inline__" is not always defined, thus the compiler emitting these warnings. When using -std=c89 or -ansi on the
- command line, we cannot use the "inline" keyword and instead need to use "__inline__".
+ command line, we cannot use the "inline" keyword and instead need to use "__inline__". In an attempt to work around this issue
+ I am using "__inline__" only when we're compiling in strict ANSI mode.
*/
- #define DRMP3_INLINE __inline__ __attribute__((always_inline))
-#elif defined(__GNUC__)
- #define DRMP3_INLINE __inline__
+ #if defined(__STRICT_ANSI__)
+ #define DRMP3_GNUC_INLINE_HINT __inline__
+ #else
+ #define DRMP3_GNUC_INLINE_HINT inline
+ #endif
+
+ #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) || defined(__clang__)
+ #define DRMP3_INLINE DRMP3_GNUC_INLINE_HINT __attribute__((always_inline))
+ #else
+ #define DRMP3_INLINE DRMP3_GNUC_INLINE_HINT
+ #endif
#elif defined(__WATCOMC__)
#define DRMP3_INLINE __inline
#else
@@ -2117,11 +2126,11 @@ static void drmp3d_synth(float *xl, drmp3d_sample_t *dstl, int nch, float *lins)
vst1_lane_s16(dstl + (49 + i)*nch, pcmb, 2);
#endif
#else
-#if DRMP3_HAVE_SSE
+ #if DRMP3_HAVE_SSE
static const drmp3_f4 g_scale = { 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f };
-#else /* NEON: */
+ #else
const drmp3_f4 g_scale = vdupq_n_f32(1.0f/32768.0f);
-#endif
+ #endif
a = DRMP3_VMUL(a, g_scale);
b = DRMP3_VMUL(b, g_scale);
#if DRMP3_HAVE_SSE
@@ -2488,6 +2497,7 @@ static DRMP3_INLINE drmp3_uint32 drmp3_gcf_u32(drmp3_uint32 a, drmp3_uint32 b)
return a;
}
+
static void* drmp3__malloc_default(size_t sz, void* pUserData)
{
(void)pUserData;
@@ -4480,6 +4490,11 @@ counts rather than sample counts.
/*
REVISION HISTORY
================
+v0.6.33 - 2022-04-10
+ - Fix compilation error with the MSVC ARM64 build.
+ - Fix compilation error on older versions of GCC.
+ - Remove some unused functions.
+
v0.6.32 - 2021-12-11
- Fix a warning with Clang.