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/arch/neon.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/arch/neon.h') diff --git a/src/arch/neon.h b/src/arch/neon.h index 725e589..501b722 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h @@ -59,7 +59,7 @@ popcount_u64(uint64_t x) } STATIC void -pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) +pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) { // First 8 bytes of the corner vector are copied from the c array vst1_u8(c, cube->corner); @@ -244,7 +244,7 @@ coord_co(cube_t c) } STATIC_INLINE void -copy_co(cube_t cube[static 1], cube_t co) +copy_co(cube_t cube[NON_NULL], cube_t co) { uint8x8_t coclean; @@ -340,19 +340,19 @@ coord_esep(cube_t c) } STATIC_INLINE void -copy_corners(cube_t dst[static 1], cube_t src) +copy_corners(cube_t dst[NON_NULL], cube_t src) { dst->corner = src.corner; } STATIC_INLINE void -copy_edges(cube_t dst[static 1], cube_t src) +copy_edges(cube_t dst[NON_NULL], cube_t src) { dst->edge = src.edge; } STATIC_INLINE void -set_eo(cube_t cube[static 1], uint64_t eo) +set_eo(cube_t cube[NON_NULL], uint64_t eo) { // Temp array to store the NEON vector uint8_t mem[16]; -- cgit v1.3