X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2FSGReferenced.hxx;h=6bce1eb82bd83da9e4fce1d88e37c414340baf91;hb=ff7e70f4d570c472bbc6fe4198483d927914a35e;hp=6a3038f3576494619e6590144ce3d638d547be31;hpb=11b16b8a86d49743a2f29570871bd8adccb51890;p=simgear.git diff --git a/simgear/structure/SGReferenced.hxx b/simgear/structure/SGReferenced.hxx index 6a3038f3..6bce1eb8 100644 --- a/simgear/structure/SGReferenced.hxx +++ b/simgear/structure/SGReferenced.hxx @@ -20,8 +20,13 @@ #ifndef SGReferenced_HXX #define SGReferenced_HXX +#define USE_OPENTHREADS_ATOMIC +#ifndef USE_OPENTHREADS_ATOMIC #include "SGAtomic.hxx" +#else +#include +#endif /// Base class for all reference counted SimGear objects /// Classes derived from this one are meant to be managed with @@ -49,7 +54,11 @@ public: { if (ref) return 1u < ref->_refcount; else return false; } private: +#ifndef USE_OPENTHREADS_ATOMIC mutable SGAtomic _refcount; +#else + mutable OpenThreads::Atomic _refcount; +#endif }; #endif