Use <atomic> instead of <stdatomic.h> in libc++ fix
The definitions from <stdatomic.h> conflict with <atomic>, which causes a build failure since <atomic> is included previously. Signed-off-by: Violet Purcell <vimproved@inventati.org>
This commit is contained in:
parent
1dc70e792f
commit
6e24a409f4
@ -44,9 +44,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SMTG_OS_LINUX
|
#if SMTG_OS_LINUX
|
||||||
#if !defined (SMTG_USE_STDATOMIC_H)
|
#if !defined (SMTG_USE_ATOMIC)
|
||||||
#if defined (_LIBCPP_VERSION)
|
#if defined (_LIBCPP_VERSION)
|
||||||
#define SMTG_USE_STDATOMIC_H 1
|
#define SMTG_USE_ATOMIC 1
|
||||||
#else
|
#else
|
||||||
#include <ext/atomicity.h>
|
#include <ext/atomicity.h>
|
||||||
#endif
|
#endif
|
||||||
@ -57,8 +57,8 @@
|
|||||||
#include <boost/uuid/uuid_generators.hpp>
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (SMTG_USE_STDATOMIC_H) && SMTG_USE_STDATOMIC_H
|
#if defined (SMTG_USE_ATOMIC) && SMTG_USE_ATOMIC
|
||||||
#include <stdatomic.h>
|
#include <atomic>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Steinberg {
|
namespace Steinberg {
|
||||||
@ -89,8 +89,8 @@ namespace FUnknownPrivate {
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
int32 PLUGIN_API atomicAdd (int32& var, int32 d)
|
int32 PLUGIN_API atomicAdd (int32& var, int32 d)
|
||||||
{
|
{
|
||||||
#if SMTG_USE_STDATOMIC_H
|
#if SMTG_USE_ATOMIC
|
||||||
return atomic_fetch_add (reinterpret_cast<atomic_int_least32_t*> (&var), d) +d;
|
return atomic_fetch_add (reinterpret_cast<std::atomic_int_least32_t*> (&var), d) +d;
|
||||||
#elif SMTG_OS_WINDOWS
|
#elif SMTG_OS_WINDOWS
|
||||||
return InterlockedExchangeAdd ((volatile long int*)&var, d) + d;
|
return InterlockedExchangeAdd ((volatile long int*)&var, d) + d;
|
||||||
#elif SMTG_OS_MACOS
|
#elif SMTG_OS_MACOS
|
||||||
|
Loading…
Reference in New Issue
Block a user