From 5d5eb6fed5940e130e749d632da916356568fa08 Mon Sep 17 00:00:00 2001 From: evpobr Date: Wed, 17 Feb 2021 15:14:59 +0500 Subject: [PATCH] Fix use of flexible arrays with MSVC Introduced by 0c80547. --- src/common.c | 4 ++++ src/test_broadcast_var.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/common.c b/src/common.c index 90371cb0..e0d25b83 100644 --- a/src/common.c +++ b/src/common.c @@ -1246,7 +1246,11 @@ psf_memset (void *s, int c, sf_count_t len) ** bodgy something up instead. */ +#ifdef _MSC_VER +typedef SF_CUES_VAR (0) SF_CUES_0 ; +#else typedef SF_CUES_VAR () SF_CUES_0 ; +#endif /* calculate size of SF_CUES struct given number of cues */ #define SF_CUES_VAR_SIZE(count) (sizeof (SF_CUES_0) + count * sizeof (SF_CUE_POINT)) diff --git a/src/test_broadcast_var.c b/src/test_broadcast_var.c index e75dc750..5ae81fb1 100644 --- a/src/test_broadcast_var.c +++ b/src/test_broadcast_var.c @@ -89,7 +89,11 @@ test_broadcast_var_set (void) static void test_broadcast_var_zero (void) { SF_PRIVATE sf_private, *psf ; +#ifdef _MSC_VER + SF_BROADCAST_INFO_VAR (0) bi ; +#else SF_BROADCAST_INFO_VAR () bi ; +#endif psf = &sf_private ; memset (psf, 0, sizeof (sf_private)) ;