@ -281,6 +281,10 @@ else()
set(framework_LIBRARIES ${framework_LIBRARIES} ${SYSTEM_LIBRARIES})
endif()
if(FRAMEWORK_THREAD_SAFE)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DTHREAD_SAFE)
if(FRAMEWORK_GRAPHICS)
set(OPENGLES "OFF" CACHE "Use OpenGL ES 1.0 or 2.0 (for mobiles devices)" STRING)
if(OPENGLES STREQUAL "2.0")
@ -28,12 +28,16 @@
#include <cassert>
#include <ostream>
#ifdef THREAD_SAFE
#include <atomic>
#endif
namespace stdext {
template<class T>
class shared_object_ptr;
typedef unsigned int refcount_t;
typedef unsigned long refcount_t;
class shared_object
{
@ -49,7 +53,11 @@ public:
template<typename T> stdext::shared_object_ptr<T> const_self_cast() { return stdext::shared_object_ptr<T>(const_cast<T*>(this)); }
private:
std::atomic<refcount_t> m_refs;
#else
refcount_t m_refs;
};