diff options
author | Jan Janssen <medhefgo@web.de> | 2022-08-18 13:43:19 +0200 |
---|---|---|
committer | Jan Janssen <medhefgo@web.de> | 2023-01-18 17:47:11 +0100 |
commit | 5a9b91576630f82ca72a932b5195654dbb04d67e (patch) | |
tree | b65f452eb458f8151db3b58c973cb465b47c9219 /src/fundamental | |
parent | 5966c54df4668abc17ae12c40fb0c30d31e80998 (diff) | |
download | systemd-5a9b91576630f82ca72a932b5195654dbb04d67e.tar.gz |
tree-wide: Use __func__ in asserts
clang puts the whole function signature in __PRETTY_FUNCTION__, which is
a bit excessive for something that can already be figured out by using
the line number.
Diffstat (limited to 'src/fundamental')
-rw-r--r-- | src/fundamental/macro-fundamental.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 71c6283e10..b2bc435bd3 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -74,11 +74,11 @@ #define assert(expr) #define assert_not_reached() __builtin_unreachable() #else - #define assert(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); }) - #define assert_not_reached() efi_assert("Code should not be reached", __FILE__, __LINE__, __PRETTY_FUNCTION__) + #define assert(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); }) + #define assert_not_reached() efi_assert("Code should not be reached", __FILE__, __LINE__, __func__) #endif #define static_assert _Static_assert - #define assert_se(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); }) + #define assert_se(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); }) #endif /* This passes the argument through after (if asserts are enabled) checking that it is not null. */ |