From 6ff504ceb41be4c003b66d83078ac8e93821594b Mon Sep 17 00:00:00 2001 From: Henrik Persson Date: Tue, 1 Feb 2022 09:25:33 +0100 Subject: [PATCH] Use MBED_FILENAME instead of __FILE__ in MBED_ASSERT To actually get the filename in the error reporting struct instead of the start of the path, let's use the MBED_FILENAME macro that MBED_ERROR et al uses. --- platform/include/platform/mbed_assert.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/include/platform/mbed_assert.h b/platform/include/platform/mbed_assert.h index c5ec5702b8..34ee1587d0 100644 --- a/platform/include/platform/mbed_assert.h +++ b/platform/include/platform/mbed_assert.h @@ -66,7 +66,7 @@ MBED_NORETURN void mbed_assert_internal(const char *expr, const char *file, int #define MBED_ASSERT(expr) \ do { \ if (!(expr)) { \ - mbed_assert_internal(#expr, __FILE__, __LINE__); \ + mbed_assert_internal(#expr, MBED_FILENAME, __LINE__); \ } \ } while (0) #endif