smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
638 stars 156 forks source link

Code using features deprecated in C++20 #118

Open TopoIogist opened 2 years ago

TopoIogist commented 2 years ago

When compiling with C++20 support, errors as such are thrown:

Error C4996 'std::atomicload': warning STL4029: std::atomic*() overloads for shared_ptr are deprecated in C++20. The shared_ptr specialization of std::atomic provides superior functionality. You can define _SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
C:\Sourcecode\screen_capture_lite\screen_capture_lite\internal\ThreadManager.h 148

If possible the code should avoid features that are deprecated in c++20. The shared_ptr could be changed to an atomic_shared_ptr and the atomic_load removed.

smasherprog commented 2 years ago

I agree. there was a weird state where some compilers didnt support the new c++ version so i left it. If you want to give a stab at a PR, that would be most welcome :)

smasherprog commented 2 years ago

Ill keep the PR until the other compilers catch up to Visual studio..... Never thought I'd say that..