mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-26 14:40:39 +01:00
shared: drop function name from g_return_val_if_reached()
When using g_return_val_if_reached(), the default macro would include the function name. This name is increasing the binary size. Replace it in non-debug builds.
This commit is contained in:
parent
39e7c9e8fd
commit
42940fd66b
1 changed files with 24 additions and 0 deletions
|
|
@ -86,6 +86,30 @@ _nm_g_return_if_fail_warning (const char *log_domain,
|
|||
#define g_assertion_message_expr(domain, file, line, func, expr) \
|
||||
g_assertion_message_expr(domain, file, line, "<unknown-fcn>", (expr) ? "<dropped>" : NULL)
|
||||
|
||||
#undef g_return_val_if_reached
|
||||
#define g_return_val_if_reached(val) \
|
||||
G_STMT_START { \
|
||||
g_log (G_LOG_DOMAIN, \
|
||||
G_LOG_LEVEL_CRITICAL, \
|
||||
"file %s: line %d (%s): should not be reached", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
"<dropped>"); \
|
||||
return (val); \
|
||||
} G_STMT_END
|
||||
|
||||
#undef g_return_if_reached
|
||||
#define g_return_if_reached() \
|
||||
G_STMT_START { \
|
||||
g_log (G_LOG_DOMAIN, \
|
||||
G_LOG_LEVEL_CRITICAL, \
|
||||
"file %s: line %d (%s): should not be reached", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
"<dropped>"); \
|
||||
return; \
|
||||
} G_STMT_END
|
||||
|
||||
#define NM_ASSERT_G_RETURN_EXPR(expr) "<dropped>"
|
||||
#define NM_ASSERT_NO_MSG 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue