From: Rusty Russell Date: Tue, 22 Mar 2011 04:19:40 +0000 (+1030) Subject: darray: handle case where we don't have typeof. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=16256f55b0f785ef4459b24e261b8228f57bb5b6 darray: handle case where we don't have typeof. Tests don't compile otherwise, so fix that up (ccanlint now tests with reduced features, so this became clear). --- diff --git a/ccan/darray/test/run.c b/ccan/darray/test/run.c index 7212c573..3d96fa56 100644 --- a/ccan/darray/test/run.c +++ b/ccan/darray/test/run.c @@ -238,11 +238,20 @@ int main(void) { { darray(const char*) arr = darray_new(); const char *n[9] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight"}; - + +#if HAVE_TYPEOF darray_appends(arr, n[5], n[6], n[7], n[8]); +#else + darray_appends_t(arr, const char *, n[5], n[6], n[7], n[8]); +#endif ok1(darray_size(arr)==4 && darray_alloc(arr)>=4); - + +#if HAVE_TYPEOF darray_prepends(arr, n[0], n[1], n[2], n[3], n[4]); +#else + darray_prepends_t(arr, const char *, n[0], n[1], n[2], n[3], n[4]); +#endif + ok1(darray_size(arr)==9 && darray_alloc(arr)>=9); ok1(arr.item[0]==n[0] &&