Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
assert.hpp File Reference
#include <pulp/platform/detect.hpp>
#include <source_location>
#include <string_view>
#include <cstdio>
#include <cstdlib>
#include <iostream>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::runtime
namespace  pulp::runtime::detail

Macros

#define PULP_ASSERT(expr, msg)
#define PULP_DBG_ASSERT(expr, msg)
#define PULP_DBG_VAR_ONE(x)
#define PULP_DBG_VAR(...)
#define PULP_DBG_VAR_NARGS_(_1, _2, _3, _4, _5, _6, _7, _8, N, ...)
#define PULP_DBG_VAR_NARGS(...)
#define PULP_DBG_VAR_CAT_(a, b)
#define PULP_DBG_VAR_CAT(a, b)
#define PULP_DBG_VAR_EXPAND(...)
#define PULP_DBG_VAR_EXPAND_1(x1)
#define PULP_DBG_VAR_EXPAND_2(x1, x2)
#define PULP_DBG_VAR_EXPAND_3(x1, x2, x3)
#define PULP_DBG_VAR_EXPAND_4(x1, x2, x3, x4)
#define PULP_DBG_VAR_EXPAND_5(x1, x2, x3, x4, x5)
#define PULP_DBG_VAR_EXPAND_6(x1, x2, x3, x4, x5, x6)
#define PULP_DBG_VAR_EXPAND_7(x1, x2, x3, x4, x5, x6, x7)
#define PULP_DBG_VAR_EXPAND_8(x1, x2, x3, x4, x5, x6, x7, x8)

Functions

void pulp::runtime::assert_fail (std::string_view expr, std::string_view msg, std::source_location loc=std::source_location::current())
template<typename T>
void pulp::runtime::detail::dbg_var_one (std::string_view name, const T &value)
void pulp::runtime::detail::dbg_var_emit_prefix (std::source_location loc)
void pulp::runtime::detail::dbg_var_emit_suffix ()

Macro Definition Documentation

◆ PULP_ASSERT

#define PULP_ASSERT ( expr,
msg )
Value:
do { \
if (!(expr)) [[unlikely]] { \
::pulp::runtime::assert_fail(#expr, msg); \
} \
} while (false)

◆ PULP_DBG_ASSERT

#define PULP_DBG_ASSERT ( expr,
msg )
Value:
PULP_ASSERT(expr, msg)
#define PULP_ASSERT(expr, msg)
Definition assert.hpp:53

◆ PULP_DBG_VAR

#define PULP_DBG_VAR ( ...)
Value:
do { \
::pulp::runtime::detail::dbg_var_emit_prefix( \
std::source_location::current()); \
PULP_DBG_VAR_EXPAND(__VA_ARGS__) \
::pulp::runtime::detail::dbg_var_emit_suffix(); \
} while (false)

◆ PULP_DBG_VAR_CAT

#define PULP_DBG_VAR_CAT ( a,
b )
Value:
#define PULP_DBG_VAR_CAT_(a, b)
Definition assert.hpp:105

◆ PULP_DBG_VAR_CAT_

#define PULP_DBG_VAR_CAT_ ( a,
b )
Value:
a##b

◆ PULP_DBG_VAR_EXPAND

#define PULP_DBG_VAR_EXPAND ( ...)
Value:
PULP_DBG_VAR_CAT(PULP_DBG_VAR_EXPAND_, PULP_DBG_VAR_NARGS(__VA_ARGS__))(__VA_ARGS__)
#define PULP_DBG_VAR_CAT(a, b)
Definition assert.hpp:106
#define PULP_DBG_VAR_NARGS(...)
Definition assert.hpp:103

◆ PULP_DBG_VAR_EXPAND_1

#define PULP_DBG_VAR_EXPAND_1 ( x1)
Value:
#define PULP_DBG_VAR_ONE(x)
Definition assert.hpp:87

◆ PULP_DBG_VAR_EXPAND_2

#define PULP_DBG_VAR_EXPAND_2 ( x1,
x2 )

◆ PULP_DBG_VAR_EXPAND_3

#define PULP_DBG_VAR_EXPAND_3 ( x1,
x2,
x3 )

◆ PULP_DBG_VAR_EXPAND_4

#define PULP_DBG_VAR_EXPAND_4 ( x1,
x2,
x3,
x4 )
Value:
PULP_DBG_VAR_ONE(x3); PULP_DBG_VAR_ONE(x4);

◆ PULP_DBG_VAR_EXPAND_5

#define PULP_DBG_VAR_EXPAND_5 ( x1,
x2,
x3,
x4,
x5 )
Value:
#define PULP_DBG_VAR_EXPAND_4(x1, x2, x3, x4)
Definition assert.hpp:113

◆ PULP_DBG_VAR_EXPAND_6

#define PULP_DBG_VAR_EXPAND_6 ( x1,
x2,
x3,
x4,
x5,
x6 )
Value:
PULP_DBG_VAR_EXPAND_4(x1, x2, x3, x4) \
PULP_DBG_VAR_ONE(x5); PULP_DBG_VAR_ONE(x6);

◆ PULP_DBG_VAR_EXPAND_7

#define PULP_DBG_VAR_EXPAND_7 ( x1,
x2,
x3,
x4,
x5,
x6,
x7 )
Value:
PULP_DBG_VAR_EXPAND_4(x1, x2, x3, x4) \
PULP_DBG_VAR_ONE(x5); PULP_DBG_VAR_ONE(x6); PULP_DBG_VAR_ONE(x7);

◆ PULP_DBG_VAR_EXPAND_8

#define PULP_DBG_VAR_EXPAND_8 ( x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8 )
Value:
PULP_DBG_VAR_EXPAND_4(x1, x2, x3, x4) PULP_DBG_VAR_EXPAND_4(x5, x6, x7, x8)

◆ PULP_DBG_VAR_NARGS

#define PULP_DBG_VAR_NARGS ( ...)
Value:
PULP_DBG_VAR_NARGS_(__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1)
#define PULP_DBG_VAR_NARGS_(_1, _2, _3, _4, _5, _6, _7, _8, N,...)
Definition assert.hpp:102

◆ PULP_DBG_VAR_NARGS_

#define PULP_DBG_VAR_NARGS_ ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
N,
... )
Value:
N

◆ PULP_DBG_VAR_ONE

#define PULP_DBG_VAR_ONE ( x)
Value:
void dbg_var_one(std::string_view name, const T &value)
Definition assert.hpp:35