MINGW: Fix error of use of deleted function#593
Open
carlo-bramini wants to merge 1 commit intoluciusDXL:masterfrom
Open
MINGW: Fix error of use of deleted function#593carlo-bramini wants to merge 1 commit intoluciusDXL:masterfrom
carlo-bramini wants to merge 1 commit intoluciusDXL:masterfrom
Conversation
I tried to build the engine with MinGW and I got several errors like this one:
TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: error: use of deleted function ‘std::atomic<int>::atomic(const std::atomic<int>&)’
29 | std::atomic<s32> s_requestCount = 0;
| ^
In file included from TheForceEngine/TFE_System/types.h:6,
from TheForceEngine/TFE_System/system.h:8,
from TheForceEngine/TFE_FileSystem/filewriterAsync.h:2,
from TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:1:
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:834:7: note: declared here
834 | atomic(const atomic&) = delete;
| ^~~~~~
TheForceEngine/TFE_FileSystem/filewriterAsync.cpp:29:43: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
29 | std::atomic<s32> s_requestCount = 0;
| ^
/usr/lib/gcc/x86_64-w64-mingw32/14/include/c++/atomic:838:17: note: after user-defined conversion: ‘constexpr std::atomic<int>::atomic(__integral_type)’
838 | constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
| ^~~~~~
Attached patch fixes it.
Actually, this file doesn't seem to be compiled by the Visual Studio project file, so I could not test if this change works there too.
However, I have been able to build the engine also with MSVC even after this fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried to build the engine with MinGW and I got several errors like this one:
Attached patch fixes it.
Actually, this file doesn't seem to be compiled by the Visual Studio project file, so I could not test if this change works there too. However, I have been able to build the engine also with MSVC even after this fix.