1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 12:02:15 +03:00
kakoune/src/assert.hh
2013-04-09 20:04:11 +02:00

26 lines
492 B
C++

#ifndef assert_hh_INCLUDED
#define assert_hh_INCLUDED
namespace Kakoune
{
void on_assert_failed(const char* message);
}
#define STRINGIFY(X) #X
#define TOSTRING(X) STRINGIFY(X)
#define COMMA ,
#ifdef KAK_DEBUG
#define kak_assert(condition) \
if (not (condition)) \
on_assert_failed("assert failed \"" #condition \
"\" at " __FILE__ ":" TOSTRING(__LINE__))
#else
#define kak_assert(condition)
#endif
#endif // assert_hh_INCLUDED