diff --git a/CMakeLists.txt b/CMakeLists.txt index 41309ca02..51d636f39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,6 +195,7 @@ if(ENTT_INCLUDE_HEADERS) signal/emitter.hpp signal/fwd.hpp signal/sigh.hpp + stl/atomic.hpp stl/functional.hpp stl/iterator.hpp stl/memory.hpp diff --git a/src/entt/config/config.h b/src/entt/config/config.h index 1b54e7a36..87e930fea 100644 --- a/src/entt/config/config.h +++ b/src/entt/config/config.h @@ -36,8 +36,8 @@ #endif #ifdef ENTT_USE_ATOMIC -# include -# define ENTT_MAYBE_ATOMIC(Type) std::atomic +# include "../stl/atomic.hpp" +# define ENTT_MAYBE_ATOMIC(Type) stl::atomic #else # define ENTT_MAYBE_ATOMIC(Type) Type #endif diff --git a/src/entt/entt.hpp b/src/entt/entt.hpp index 30223ce61..6dd857a3f 100644 --- a/src/entt/entt.hpp +++ b/src/entt/entt.hpp @@ -69,6 +69,7 @@ namespace entt::stl {} #include "signal/dispatcher.hpp" #include "signal/emitter.hpp" #include "signal/sigh.hpp" +#include "stl/atomic.hpp" #include "stl/functional.hpp" #include "stl/iterator.hpp" #include "stl/memory.hpp" diff --git a/src/entt/stl/atomic.hpp b/src/entt/stl/atomic.hpp new file mode 100644 index 000000000..3b6d9fcbb --- /dev/null +++ b/src/entt/stl/atomic.hpp @@ -0,0 +1,15 @@ +#ifndef ENTT_STL_ATOMIC_HPP +#define ENTT_STL_ATOMIC_HPP + +#include +#include "../config/config.h" + +/*! @cond ENTT_INTERNAL */ +namespace entt::stl { + +using std::atomic; + +} // namespace entt::stl +/*! @endcond */ + +#endif