aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/dispatch.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
commitfc41f7917531693680b5baf71ffe38c47333fe84 (patch)
treea6e62232e05e7779034c5f9d1bf743b6f1c198e3 /src/solvers/dispatch.h
parentfe534f1497da6447153064d7bba00243000f803b (diff)
downloadnissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.tar.gz
nissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.zip
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.
Diffstat (limited to 'src/solvers/dispatch.h')
-rw-r--r--src/solvers/dispatch.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/solvers/dispatch.h b/src/solvers/dispatch.h
index 3184a28..810247f 100644
--- a/src/solvers/dispatch.h
+++ b/src/solvers/dispatch.h
@@ -1,7 +1,7 @@
1typedef struct { 1typedef struct {
2 const char *solvername; 2 const char *solvername;
3 const char *prefix; 3 const char *prefix;
4 long long (*dataid)(const char *, char [static NISSY_SIZE_DATAID]); 4 long long (*dataid)(const char *, char [SIZE(NISSY_SIZE_DATAID)]);
5 long long (*gendata)( 5 long long (*gendata)(
6 const char *, unsigned long long, unsigned char *); 6 const char *, unsigned long long, unsigned char *);
7 long long (*checkdata)( 7 long long (*checkdata)(
@@ -9,7 +9,7 @@ typedef struct {
9 long long (*solve)(oriented_cube_t, const char *, unsigned, unsigned, 9 long long (*solve)(oriented_cube_t, const char *, unsigned, unsigned,
10 unsigned, unsigned, unsigned, unsigned, unsigned long long, 10 unsigned, unsigned, unsigned, unsigned, unsigned long long,
11 const unsigned char *, unsigned, char *, 11 const unsigned char *, unsigned, char *,
12 long long [static NISSY_SIZE_SOLVE_STATS], 12 long long [SIZE(NISSY_SIZE_SOLVE_STATS)],
13 int (*)(void *), void *); 13 int (*)(void *), void *);
14} solver_dispatch_t; 14} solver_dispatch_t;
15 15

Generated with cgit - Back to sebastiano.tronto.net