From 310c1f50beb77fc5c6f9075029973161d4e51a4a Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 19 Feb 2024 16:00:46 +0100 Subject: scope_exit: Make constexpr Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it. --- src/audio_core/sink/cubeb_sink.cpp | 4 +++- src/audio_core/sink/sink_stream.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/audio_core/sink') diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index d97ca2a40..49efae8e3 100644 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp @@ -357,7 +357,9 @@ bool IsCubebSuitable() { return false; } - SCOPE_EXIT({ cubeb_destroy(ctx); }); + SCOPE_EXIT { + cubeb_destroy(ctx); + }; #ifdef _WIN32 if (SUCCEEDED(com_init_result)) { diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index c047b0668..0a98eb31e 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -20,10 +20,10 @@ namespace AudioCore::Sink { void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span samples) { - SCOPE_EXIT({ + SCOPE_EXIT { queue.enqueue(buffer); ++queued_buffers; - }); + }; if (type == StreamType::In) { return; -- cgit v1.2.3