Merge pull request #15 from delhoume/windows_msvc

g5dec.inl compiles under MSVC
This commit is contained in:
Larry Bank
2025-08-16 11:38:48 +01:00
committed by GitHub
+8
View File
@@ -138,11 +138,19 @@ static void Decode_Begin(G5DECIMAGE *pPage)
pPage->ulBits = TIFFMOTOLONG(pPage->pSrc); // load 32 bits to start
pPage->ulBitOff = 0;
// Calculate the number of bits needed for a long horizontal code
#ifdef __GNUC__
#ifdef __AVR__
pPage->iHLen = 16 - __builtin_clz(pPage->iWidth);
#else
pPage->iHLen = 32 - __builtin_clz(pPage->iWidth);
#endif
#else
#ifdef _MSC_VER
pPage->iHLen = 32 - __lzcnt(pPage->iWidth);
#else
#error "Unsupported compiler for G5 decoder"
#endif // _MSC_VER
#endif
} /* Decode_Begin() */
//
// Decode a single line of G5 data (private function)