Fix all Debug.h block macros everywhere

This commit is contained in:
Jean Pierre Cimalando 2020-03-15 11:08:55 +01:00
parent 61314db79d
commit 381b960252
2 changed files with 19 additions and 17 deletions

View file

@ -85,7 +85,7 @@ public:
*/
iterator channelWriter(size_t channelIndex)
{
ASSERT(channelIndex < numChannels)
ASSERT(channelIndex < numChannels);
if (channelIndex < numChannels)
return buffers[channelIndex]->data();
@ -100,7 +100,7 @@ public:
*/
iterator channelWriterEnd(size_t channelIndex)
{
ASSERT(channelIndex < numChannels)
ASSERT(channelIndex < numChannels);
if (channelIndex < numChannels)
return buffers[channelIndex]->end();
@ -115,7 +115,7 @@ public:
*/
const_iterator channelReader(size_t channelIndex) const
{
ASSERT(channelIndex < numChannels)
ASSERT(channelIndex < numChannels);
if (channelIndex < numChannels)
return buffers[channelIndex]->data();
@ -130,7 +130,7 @@ public:
*/
const_iterator channelReaderEnd(size_t channelIndex) const
{
ASSERT(channelIndex < numChannels)
ASSERT(channelIndex < numChannels);
if (channelIndex < numChannels)
return buffers[channelIndex]->end();
@ -145,7 +145,7 @@ public:
*/
absl::Span<value_type> getSpan(size_t channelIndex) const
{
ASSERT(channelIndex < numChannels)
ASSERT(channelIndex < numChannels);
if (channelIndex < numChannels)
return { buffers[channelIndex]->data(), buffers[channelIndex]->size() };

View file

@ -14,16 +14,16 @@
// Break in source code
#if (__x86_64__ || __i386__)
#define ASSERTFALSE \
{ \
do { \
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__asm__("int3"); \
}
} while (0)
#elif (__arm__ || __aarch64__)
#define ASSERTFALSE \
{ \
do { \
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__builtin_trap(); \
}
} while (0)
#endif
#elif (_WIN32 || _WIN64)
@ -31,26 +31,28 @@
#pragma intrinsic(__debugbreak)
#endif
#define ASSERTFALSE \
{ \
do { \
std::cerr << "Assert failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
__debugbreak(); \
}
} while (0)
#else
#define ASSERTFALSE
#define ASSERTFALSE do {} while (0)
#endif
// Assert stuff
#define ASSERT(expression) \
if (!(expression)) \
ASSERTFALSE
do { \
if (!(expression)) \
ASSERTFALSE \
while (0)
// Debug message
#define DBG(ostream) do { std::cerr << ostream << '\n'; } while (0)
#else // NDEBUG
#define ASSERTFALSE
#define ASSERT(expression)
#define DBG(ostream)
#define ASSERTFALSE do {} while (0)
#define ASSERT(expression) do {} while (0)
#define DBG(ostream) do {} while (0)
#endif