lib/must_be.h: is_same_type(): Add macro

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-01-22 22:43:40 +01:00
committed by Iker Pedrosa
parent 9c5e433a3a
commit 4ef08548cc
+2 -1
View File
@@ -90,7 +90,8 @@
*/
#define is_same_typeof(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
#define is_same_type(a, b) __builtin_types_compatible_p(a, b)
#define is_same_typeof(a, b) is_same_type(typeof(a), typeof(b))
#define is_array(a) (!is_same_typeof((a), &(a)[0]))
#define must_be_array(a) must_be(is_array(a))