Fix all Debug.h block macros everywhere
This commit is contained in:
parent
61314db79d
commit
381b960252
2 changed files with 19 additions and 17 deletions
|
|
@ -85,7 +85,7 @@ public:
|
||||||
*/
|
*/
|
||||||
iterator channelWriter(size_t channelIndex)
|
iterator channelWriter(size_t channelIndex)
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels)
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
return buffers[channelIndex]->data();
|
return buffers[channelIndex]->data();
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ public:
|
||||||
*/
|
*/
|
||||||
iterator channelWriterEnd(size_t channelIndex)
|
iterator channelWriterEnd(size_t channelIndex)
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels)
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
return buffers[channelIndex]->end();
|
return buffers[channelIndex]->end();
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ public:
|
||||||
*/
|
*/
|
||||||
const_iterator channelReader(size_t channelIndex) const
|
const_iterator channelReader(size_t channelIndex) const
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels)
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
return buffers[channelIndex]->data();
|
return buffers[channelIndex]->data();
|
||||||
|
|
||||||
|
|
@ -130,7 +130,7 @@ public:
|
||||||
*/
|
*/
|
||||||
const_iterator channelReaderEnd(size_t channelIndex) const
|
const_iterator channelReaderEnd(size_t channelIndex) const
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels)
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
return buffers[channelIndex]->end();
|
return buffers[channelIndex]->end();
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ public:
|
||||||
*/
|
*/
|
||||||
absl::Span<value_type> getSpan(size_t channelIndex) const
|
absl::Span<value_type> getSpan(size_t channelIndex) const
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels)
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
return { buffers[channelIndex]->data(), buffers[channelIndex]->size() };
|
return { buffers[channelIndex]->data(), buffers[channelIndex]->size() };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,16 @@
|
||||||
// Break in source code
|
// Break in source code
|
||||||
#if (__x86_64__ || __i386__)
|
#if (__x86_64__ || __i386__)
|
||||||
#define ASSERTFALSE \
|
#define ASSERTFALSE \
|
||||||
{ \
|
do { \
|
||||||
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
||||||
__asm__("int3"); \
|
__asm__("int3"); \
|
||||||
}
|
} while (0)
|
||||||
#elif (__arm__ || __aarch64__)
|
#elif (__arm__ || __aarch64__)
|
||||||
#define ASSERTFALSE \
|
#define ASSERTFALSE \
|
||||||
{ \
|
do { \
|
||||||
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
||||||
__builtin_trap(); \
|
__builtin_trap(); \
|
||||||
}
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif (_WIN32 || _WIN64)
|
#elif (_WIN32 || _WIN64)
|
||||||
|
|
@ -31,26 +31,28 @@
|
||||||
#pragma intrinsic(__debugbreak)
|
#pragma intrinsic(__debugbreak)
|
||||||
#endif
|
#endif
|
||||||
#define ASSERTFALSE \
|
#define ASSERTFALSE \
|
||||||
{ \
|
do { \
|
||||||
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
||||||
__debugbreak(); \
|
__debugbreak(); \
|
||||||
}
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define ASSERTFALSE
|
#define ASSERTFALSE do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Assert stuff
|
// Assert stuff
|
||||||
#define ASSERT(expression) \
|
#define ASSERT(expression) \
|
||||||
|
do { \
|
||||||
if (!(expression)) \
|
if (!(expression)) \
|
||||||
ASSERTFALSE
|
ASSERTFALSE \
|
||||||
|
while (0)
|
||||||
|
|
||||||
// Debug message
|
// Debug message
|
||||||
#define DBG(ostream) do { std::cerr << ostream << '\n'; } while (0)
|
#define DBG(ostream) do { std::cerr << ostream << '\n'; } while (0)
|
||||||
|
|
||||||
#else // NDEBUG
|
#else // NDEBUG
|
||||||
|
|
||||||
#define ASSERTFALSE
|
#define ASSERTFALSE do {} while (0)
|
||||||
#define ASSERT(expression)
|
#define ASSERT(expression) do {} while (0)
|
||||||
#define DBG(ostream)
|
#define DBG(ostream) do {} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue