Make compile with msvc, clang and gcc on Windows

This commit is contained in:
oltolm 2023-07-11 20:40:30 +02:00 committed by GitHub
parent ed75bab7b2
commit 0c94606fcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 519 additions and 4584 deletions

View file

@ -725,7 +725,7 @@ namespace CRCPP
{
while (size--)
{
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#ifdef _MSC_VER
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
// remainder is one byte long. The algorithm is still correct in this case,
// though it's possible that one additional machine instruction will be executed.
@ -733,7 +733,7 @@ namespace CRCPP
# pragma warning (disable : 4333)
#endif
remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#ifdef _MSC_VER
# pragma warning (pop)
#endif
}