summaryrefslogtreecommitdiff
path: root/src/macros.h
blob: 4556a099bb0a64f659906676c8bff72f4fa4551d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#define PRINT_ATOM_FIELD(object, field) \
    debug.nospace() << "\t" << #field << ": " << object.field << Qt::endl

#define VERIFY_RETURN_VAL(cond, val) \
    if (!cond) { \
        return val; \
    }

#define VERIFY_CRIT_RETURN(cond) \
    if (Q_UNLIKELY(!cond)) { \
        qCritical() << #cond " == false"; \
        return; \
    }

#define VERIFY_CRIT_RETURN_VAL(cond, val) \
    if (Q_UNLIKELY(!cond)) { \
        qCritical() << #cond " == false"; \
        return val; \
    }

#define VERIFY_CONTINUE(cond) \
    if (!cond) { \
        continue; \
    }