summaryrefslogtreecommitdiff
path: root/libraries/euler/include/cassert
blob: bc716a06abd6e3ab453143a9ed274655bb30349c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once

namespace euler {
  [[noreturn]] void assert_failed(
    const char *file, const char *function, int line, const char *condition);
}

#ifdef NDEBUG
#define assert(condition) ((void)0)
#else
#define assert(condition) ((condition) ? ((void)0) : \
  euler::assert_failed(__FILE__, __func__, __LINE__, #condition))
#endif