aboutsummaryrefslogtreecommitdiff
path: root/lib/cbit/vec.h
diff options
context:
space:
mode:
authorcomex2015-08-07 17:17:01 -0400
committercomex2015-08-07 17:17:01 -0400
commit76f0f9a281bb0b01ad3cbbc96d998af58b7dace3 (patch)
treef2ff9ec8405427342be6e29d62be662e77e5e620 /lib/cbit/vec.h
parentfix vec.h bug (diff)
downloadsubstitute-76f0f9a281bb0b01ad3cbbc96d998af58b7dace3.tar.gz
add VEC_STORAGE_INIT_STATIC to match the HTAB one
Diffstat (limited to 'lib/cbit/vec.h')
-rw-r--r--lib/cbit/vec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/cbit/vec.h b/lib/cbit/vec.h
index cbefc0c..c291b41 100644
--- a/lib/cbit/vec.h
+++ b/lib/cbit/vec.h
@@ -120,6 +120,11 @@ void vec_realloc_internal_as_necessary(struct vec_internal *vi,
v->els = v->storage; \
} while (0)
+#define VEC_STORAGE_INIT_STATIC(vs, name) \
+ {{0, \
+ (sizeof((vs)->rest) / sizeof((vs)->rest[0])) + 1, \
+ (vs)->v.storage \
+ }}
/* guaranteed to *not* cache vec->length - pretty simple */