check.h 493 B

12345678910111213141516171819202122
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. /** Check condition and crash if check failed */
  6. #define furi_check(__e) ((__e) ? (void)0 : furi_crash("fury_check failed\r\n"))
  7. /** Only in debug build: Assert condition and crash if assert failed */
  8. #ifdef FURI_DEBUG
  9. #define furi_assert(__e) ((__e) ? (void)0 : furi_crash("furi_assert failed\r\n"))
  10. #else
  11. #define furi_assert(__e) ((void)0)
  12. #endif
  13. /** Crash system */
  14. void furi_crash(const char* message);
  15. #ifdef __cplusplus
  16. }
  17. #endif