summaryrefslogtreecommitdiff
path: root/clucene/patches/clucene-gcc-atomics.patch
blob: d4b47b22cc7b90b086e6ff2090bca5ee014fd386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- src/shared/CLucene/config/threads.cpp	2012-02-23 12:06:55.355506304 +0000
+++ src/shared/CLucene/config/threads.cpp	2012-02-23 12:07:17.131766381 +0000
@@ -185,7 +185,7 @@
     }
       
     int32_t atomic_threads::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
-      #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
+      #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4)  && ( __GNUC_MINOR__ >= 4 ))
         return __sync_add_and_fetch(theInteger, 1);
       #else
         SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)
@@ -193,7 +193,7 @@
       #endif
     }
     int32_t atomic_threads::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
-      #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
+      #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4)  && ( __GNUC_MINOR__ >= 4 ))
         return __sync_sub_and_fetch(theInteger, 1);
       #else
         SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)