DATAMATRIX/DBAR_LTD: some hacks to get around MSVC 2015/2019 x64 optimizer bugs

This commit is contained in:
gitlost 2021-06-27 15:58:27 +01:00
parent 52c00e59ba
commit 8c419ab4fb
3 changed files with 49 additions and 41 deletions

View file

@ -754,6 +754,9 @@ INTERNAL int rsslimited_cc(struct zint_symbol *symbol, unsigned char source[], i
checksum = 0;
/* Calculate the checksum */
for (i = 0; i < 14; i++) {
#if _MSC_VER == 1900 && defined(_WIN64) /* MSVC 2015 x64 */
checksum %= 89; /* Hack to get around optimizer bug */
#endif
checksum += checksum_weight_ltd[i] * left_widths[i];
checksum += checksum_weight_ltd[i + 14] * right_widths[i];
}