From 82b7e2a3df222d10a8ee2cf8613777fc31c25a03 Mon Sep 17 00:00:00 2001 From: Henrik Stickann <4376396-Mithradir@users.noreply.gitlab.com> Date: Sun, 10 Apr 2022 20:44:44 +0200 Subject: [PATCH] Add STA_ATOMIC_ENABLE guards --- include/sta/atomic/mutex.hpp | 5 +++++ include/sta/atomic/signal.hpp | 5 +++++ src/atomic/mutex.cpp | 4 ++++ src/atomic/signal.cpp | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/include/sta/atomic/mutex.hpp b/include/sta/atomic/mutex.hpp index 39d2cf9..33deb82 100644 --- a/include/sta/atomic/mutex.hpp +++ b/include/sta/atomic/mutex.hpp @@ -1,6 +1,9 @@ #ifndef STA_ATOMIC_MUTEX_HPP #define STA_ATOMIC_MUTEX_HPP +#include +#ifdef STA_ATOMIC_ENABLE + #include #include @@ -22,4 +25,6 @@ namespace sta } // namespace sta +#endif // STA_ATOMIC_ENABLE + #endif // STA_ATOMIC_MUTEX_HPP diff --git a/include/sta/atomic/signal.hpp b/include/sta/atomic/signal.hpp index 88dde48..4baa76b 100644 --- a/include/sta/atomic/signal.hpp +++ b/include/sta/atomic/signal.hpp @@ -1,6 +1,9 @@ #ifndef STA_ATOMIC_SIGNAL_HPP #define STA_ATOMIC_SIGNAL_HPP +#include +#ifdef STA_ATOMIC_ENABLE + #include #include @@ -24,4 +27,6 @@ namespace sta } // namespace sta +#endif // STA_ATOMIC_ENABLE + #endif // STA_ATOMIC_SIGNAL_HPP diff --git a/src/atomic/mutex.cpp b/src/atomic/mutex.cpp index 7aff61a..60dc82b 100644 --- a/src/atomic/mutex.cpp +++ b/src/atomic/mutex.cpp @@ -1,4 +1,5 @@ #include +#ifdef STA_ATOMIC_ENABLE namespace sta @@ -17,3 +18,6 @@ namespace sta lock_.clear(); } } // namespace sta + + +#endif // STA_ATOMIC_ENABLE diff --git a/src/atomic/signal.cpp b/src/atomic/signal.cpp index 98b37da..e33d7f6 100644 --- a/src/atomic/signal.cpp +++ b/src/atomic/signal.cpp @@ -1,4 +1,5 @@ #include +#ifdef STA_ATOMIC_ENABLE namespace sta @@ -27,3 +28,6 @@ namespace sta while (!signal_.exchange(false)); } } // namespace sta + + +#endif // STA_ATOMIC_ENABLE