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. --- src/solvers/coord/htr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/solvers/coord/htr.h') diff --git a/src/solvers/coord/htr.h b/src/solvers/coord/htr.h index cfd451b..602625b 100644 --- a/src/solvers/coord/htr.h +++ b/src/solvers/coord/htr.h @@ -4,7 +4,7 @@ STATIC bool coordinate_htr_isnasty(uint64_t, const unsigned char *); STATIC size_t coordinate_htr_gendata(unsigned char *); STATIC bool htr_checkmoves(bool *, uint8_t, const uint8_t *); -STATIC bool htr_solution_prune(const solution_moves_t [static 1]); +STATIC bool htr_solution_prune(const solution_moves_t [NON_NULL]); STATIC bool is_cp_htr(uint64_t, const unsigned char *); STATIC coord_t coordinate_htr = { @@ -97,7 +97,7 @@ htr_checkmoves(bool *f, uint8_t n, const uint8_t *moves) } STATIC bool -htr_solution_prune(const solution_moves_t s[static 1]) +htr_solution_prune(const solution_moves_t s[NON_NULL]) { bool f; -- cgit v1.3