git: 5887af366d3d - main - games/endless-sky: fix build with clang 18
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 28 Mar 2024 20:43:54 UTC
The branch main has been updated by amdmi3: URL: https://cgit.FreeBSD.org/ports/commit/?id=5887af366d3d0d54d0d8dea3b0ee34ae3104a0d0 commit 5887af366d3d0d54d0d8dea3b0ee34ae3104a0d0 Author: Dmitry Marakasov <amdmi3@FreeBSD.org> AuthorDate: 2024-03-28 18:59:27 +0000 Commit: Dmitry Marakasov <amdmi3@FreeBSD.org> CommitDate: 2024-03-28 20:16:01 +0000 games/endless-sky: fix build with clang 18 PR: 278002 Submitted by: dim --- games/endless-sky/files/patch-source_Audio.cpp | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/games/endless-sky/files/patch-source_Audio.cpp b/games/endless-sky/files/patch-source_Audio.cpp new file mode 100644 index 000000000000..e89a03aaa292 --- /dev/null +++ b/games/endless-sky/files/patch-source_Audio.cpp @@ -0,0 +1,63 @@ +--- source/Audio.cpp.orig 2023-10-21 20:01:54 UTC ++++ source/Audio.cpp +@@ -82,7 +82,7 @@ namespace { + // This queue keeps track of sounds that have been requested to play. Each + // added sound is "deferred" until the next audio position update to make + // sure that all sounds from a given frame start at the same time. +- map<const Sound *, QueueEntry> queue; ++ map<const Sound *, QueueEntry> queue_; + map<const Sound *, QueueEntry> deferred; + thread::id mainThreadID; + +@@ -249,7 +249,7 @@ void Audio::Update(const Point &listenerPosition) + listener = listenerPosition; + + for(const auto &it : deferred) +- queue[it.first].Add(it.second); ++ queue_[it.first].Add(it.second); + deferred.clear(); + } + +@@ -273,7 +273,7 @@ void Audio::Play(const Sound *sound, const Point &posi + // Place sounds from the main thread directly into the queue. They are from + // the UI, and the Engine may not be running right now to call Update(). + if(this_thread::get_id() == mainThreadID) +- queue[sound].Add(position - listener); ++ queue_[sound].Add(position - listener); + else + { + unique_lock<mutex> lock(audioMutex); +@@ -317,12 +317,12 @@ void Audio::Step() + { + if(source.GetSound()->IsLooping()) + { +- auto it = queue.find(source.GetSound()); +- if(it != queue.end()) ++ auto it = queue_.find(source.GetSound()); ++ if(it != queue_.end()) + { + source.Move(it->second); + newSources.push_back(source); +- queue.erase(it); ++ queue_.erase(it); + } + else + { +@@ -367,7 +367,7 @@ void Audio::Step() + + // Now, what is left in the queue is sounds that want to play, and that do + // not correspond to an existing source. +- for(const auto &it : queue) ++ for(const auto &it : queue_) + { + // Use a recycled source if possible. Otherwise, create a new one. + unsigned source = 0; +@@ -396,7 +396,7 @@ void Audio::Step() + sources.back().Move(it.second); + alSourcePlay(source); + } +- queue.clear(); ++ queue_.clear(); + + // Queue up new buffers for the music, if necessary. + int buffersDone = 0;