CspotAssert.h 1.0 KB

12345678910111213141516
  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. { \
  8. if (!(CONDITION)) \
  9. { \
  10. printf("At %s in %s:%d\n Assertion %s failed: %s", __func__, __FILE__, __LINE__, #CONDITION, MESSAGE); \
  11. abort(); \
  12. } \
  13. } while (0)
  14. #endif