[INCLUDE/REACTOS] Move the debug macros from mmebuddy.h to mmebuddy_debug.h. [SNDBLST...
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Nov 2015 16:19:07 +0000 (16:19 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Nov 2015 16:19:07 +0000 (16:19 +0000)
svn path=/trunk/; revision=69888

12 files changed:
reactos/dll/win32/sndblst/sndblst.c
reactos/dll/win32/wdmaud.drv/CMakeLists.txt
reactos/dll/win32/wdmaud.drv/legacy.c
reactos/dll/win32/wdmaud.drv/mixer.c
reactos/dll/win32/wdmaud.drv/mmixer.c
reactos/dll/win32/wdmaud.drv/wdmaud.c
reactos/include/reactos/libs/sound/mmebuddy.h
reactos/include/reactos/libs/sound/mmebuddy_debug.h [new file with mode: 0644]
reactos/lib/drivers/sound/mmebuddy/precomp.h
reactos/lib/drivers/sound/mment4/control.c
reactos/lib/drivers/sound/mment4/detect.c
reactos/lib/drivers/sound/mment4/registry.c

index 6161e1a..40ea7d1 100644 (file)
@@ -26,6 +26,7 @@
 #include <mmddk.h>
 #include <mmebuddy.h>
 #include <mment4.h>
+#include <mmebuddy_debug.h>
 //#include <debug.h>
 
 /* TODO: Give individual device names if someone has > 1 card */
index ef8039b..0da282b 100644 (file)
@@ -28,6 +28,5 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
 endif()
 
 add_importlibs(wdmaud.drv user32 winmm advapi32 msvcrt setupapi ksuser kernel32 ntdll)
-# FIXME: Address mmebuddy.h reliance on NDEBUG
-#add_pch(wdmaud.drv wdmaud.h SOURCE)
+add_pch(wdmaud.drv wdmaud.h SOURCE)
 add_cd_file(TARGET wdmaud.drv DESTINATION reactos/system32 FOR all)
index c731837..00c9507 100644 (file)
  *
  */
 
-#define NDEBUG
 #include "wdmaud.h"
+
+#define NDEBUG
 #include <debug.h>
+#include <mmebuddy_debug.h>
 
 #define KERNEL_DEVICE_NAME      L"\\\\.\\wdmaud"
 
index 7ee6ca2..0f00ccc 100644 (file)
@@ -7,13 +7,14 @@
  * PROGRAMMERS: Johannes Anderwald
  */
 
-#define NDEBUG
 #include "wdmaud.h"
 
 #include <samplerate.h>
 #include <float_cast.h>
 
+#define NDEBUG
 #include <debug.h>
+#include <mmebuddy_debug.h>
 
 extern HANDLE KernelHandle;
 
index f77ef19..a025a0e 100644 (file)
@@ -7,14 +7,15 @@
  * PROGRAMMERS: Johannes Anderwald
  */
 
-#define NDEBUG
 #include "wdmaud.h"
 
 #include <winreg.h>
 #include <setupapi.h>
 #include <mmixer.h>
 
+#define NDEBUG
 #include <debug.h>
+#include <mmebuddy_debug.h>
 
 typedef struct
 {
index 0494cc6..dfd8ea0 100644 (file)
  *
  */
 
-#define NDEBUG
 #include "wdmaud.h"
 
+#define NDEBUG
 #include <debug.h>
+#include <mmebuddy_debug.h>
 
 #ifndef USE_MMIXER_LIB
 #define FUNC_NAME(x) x##ByLegacy
index cbbb7fd..d124e8b 100644 (file)
 #ifndef ROS_AUDIO_MMEBUDDY_H
 #define ROS_AUDIO_MMEBUDDY_H
 
-/*
-    Hacky debug macro
-*/
-
-#define POPUP(...) \
-    { \
-        WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
-        wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
-        wsprintf(dbg_popup_msg, __VA_ARGS__); \
-        MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
-    }
-
-#ifndef NDEBUG
-    #define SND_ERR(...) \
-        { \
-            WCHAR dbg_popup_msg[1024]; \
-            wsprintf(dbg_popup_msg, __VA_ARGS__); \
-            OutputDebugString(dbg_popup_msg); \
-        }
-    #define SND_WARN(...) \
-        { \
-            WCHAR dbg_popup_msg[1024]; \
-            wsprintf(dbg_popup_msg, __VA_ARGS__); \
-            OutputDebugString(dbg_popup_msg); \
-        }
-    #define SND_TRACE(...) \
-        { \
-            WCHAR dbg_popup_msg[1024]; \
-            wsprintf(dbg_popup_msg, __VA_ARGS__); \
-            OutputDebugString(dbg_popup_msg); \
-        }
-
-    #define SND_ASSERT(condition) \
-        { \
-            if ( ! ( condition ) ) \
-            { \
-                SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
-                POPUP(L"ASSERT FAILED: %hS\n", #condition); \
-                ExitProcess(1); \
-            } \
-        }
-
-    #define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
-        { \
-            PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
-            SND_TRACE(L"-- Current wave header list --\n"); \
-            while ( CurrDumpHdr ) \
-            { \
-                SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
-                          CurrDumpHdr->dwBufferLength, \
-                          CurrDumpHdr->dwFlags); \
-                CurrDumpHdr = CurrDumpHdr->lpNext; \
-            } \
-        }
-
-#else
-    #define SND_ERR(...) do {} while ( 0 )
-    #define SND_WARN(...) do {} while ( 0 )
-    #define SND_TRACE(...) do {} while ( 0 )
-    #define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
-    #define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
-#endif
-
 /*
     Some memory allocation helper macros
 */
diff --git a/reactos/include/reactos/libs/sound/mmebuddy_debug.h b/reactos/include/reactos/libs/sound/mmebuddy_debug.h
new file mode 100644 (file)
index 0000000..1a18d5b
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef ROS_AUDIO_MMEBUDDY_DEBUG_H
+#define ROS_AUDIO_MMEBUDDY_DEBUG_H
+
+/*
+    Hacky debug macro
+*/
+
+#define POPUP(...) \
+    { \
+        WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
+        wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
+        wsprintf(dbg_popup_msg, __VA_ARGS__); \
+        MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
+    }
+
+#ifndef NDEBUG
+    #define SND_ERR(...) \
+        { \
+            WCHAR dbg_popup_msg[1024]; \
+            wsprintf(dbg_popup_msg, __VA_ARGS__); \
+            OutputDebugString(dbg_popup_msg); \
+        }
+    #define SND_WARN(...) \
+        { \
+            WCHAR dbg_popup_msg[1024]; \
+            wsprintf(dbg_popup_msg, __VA_ARGS__); \
+            OutputDebugString(dbg_popup_msg); \
+        }
+    #define SND_TRACE(...) \
+        { \
+            WCHAR dbg_popup_msg[1024]; \
+            wsprintf(dbg_popup_msg, __VA_ARGS__); \
+            OutputDebugString(dbg_popup_msg); \
+        }
+
+    #define SND_ASSERT(condition) \
+        { \
+            if ( ! ( condition ) ) \
+            { \
+                SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
+                POPUP(L"ASSERT FAILED: %hS\n", #condition); \
+                ExitProcess(1); \
+            } \
+        }
+
+    #define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
+        { \
+            PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
+            SND_TRACE(L"-- Current wave header list --\n"); \
+            while ( CurrDumpHdr ) \
+            { \
+                SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
+                          CurrDumpHdr->dwBufferLength, \
+                          CurrDumpHdr->dwFlags); \
+                CurrDumpHdr = CurrDumpHdr->lpNext; \
+            } \
+        }
+
+#else
+    #define SND_ERR(...) do {} while ( 0 )
+    #define SND_WARN(...) do {} while ( 0 )
+    #define SND_TRACE(...) do {} while ( 0 )
+    #define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
+    #define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
+#endif
+
+#endif /* ROS_AUDIO_MMEBUDDY_DEBUG_H */
index 71bde99..66fff2b 100644 (file)
@@ -6,5 +6,6 @@
 #include <mmddk.h>
 #include <sndtypes.h>
 #include <mmebuddy.h>
+#include <mmebuddy_debug.h>
 
 #endif /* _MMEBUDDY_PCH_ */
index d454bea..4dd1b6a 100644 (file)
@@ -13,6 +13,8 @@
 #include <winioctl.h>
 #include <ntddsnd.h>
 
+#include <mmebuddy_debug.h>
+
 /*
     Convenience routine for getting the path of a device and opening it.
 */
index 2daa8b4..1395f1b 100644 (file)
@@ -14,6 +14,7 @@
 #include "precomp.h"
 
 #include <mment4.h>
+#include <mmebuddy_debug.h>
 
 /*
     This is the "nice" way to discover audio devices in NT4 - go into the
index aa6dbea..9a6c175 100644 (file)
@@ -10,6 +10,8 @@
 
 #include "precomp.h"
 
+#include <mmebuddy_debug.h>
+
 /*
     Open the parameters key of a sound driver.
     NT4 only.