-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Added define C++20 #1418
Added define C++20 #1418
Conversation
I use C++17. VVENC and X265 aren't optimized for C++20.
The project is c++20, see top level CMake configuration. You can build dependencies with other build chains though. |
I know that. This is for those who build in static gcc. Then there will be no this function. |
It looks like this will break decoding on big endian machines - it'll silently produce corrupted results. |
This is true, but I am not able to convert std::edian to c++17. |
What is the real problem with C++-20? What doesn't work in vvenc or x265? You say "not optimised", but I'm not sure why standards compatibility would affect optimisation. If it does, can you build those with different build chains and just use a linker option? |
For GNUC 11.5.0/15.0.0 in C++20 I only enabled some -Wxxx warnings. It should be -Wextra -Wall. They fixed lot in X265 after complaints but there's always something.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how changing a C++ file here fixes compilation problems in x265.
Warming for vvenc. In theory for c/c++23 and older everything should work.
Compatible with MSVC only
If the user went too far and used ffmpeg c/c++23 with lcevc |
As was said before, just build libheif with C++20 and anything else with C++17 or C++98 or Rust or whatever it needs. There's absolutely no reason you must to build every dependency with the same toolchain. |
Interesting. Only from what I understand how to combine .dll files of different codecs in different c/c++ languages in gcc? It's not possible in static. https://stackoverflow.com/questions/63491270/is-it-possible-to-compile-a-project-with-two-different-language-standards |
Why not? Build each dependency individually/separately as static with their own C++ standard level and link them to libheif statically. The only problem could arise if the API itself of some library uses some specific C++level features... |
You're afraid of something that doesn't apply here. The biggest blocker in mixing compilers is allocating memory in a library and freeing it outside the library, or vice versa, or in using standard library components allocated in one in the other. This is incredibly bad form and is very rarely seen in any kind of modern code, for this exact reason. (You normally even get away with that if it's the same compiler just targeting different standards.) libheif communicates with its libraries entirely through a C interface, so no C++ features can cross without absurd efforts, and the libraries are all reasonable enough to own their own memory. Private data structures don't get passed around willy-nilly, mostly only the raw decoded data pointers. So it's perfectly fine to compile the codec libraries completely separately from libheif, even mixing MSVC and GCC if you want -- at worst, you might get a linker error if their standard libraries are too different -- but everything GCC will always work. (Unfortunately there's a lot of older code where ownership is passed to another component that might have a completely different idea of how allocation works. Avisynth was a prime example, because "of course everyone would use VC6 forever," and it was very painful to make it compiler-agnostic without breaking compatibility.) |
I use C++17. VVENC and X265 aren't optimized for C++20.