Skip to content

Commit

Permalink
ledger_assert: Fix circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Jan 18, 2024
1 parent bb1971c commit c011078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ledger_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdbool.h>

#ifdef HAVE_PRINTF
#include "os.h"
void assert_print_failed(void);
#endif

#ifdef LEDGER_ASSERT_CONFIG_FILE_INFO
Expand Down Expand Up @@ -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 { \
Expand Down
6 changes: 6 additions & 0 deletions src/ledger_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit c011078

Please sign in to comment.