From 1492d885dd75b1d80253e5997fc291aff2c32728 Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Wed, 10 Dec 2025 07:48:02 +0100 Subject: [PATCH] rewrite arr_contains --- cig.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cig.h b/cig.h index 3ae9417..0de7662 100644 --- a/cig.h +++ b/cig.h @@ -177,11 +177,11 @@ bool dyn_array_contains_func(void *this, uint8_t *value); - Pure C99, no extensions needed - Callers with typeof support can make wrapper macros */ -#define arr_contains(THIS, TYPE, VALUE)\ - (\ - STATIC_ASSERT(sizeof(*(THIS)) == sizeof(TYPE)),\ - dyn_array_contains_func((THIS), (uint8_t*)&(TYPE){(VALUE)})\ - ) +#define arr_contains(THIS, ...)\ + (\ + STATIC_ASSERT(sizeof(*(THIS)) == sizeof(*(__VA_ARGS__))),\ + dyn_array_contains_func((THIS), (uint8_t*)(__VA_ARGS__))\ + ) // CLI /////////////////////////////////////////////////////////////////////////