-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding doesn't work when compiled with mingw64 #269
Comments
Thanks for the report. I Will try to reproduce it. On which version of Charls and mingw64 do you see the problem? |
g++
clang
To compile I used My own attempts at using the decoding interface don't work either. (Also just tried WinLibs MinGW-w64 distribution which has the same problem so it's likely not a problem with my mingw64 installation) Forgot to mention the charls version: |
I've bisected the problem to commit 0b3ac70 Hope it helps. |
template<class T>
auto countl_zero(T value) noexcept -> std::enable_if_t<is_uint_v<64, T>, int>
{
return countl_zero(static_cast<uint32_t>(value >> 32));
}
Edit: this works: diff --git a/src/util.h b/src/util.h
index ffae177..215ebd4 100644
--- a/src/util.h
+++ b/src/util.h
@@ -445,7 +445,11 @@ auto countl_zero(T value) noexcept -> std::enable_if_t<is_uint_v<64, T>, int>
if (value == 0)
return 64;
+#ifdef _WIN32
+ return __builtin_clzll(value);
+#else
return __builtin_clzl(value);
+#endif
}
/// <summary> |
commit 36807a0 resolves this problem in the main branch. Intend is to apply this fix to the v2.4.x branch and research if it is possible to add msys2 to the CI pipeline. |
A fix for this defect has been applied to the release/2.x branch and release v2.4.2 is available. |
The CI pipeline has been extended with MSYS2 to ensure that future releases are automatically verified. |
As titled, decoding is broken when compiled with g++ from mingw64, always complaining about invalid encoded data.
Maybe a compiler bug? Not sure what in the myriad of templates triggers it (or something else entirely..)
(clang++ or g++ with ucrt doesn't work either..)
The text was updated successfully, but these errors were encountered: