diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 15:55:33 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-06 15:55:33 +0200 |
| commit | fc41f7917531693680b5baf71ffe38c47333fe84 (patch) | |
| tree | a6e62232e05e7779034c5f9d1bf743b6f1c198e3 /test/test.h | |
| parent | fe534f1497da6447153064d7bba00243000f803b (diff) | |
| download | nissy-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 'test/test.h')
| -rw-r--r-- | test/test.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test.h b/test/test.h index 60e340f..b8c5922 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
| 8 | #include <string.h> | 8 | #include <string.h> |
| 9 | 9 | ||
| 10 | #include "../src/utils/compilers.h" | ||
| 10 | #include "../src/utils/wrapthread.h" | 11 | #include "../src/utils/wrapthread.h" |
| 11 | #include "../src/nissy.h" | 12 | #include "../src/nissy.h" |
| 12 | #include "../src/arch/arch.h" | 13 | #include "../src/arch/arch.h" |
| @@ -27,7 +28,7 @@ bool isconsistent(oriented_cube_t); | |||
| 27 | bool issolvable(oriented_cube_t); | 28 | bool issolvable(oriented_cube_t); |
| 28 | bool issolved(oriented_cube_t); | 29 | bool issolved(oriented_cube_t); |
| 29 | oriented_cube_t readcube(char *); | 30 | oriented_cube_t readcube(char *); |
| 30 | int64_t writecube(oriented_cube_t, size_t n, char [n]); | 31 | int64_t writecube(oriented_cube_t, size_t n, char *); |
| 31 | 32 | ||
| 32 | /* Test function to be implemented by all tests */ | 33 | /* Test function to be implemented by all tests */ |
| 33 | void run(void); | 34 | void run(void); |
