[INCLUDE/REACTOS] Move the debug macros from mmebuddy.h to mmebuddy_debug.h. [SNDBLST][MMENT4][MMEBUDDY] Use mmebuddy_debug.h where needed. [WDMAUD.DRV] Enable PCH again and use mmebuddy_debug.h where needed.

svn path=/trunk/; revision=69888
This commit is contained in:
Amine Khaldi 2015-11-14 16:19:07 +00:00
parent 94a73db543
commit 9086f2a059
12 changed files with 84 additions and 69 deletions

View 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 */

View 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)

View file

@ -13,9 +13,11 @@
*
*/
#define NDEBUG
#include "wdmaud.h"
#define NDEBUG
#include <debug.h>
#include <mmebuddy_debug.h>
#define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud"

View 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;

View 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
{

View file

@ -12,10 +12,11 @@
*
*/
#define NDEBUG
#include "wdmaud.h"
#define NDEBUG
#include <debug.h>
#include <mmebuddy_debug.h>
#ifndef USE_MMIXER_LIB
#define FUNC_NAME(x) x##ByLegacy

View file

@ -20,69 +20,6 @@
#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
*/

View file

@ -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 */

View file

@ -6,5 +6,6 @@
#include <mmddk.h>
#include <sndtypes.h>
#include <mmebuddy.h>
#include <mmebuddy_debug.h>
#endif /* _MMEBUDDY_PCH_ */

View 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.
*/

View 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

View file

@ -10,6 +10,8 @@
#include "precomp.h"
#include <mmebuddy_debug.h>
/*
Open the parameters key of a sound driver.
NT4 only.