mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 12:59:44 +00:00
[SOUND] mmebuddy_debug.h: Sort out macro inclusions
- POPUP() is used on DBG only.
- SND_ERR() and SND_ASSERT() are wanted even when defined(NDEBUG).
- Add a FIXME as !defined(NDEBUG) code compilation remains broken.
Follow-up of c7a4984
(0.4.15-dev-8414).
This commit is contained in:
parent
82a45262bf
commit
b30fde3797
1 changed files with 39 additions and 24 deletions
|
@ -5,6 +5,10 @@
|
||||||
Hacky debug macro
|
Hacky debug macro
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// FIXME: sdk\lib\...\mmebuddy compilation would fail: wsprintf() and MessageBox() are undefined!
|
||||||
|
#if DBG && !defined(NDEBUG) // #if DBG
|
||||||
|
|
||||||
|
// Helper for SND_ASSERT().
|
||||||
#define POPUP(...) \
|
#define POPUP(...) \
|
||||||
{ \
|
{ \
|
||||||
WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
|
WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
|
||||||
|
@ -13,25 +17,12 @@
|
||||||
MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
|
MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DBG && !defined(NDEBUG)
|
|
||||||
#define SND_ERR(...) \
|
#define SND_ERR(...) \
|
||||||
{ \
|
{ \
|
||||||
WCHAR dbg_popup_msg[1024]; \
|
WCHAR dbg_popup_msg[1024]; \
|
||||||
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
wsprintf(dbg_popup_msg, __VA_ARGS__); \
|
||||||
OutputDebugString(dbg_popup_msg); \
|
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) \
|
#define SND_ASSERT(condition) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -43,6 +34,29 @@
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // DBG
|
||||||
|
|
||||||
|
#define SND_ERR(...) do {} while ( 0 )
|
||||||
|
#define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
|
||||||
|
|
||||||
|
#endif // DBG
|
||||||
|
|
||||||
|
#if DBG && !defined(NDEBUG)
|
||||||
|
|
||||||
|
#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 DUMP_WAVEHDR_QUEUE(sound_device_instance) \
|
#define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
|
||||||
{ \
|
{ \
|
||||||
PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
|
PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
|
||||||
|
@ -55,12 +69,13 @@
|
||||||
CurrDumpHdr = CurrDumpHdr->lpNext; \
|
CurrDumpHdr = CurrDumpHdr->lpNext; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define SND_ERR(...) do {} while ( 0 )
|
#else // DBG && !defined(NDEBUG)
|
||||||
|
|
||||||
#define SND_WARN(...) do {} while ( 0 )
|
#define SND_WARN(...) do {} while ( 0 )
|
||||||
#define SND_TRACE(...) 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 )
|
#define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
|
||||||
#endif
|
|
||||||
|
#endif // DBG && !defined(NDEBUG)
|
||||||
|
|
||||||
#endif /* ROS_AUDIO_MMEBUDDY_DEBUG_H */
|
#endif /* ROS_AUDIO_MMEBUDDY_DEBUG_H */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue