From ce8785f0a92426cc2039a00e9fc8699b5e7d3ce1 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 8 Aug 2020 06:26:28 +0200 Subject: wstring: add helper is_wchar_type() Like is_byte_type() but for wide chars. Signed-off-by: Luc Van Oostenryck --- symbol.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/symbol.h b/symbol.h index 8e7a2860..0e15f7bf 100644 --- a/symbol.h +++ b/symbol.h @@ -430,6 +430,13 @@ static inline int is_byte_type(struct symbol *type) return type->bit_size == bits_in_char && type->type != SYM_BITFIELD; } +static inline int is_wchar_type(struct symbol *type) +{ + if (type->type == SYM_NODE) + type = type->ctype.base_type; + return type == wchar_ctype; +} + static inline int is_void_type(struct symbol *type) { if (type->type == SYM_NODE) -- cgit 1.2.3-korg