summaryrefslogtreecommitdiffstats
path: root/src/lisiblestd/assert.h
blob: 9bd751460a72025138cca41c9a15a07472b77b57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef LSTD_ASSERT_H
#define LSTD_ASSERT_H

#include "log.h"

extern void exit(int);

#define LSTD_ASSERT(expr)                                                      \
  do {                                                                         \
    if (!(expr)) {                                                             \
      LOG("Assertion failed:\n\t%s", #expr);                                   \
      exit(1);                                                                 \
    }                                                                          \
  } while (0)

#define LSTD_UNIMPLEMENTED()                                                   \
  do {                                                                         \
    LOG0("Unimplemented code reached");                                        \
    exit(1);                                                                   \
  } while (0)

#endif // LSTD_ASSERT_H
Go back to lisible.xyz