From 311a0fd1f00368303a82c7502803cc8c2cd1c8a4 Mon Sep 17 00:00:00 2001 From: Thomas Flueeli Date: Wed, 27 Oct 2010 17:16:20 +0200 Subject: [PATCH 2/2] allocate features dynamically This fixes the following errors on MSVC9: base-client.c(2399) : error C2057: expected constant expression base-client.c(2399) : error C2466: cannot allocate an array of constant size 0 base-client.c(2399) : error C2133: 'features' : unknown size --- telepathy-glib/base-client.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c index 2e91b6f..8e127a3 100644 --- a/telepathy-glib/base-client.c +++ b/telepathy-glib/base-client.c @@ -2394,9 +2394,9 @@ varargs_helper (TpBaseClient *self, for (f = feature; f != 0; f = va_arg (ap, GQuark)) n++; - /* block to provide a scope for @features on the stack */ + /* block to provide a scope for @features */ { - GQuark features[n]; + GQuark *features = malloc(n*sizeof(GQuark)); n = 0; @@ -2404,6 +2404,8 @@ varargs_helper (TpBaseClient *self, features[n++] = f; method (self, features, n); + + free(features); } } -- 1.7.2.3