Skip to content

Commit 6206bb0

Browse files
committed
[fiber] Guard std::scoped_lock for GCC14
The implementation does not seem to be available for every GCC.
1 parent 3fbe3a1 commit 6206bb0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/modm/processing/fiber/mutex.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111

1212
#pragma once
1313

14-
// Required to convince libstdc++ to enable scoped lock
15-
#ifndef __cpp_lib_scoped_lock
16-
# define __cpp_lib_scoped_lock 201703L
17-
#endif
18-
1914
#include <modm/architecture/interface/fiber.hpp>
2015
#include <modm/architecture/interface/atomic_lock.hpp>
2116
#include <limits>
@@ -192,8 +187,10 @@ call_once(once_flag& flag, Callable&& f, Args&&... args)
192187
/// @see https://en.cppreference.com/w/cpp/thread/lock_guard
193188
using ::std::lock_guard;
194189

190+
#ifdef __cpp_lib_scoped_lock
195191
/// @see https://en.cppreference.com/w/cpp/thread/scoped_lock
196192
using ::std::scoped_lock;
193+
#endif
197194
/// @see https://en.cppreference.com/w/cpp/thread/unique_lock
198195
using ::std::unique_lock;
199196

0 commit comments

Comments
 (0)