-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssert.h
More file actions
24 lines (18 loc) · 890 Bytes
/
Assert.h
File metadata and controls
24 lines (18 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef ASSERT_H
#define ASSERT_H
#include <stdio.h>
// #include "./DefineColourConsts.h"
#include "./Constants/ColourConsts.h"
//! @brief Макрос, печатающий сообщение об ошибке в заданном условии, если оно неверно
//! @param[in] condition Проверяемое условие
#ifndef NDEBUG
#define ASSERT(condition) \
{ \
if (!(condition)) \
fprintf(stderr, KRED "Error in \"%s\" in line %d in file \"%s\" in %s\n" KNRM, \
#condition, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
}
#else
#define ASSERT( condition )
#endif
#endif