summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/array.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/array.c b/src/array.c
index 46d7951..37ae7b4 100644
--- a/src/array.c
+++ b/src/array.c
@@ -74,6 +74,18 @@
} while (0)
#ifdef AL_HAVE_GNU_EXTENSIONS
+#define al_array_contains(array, needle) \
+ ({ \
+ bool contains = false; \
+ for (u32 i = 0; i < (array).count; i++) { \
+ if (al_array_at(array, i) == needle) { \
+ contains = true; \
+ break; \
+ } \
+ } \
+ contains; \
+ })
+
#define al_array_remove(array, elem) \
({ \
bool removed = false; \