From: <ric...@us...> - 2009-09-29 19:02:51
|
Revision: 1026 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1026&view=rev Author: rich_sposato Date: 2009-09-29 19:02:43 +0000 (Tue, 29 Sep 2009) Log Message: ----------- Changed #if statement used to decide to compile code. Modified Paths: -------------- trunk/src/LevelMutex.cpp Modified: trunk/src/LevelMutex.cpp =================================================================== --- trunk/src/LevelMutex.cpp 2009-09-26 23:49:05 UTC (rev 1025) +++ trunk/src/LevelMutex.cpp 2009-09-29 19:02:43 UTC (rev 1026) @@ -20,8 +20,26 @@ // ---------------------------------------------------------------------------- -#if (!defined(__CYGWIN__) || (defined(__CYGWIN__) && __GNUC__ > 3)) && !defined(__APPLE__) +// First assume the compiler does allow thread-local storage by #defining the +// macro which allows compiler to see the code inside this file. +// Then #undefine the macro for compilers which are known for not supporting +// thread-local storage. +#define COMPILER_ALLOWS_THREAD_LOCAL_STORAGE 1 +// The __APPLE__ macro does not refer to a compiler, but to the Apple OSX operating system. +#if defined( __APPLE__ ) + #warning "GCC for Apple does not allow thread_local storage, so you can not use Loki::LevelMutex." + #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE +#endif + +#if ( defined( __CYGWIN__ ) && ( __GNUC__ <= 3 ) ) + #warning "Older versions of GCC for Cygwin do not allow thread_local storage, so you can not use Loki::LevelMutex." + #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE +#endif + +#if defined( COMPILER_ALLOWS_THREAD_LOCAL_STORAGE ) + + #include <loki/LevelMutex.h> #include <algorithm> @@ -1143,6 +1161,4 @@ } // end namespace Loki - -#endif - +#endif // #if defined( COMPILER_ALLOWS_THREAD_LOCAL_STORAGE ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |