GCS  0.2.3
gu_assert.hpp
1 // Copyright (C) 2009 Codership Oy <info@codership.com>
2 
9 #ifndef _gu_assert_hpp_
10 #define _gu_assert_hpp_
11 
12 #ifndef DEBUG_ASSERT
13 #include <cassert>
14 #else
15 
16 #include <unistd.h>
17 #undef assert
18 #include "gu_logger.hpp"
19 
21 #define assert(expr) \
22  if (!(expr)) { \
23  log_fatal << "Assertion (" << __STRING(expr) << ") failed"; \
24  while(1) sleep(1); \
25  }
26 
27 #endif /* DEBUG_ASSERT */
28 
29 #endif /* _gu_assert_hpp_ */