diff --git a/include/ledger_assert.h b/include/ledger_assert.h index 8141314b4..776c30c69 100644 --- a/include/ledger_assert.h +++ b/include/ledger_assert.h @@ -3,7 +3,7 @@ #include #ifdef HAVE_PRINTF -#include "os.h" +void assert_print_failed(void); #endif #ifdef LEDGER_ASSERT_CONFIG_FILE_INFO @@ -97,7 +97,7 @@ void assert_print_file_info(const char *file, int line); ASSERT_DISPLAY_LR_AND_PC(_lr_address, _pc_address); \ } while (0) #elif defined(HAVE_PRINTF) -#define LEDGER_ASSERT_LR_AND_PC() PRINTF("LEDGER_ASSERT FAILED\n") +#define LEDGER_ASSERT_LR_AND_PC() assert_print_failed() #else #define LEDGER_ASSERT_LR_AND_PC() \ do { \ diff --git a/src/ledger_assert.c b/src/ledger_assert.c index d39b76811..6f0066fbd 100644 --- a/src/ledger_assert.c +++ b/src/ledger_assert.c @@ -35,6 +35,12 @@ static char assert_buffer[ASSERT_BUFFER_LEN]; #endif +#if defined(HAVE_PRINTF) +void assert_print_failed(void) { + PRINTF("LEDGER_ASSERT FAILED\n"); +} +#endif + #if defined(HAVE_LEDGER_ASSERT_DISPLAY) && defined(LEDGER_ASSERT_CONFIG_LR_AND_PC_INFO) void assert_display_lr_and_pc(int lr, int pc) {