Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang_assert.hpp
Go to the documentation of this file.
1#ifndef FANG_ROBOTICS_MCB_WRAP_TRAP_SYSTEM_FANG_ASSERT_HPP
2#define FANG_ROBOTICS_MCB_WRAP_TRAP_SYSTEM_FANG_ASSERT_HPP
3#include "modm/architecture/interface/assert.hpp"
4#include <string>
5#include <cassert>
6
7#ifndef NDEBUG
16 #ifndef PLATFORM_HOSTED
24 #define FANG_ASSERT(CONDITION, DESC) \
25 { \
26 const std::string FANG_ASSERT_FILE{__FILE__}; \
27 const std::string FANG_ASSERT_LINE{"Line " + std::to_string(__LINE__)}; \
28 const std::string DESCRIPTION \
29 { \
30 FANG_ASSERT_FILE + \
31 " : " + FANG_ASSERT_LINE + \
32 " : " + DESC \
33 }; \
34 modm_assert(CONDITION, "Danger! Danger!", DESCRIPTION.c_str()); \
35 }
36 #else
44 #define FANG_ASSERT(CONDITION, DESC) \
45 { \
46 assert(CONDITION && DESC); \
47 }
48 #endif
49 #endif
50#endif