From: Alejandro Colomar Date: Sun, 19 Oct 2025 08:10:37 +0000 (+0200) Subject: lib/typetraits.h: QChar_of(): Add macro X-Git-Tag: 4.19.0-rc1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f382a7cfb36417acfeb783664ef7bd828d503599;p=thirdparty%2Fshadow.git lib/typetraits.h: QChar_of(): Add macro This macro is useful to implement QChar versions of functions. See ISO C23 for a description of what QChar is. Signed-off-by: Alejandro Colomar --- diff --git a/lib/typetraits.h b/lib/typetraits.h index ce29a8f32..051edfc66 100644 --- a/lib/typetraits.h +++ b/lib/typetraits.h @@ -54,4 +54,15 @@ ) +#define QChar_of(s) typeof \ +( \ + _Generic(s, \ + const char *: (const char){}, \ + const void *: (const char){}, \ + char *: (char){}, \ + void *: (char){} \ + ) \ +) + + #endif // include guard