diff --git a/code/Assimp.cpp b/code/Assimp.cpp index ad36a1850..ce05468f7 100644 --- a/code/Assimp.cpp +++ b/code/Assimp.cpp @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Importer.h" // ------------------------------------------------------------------------------------------------ -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED # include # include #endif @@ -87,7 +87,7 @@ namespace Assimp } -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED /** Global mutex to manage the access to the logstream map */ static boost::mutex gLogStreamMutex; #endif @@ -104,7 +104,7 @@ public: } ~LogToCallbackRedirector() { -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED boost::mutex::scoped_lock lock(gLogStreamMutex); #endif // (HACK) Check whether the 'stream.user' pointer points to a @@ -337,7 +337,7 @@ ASSIMP_API void aiAttachLogStream( const aiLogStream* stream ) { ASSIMP_BEGIN_EXCEPTION_REGION(); -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED boost::mutex::scoped_lock lock(gLogStreamMutex); #endif @@ -356,7 +356,7 @@ ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream) { ASSIMP_BEGIN_EXCEPTION_REGION(); -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED boost::mutex::scoped_lock lock(gLogStreamMutex); #endif // find the logstream associated with this data @@ -381,7 +381,7 @@ ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream) ASSIMP_API void aiDetachAllLogStreams(void) { ASSIMP_BEGIN_EXCEPTION_REGION(); -#ifdef AI_C_THREADSAFE +#ifndef ASSIMP_BUILD_SINGLETHREADED boost::mutex::scoped_lock lock(gLogStreamMutex); #endif for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) { diff --git a/include/assimp/defs.h b/include/assimp/defs.h index b2ea25fcb..91ad095c8 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -234,13 +234,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * threads then and is itself not threadsafe. * If this flag is specified boost::threads is *not* required. */ ////////////////////////////////////////////////////////////////////////// -#ifndef ASSIMP_BUILD_SINGLETHREADED -# define ASSIMP_BUILD_SINGLETHREADED -#endif - -#ifndef ASSIMP_BUILD_SINGLETHREADED -# define AI_C_THREADSAFE -#endif // !! ASSIMP_BUILD_SINGLETHREADED +//#ifndef ASSIMP_BUILD_SINGLETHREADED +//# define ASSIMP_BUILD_SINGLETHREADED +//#endif #if defined(_DEBUG) || ! defined(NDEBUG) # define ASSIMP_BUILD_DEBUG