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 /src/solvers/coord/utils.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 'src/solvers/coord/utils.h')
| -rw-r--r-- | src/solvers/coord/utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/solvers/coord/utils.h b/src/solvers/coord/utils.h index c8a9338..0062587 100644 --- a/src/solvers/coord/utils.h +++ b/src/solvers/coord/utils.h | |||
| @@ -2,7 +2,7 @@ STATIC coord_t *parse_coord(size_t, const char *); | |||
| 2 | STATIC multicoord_t *parse_multicoord(size_t, const char *); | 2 | STATIC multicoord_t *parse_multicoord(size_t, const char *); |
| 3 | STATIC void parse_coord_and_trans( | 3 | STATIC void parse_coord_and_trans( |
| 4 | const char *, coord_t **, multicoord_t **, uint8_t *); | 4 | const char *, coord_t **, multicoord_t **, uint8_t *); |
| 5 | STATIC long long dataid_coord(const char *, char [static NISSY_SIZE_DATAID]); | 5 | STATIC long long dataid_coord(const char *, char [SIZE(NISSY_SIZE_DATAID)]); |
| 6 | 6 | ||
| 7 | STATIC coord_t * | 7 | STATIC coord_t * |
| 8 | parse_coord(size_t n, const char *coord) | 8 | parse_coord(size_t n, const char *coord) |
| @@ -60,7 +60,7 @@ parse_coord_and_trans( | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | STATIC long long | 62 | STATIC long long |
| 63 | dataid_coord(const char *ca, char dataid[static NISSY_SIZE_DATAID]) | 63 | dataid_coord(const char *ca, char dataid[SIZE(NISSY_SIZE_DATAID)]) |
| 64 | { | 64 | { |
| 65 | coord_t *c; | 65 | coord_t *c; |
| 66 | multicoord_t *mc; | 66 | multicoord_t *mc; |
