2011-09-09 21:24:18 +02:00
|
|
|
#ifndef assert_hh_INCLUDED
|
|
|
|
#define assert_hh_INCLUDED
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2012-10-17 17:01:08 +02:00
|
|
|
void on_assert_failed(const char* message);
|
2012-10-16 16:16:32 +02:00
|
|
|
|
2011-09-09 21:24:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#define STRINGIFY(X) #X
|
|
|
|
#define TOSTRING(X) STRINGIFY(X)
|
2012-03-25 22:15:54 +02:00
|
|
|
#define COMMA ,
|
2011-09-09 21:24:18 +02:00
|
|
|
|
2013-02-27 19:02:01 +01:00
|
|
|
#ifdef KAK_DEBUG
|
2013-04-09 20:04:11 +02:00
|
|
|
#define kak_assert(condition) \
|
2013-02-27 19:02:01 +01:00
|
|
|
if (not (condition)) \
|
|
|
|
on_assert_failed("assert failed \"" #condition \
|
|
|
|
"\" at " __FILE__ ":" TOSTRING(__LINE__))
|
|
|
|
#else
|
2013-04-09 20:04:11 +02:00
|
|
|
#define kak_assert(condition)
|
2013-02-27 19:02:01 +01:00
|
|
|
#endif
|
|
|
|
|
2011-09-09 21:24:18 +02:00
|
|
|
|
|
|
|
#endif // assert_hh_INCLUDED
|