From 3709bd64a439abc33ddc54a71b500bbde3f9dd96 Mon Sep 17 00:00:00 2001
From: Tim Blechmann <tim.blechmann@qt.io>
Date: Sun, 30 Mar 2025 19:25:34 +0800
Subject: [PATCH] 3rdparty: drwav - namespace implementation

Change-Id: Iecadf34d13e9d71b7e97d9ec706616d00df15461
---
 src/3rdparty/dr_libs/dr_wav.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/3rdparty/dr_libs/dr_wav.h b/src/3rdparty/dr_libs/dr_wav.h
index f9f69a725..8844a3406 100644
--- a/src/3rdparty/dr_libs/dr_wav.h
+++ b/src/3rdparty/dr_libs/dr_wav.h
@@ -135,25 +135,24 @@ Notes
 - dr_wav will try to read the WAV file as best it can, even if it's not strictly conformant to the WAV format.
 */
 
 #ifndef dr_wav_h
 #define dr_wav_h
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 #define DRWAV_STRINGIFY(x)      #x
 #define DRWAV_XSTRINGIFY(x)     DRWAV_STRINGIFY(x)
 
 #define DRWAV_VERSION_MAJOR     0
 #define DRWAV_VERSION_MINOR     13
 #define DRWAV_VERSION_REVISION  17
 #define DRWAV_VERSION_STRING    DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION)
 
 #include <stddef.h> /* For size_t. */
+QT_BEGIN_NAMESPACE
+namespace QtPrivate {
 
 /* Sized Types */
 typedef   signed char           drwav_int8;
 typedef unsigned char           drwav_uint8;
 typedef   signed short          drwav_int16;
 typedef unsigned short          drwav_uint16;
@@ -1314,15 +1313,15 @@ DRWAV_API float drwav_bytes_to_f32(const drwav_uint8* data);
 /* Compares a GUID for the purpose of checking the type of a Wave64 chunk. */
 DRWAV_API drwav_bool32 drwav_guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]);
 
 /* Compares a four-character-code for the purpose of checking the type of a RIFF chunk. */
 DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b);
 
-#ifdef __cplusplus
-}
-#endif
+} // namespace QtPrivate
+QT_END_NAMESPACE
+
 #endif  /* dr_wav_h */
 
 
 /************************************************************************************************************************************************************
  ************************************************************************************************************************************************************
 
@@ -1461,12 +1460,16 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b);
     #endif
     #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
         #define DRWAV_HAS_BYTESWAP16_INTRINSIC
     #endif
 #endif
 
+QT_BEGIN_NAMESPACE
+namespace QtPrivate {
+
+
 DRWAV_API void drwav_version(drwav_uint32* pMajor, drwav_uint32* pMinor, drwav_uint32* pRevision)
 {
     if (pMajor) {
         *pMajor = DRWAV_VERSION_MAJOR;
     }
 
@@ -8351,12 +8354,15 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b)
 
 #ifdef __MRC__
 /* Undo the pragma at the beginning of this file. */
 #pragma options opt reset
 #endif
 
+} // namespace QtPrivate
+QT_END_NAMESPACE
+
 #endif  /* dr_wav_c */
 #endif  /* DR_WAV_IMPLEMENTATION */
 
 /*
 REVISION HISTORY
 ================
-- 
2.45.2

