|
From: <ric...@us...> - 2011-06-21 03:35:36
|
Revision: 1087
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1087&view=rev
Author: rich_sposato
Date: 2011-06-21 03:35:30 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
Changed preprocessor statements to provide clarity.
Modified Paths:
--------------
trunk/include/loki/ThreadLocal.h
Modified: trunk/include/loki/ThreadLocal.h
===================================================================
--- trunk/include/loki/ThreadLocal.h 2011-06-21 03:32:19 UTC (rev 1086)
+++ trunk/include/loki/ThreadLocal.h 2011-06-21 03:35:30 UTC (rev 1087)
@@ -20,19 +20,28 @@
// First assume the compiler does allow thread-local storage by #defining the
// macro which allows compiler to see the code inside this file.
-// Then #undef the macro for compilers which are known for not supporting
-// thread-local storage.
+// Then #undef the macro for compilers which do not support thread-local
+// storage or do not implement it correctly.
#define LOKI_THINKS_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 some parts of Loki."
- #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE
-#endif
+#if defined( __GNUC__ )
+ // 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 some parts of Loki."
+ #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE
-#if ( defined( __CYGWIN__ ) && ( __GNUC__ <= 3 ) )
- #warning "Older versions of GCC for Cygwin do not allow thread_local storage, so you can not use some parts of Loki."
- #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE
+ #elif defined( __CYGWIN__ )
+ #if ( __GNUC__ <= 3 )
+ #warning "Older versions of GCC for Cygwin do not allow thread_local storage, so you can not use some parts of Loki."
+ #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE
+ #endif
+
+ #elif ( __GNUC__ == 4 ) // GNU versions other than Cygwin.
+ #if ( __GNUC_MINOR__ == 4 )
+ #warning "GCC version 4.4 implements thread_local storage incorrectly, so you can not use some parts of Loki."
+ #undef COMPILER_ALLOWS_THREAD_LOCAL_STORAGE
+ #endif
+ #endif
#endif
#if defined( LOKI_THINKS_COMPILER_ALLOWS_THREAD_LOCAL_STORAGE ) && !defined( LOKI_THREAD_LOCAL )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|