CspotAssert.h 667 B

123456789101112131415
  1. #ifndef CSPOT_ASSERT_H
  2. #define CSPOT_ASSERT_H
  3. #include <stdio.h>
  4. #include <cassert>
  5. #define CSPOT_ASSERT(CONDITION, MESSAGE) \
  6. do { \
  7. if (!(CONDITION)) { \
  8. printf("At %s in %s:%d\n Assertion %s failed: %s", __func__, __FILE__, \
  9. __LINE__, #CONDITION, MESSAGE); \
  10. abort(); \
  11. } \
  12. } while (0)
  13. #endif