From 8cb56e6c55117cd420764244a75ecb29ba603d7b Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Fri, 4 Jan 2019 21:58:11 +0000 Subject: [PATCH] Windows: refactor const int into a macro Conts aren't constant on Windows - MSVC doesn't support C99. --- test/contour.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/contour.c b/test/contour.c index ad113882c..ea7bddd24 100644 --- a/test/contour.c +++ b/test/contour.c @@ -11,15 +11,16 @@ #include "magics_api.h" #include +#define NUM_FORMATS 3 + int main() { mag_open(); - const int num_formats = 3; - const char *formats[num_formats]; + const char *formats[NUM_FORMATS]; formats[0] = "ps"; formats[1] = "png"; formats[2] = "pdf"; - mag_set1c("output_formats",formats,num_formats); + mag_set1c("output_formats",formats,NUM_FORMATS); mag_setc("output_name","contour"); // which is different each time /* load the data */