From fc41f7917531693680b5baf71ffe38c47333fe84 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Apr 2026 15:55:33 +0200 Subject: Make the project build with Microsoft's broken C compiler. MSVC is not fully C11-compliant, even when compiling with /std:c11. Some changes were needed to make the codebase compatible. Notably, the notation a[static N] and a[n] for function parameters of array type is not supported, so that had to be hidden behind a macro. Atomic types are also an experimental feature, apparently, but at least they work with the correct compiler flag. One thing that MSVC does well, however, is warning on integer conversions on /W4 level. I am not sure if Clang and GCC have something similar, so I took this chance to fix some of these. --- tools/tool.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tools/tool.h') diff --git a/tools/tool.h b/tools/tool.h index 96e7f27..582e2ce 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -18,10 +18,9 @@ static void log_stderr(const char *, void *); static double timerun(void (*)(void)); static void writetable(const unsigned char *, int64_t, const char *); -static long long int generatetable(const char *, unsigned char **, - char [static NISSY_SIZE_DATAID]); +static long long int generatetable(const char *, unsigned char **, char *); static int getdata(const char *, unsigned char **, const char *); -static void gendata_run(const char *, uint64_t[static 21]); +static void gendata_run(const char *, uint64_t *); static void log_stderr(const char *str, void *unused) @@ -113,7 +112,7 @@ static long long int generatetable( const char *solver, unsigned char **buf, - char dataid[static NISSY_SIZE_DATAID] + char *dataid ) { long long int size, gensize; @@ -183,7 +182,7 @@ getdata_error_nofree: static void gendata_run( const char *solver, - uint64_t expected[static 21] + uint64_t *expected ) { long long int size; char filename[1024], dataid[NISSY_SIZE_DATAID]; -- cgit v1.3