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/h48/distribution_h48.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/h48/distribution_h48.h')
| -rw-r--r-- | src/solvers/h48/distribution_h48.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/solvers/h48/distribution_h48.h b/src/solvers/h48/distribution_h48.h index 80c946e..2cb50aa 100644 --- a/src/solvers/h48/distribution_h48.h +++ b/src/solvers/h48/distribution_h48.h | |||
| @@ -6,7 +6,7 @@ to have some duplication than to make these functions needlessly generic. | |||
| 6 | 6 | ||
| 7 | STATIC wrapthread_return_t getdistribution_h48_runthread(void *); | 7 | STATIC wrapthread_return_t getdistribution_h48_runthread(void *); |
| 8 | STATIC void getdistribution_h48(const unsigned char *, | 8 | STATIC void getdistribution_h48(const unsigned char *, |
| 9 | uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]); | 9 | uint64_t [SIZE(INFO_DISTRIBUTION_LEN)], const tableinfo_t [NON_NULL]); |
| 10 | 10 | ||
| 11 | STATIC wrapthread_return_t | 11 | STATIC wrapthread_return_t |
| 12 | getdistribution_h48_runthread(void *arg) | 12 | getdistribution_h48_runthread(void *arg) |
| @@ -39,8 +39,8 @@ getdistribution_h48_runthread(void *arg) | |||
| 39 | STATIC void | 39 | STATIC void |
| 40 | getdistribution_h48( | 40 | getdistribution_h48( |
| 41 | const unsigned char *table, | 41 | const unsigned char *table, |
| 42 | uint64_t distr[static INFO_DISTRIBUTION_LEN], | 42 | uint64_t distr[SIZE(INFO_DISTRIBUTION_LEN)], |
| 43 | const tableinfo_t info[static 1] | 43 | const tableinfo_t info[NON_NULL] |
| 44 | ) { | 44 | ) { |
| 45 | getdistribution_data_t targ[THREADS]; | 45 | getdistribution_data_t targ[THREADS]; |
| 46 | wrapthread_define_var_thread_t(thread[THREADS]); | 46 | wrapthread_define_var_thread_t(thread[THREADS]); |
