summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-03-22 14:49:40 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-03-22 14:49:40 +1030
commit16256f55b0f785ef4459b24e261b8228f57bb5b6 (patch)
tree8b8c9e4b32fcd5ec3044c6041638b0d44970664b
parentb2e751d04e590c49de02ceb56a7cafe877762b0e (diff)
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).
-rw-r--r--ccan/darray/test/run.c13
1 files changed, 11 insertions, 2 deletions
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] &&