check.h 550 B

12345678910111213141516171819202122232425
  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("furi_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. /** Halt system */
  16. void furi_halt(const char* message);
  17. #ifdef __cplusplus
  18. }
  19. #endif