From ef4eae17c4ab3aee659efbdb398ecc963183313d Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Mon, 23 Jun 2008 16:31:24 +0200 Subject: [PATCH] Split DO_ARRAY in two parts. --- common/array.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/array.h b/common/array.h index 54873174..a8462654 100644 --- a/common/array.h +++ b/common/array.h @@ -25,12 +25,13 @@ #include #include "common/util.h" -#define DO_ARRAY(type_t, pfx, dtor) \ +#define ARRAY_TYPE(type_t, pfx) \ typedef struct pfx##_array_t { \ type_t *tab; \ int len, size; \ - } pfx##_array_t; \ - \ + } pfx##_array_t + +#define ARRAY_FUNCS(type_t, pfx, dtor) \ static inline pfx##_array_t * pfx##_array_new(void) { \ return p_new(pfx##_array_t, 1); \ } \ @@ -79,5 +80,8 @@ pfx##_array_splice(arr, arr->len, 0, &e, 1); \ } +#define DO_ARRAY(type_t, pfx, dtor) \ + ARRAY_TYPE(type_t, pfx); ARRAY_FUNCS(type_t, pfx, dtor) + #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80