diff --git a/lib/utils.h b/lib/utils.h index 681886b26d77..22b511c90c83 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -361,6 +361,10 @@ namespace cppcheck } } -#define empty_if_null(p) p ? p : "" +template +static inline T* empty_if_null(T* p) +{ + return p ? p : ""; +} #endif