summaryrefslogtreecommitdiff
path: root/clucene
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-02-23 12:10:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-02-23 12:10:41 +0000
commit419cceda368284743e8fcd873d7bec94423cc37c (patch)
treeec3d0884924285c518070ff8595fada7b916d63d /clucene
parentcaf607f20373df99e67f271ca0e9aaa7118838fb (diff)
use the same compiler test for atomics in clucene as sal
Diffstat (limited to 'clucene')
-rw-r--r--clucene/patches/clucene-gcc-atomics.patch20
-rw-r--r--clucene/source/Makefile1
2 files changed, 21 insertions, 0 deletions
diff --git a/clucene/patches/clucene-gcc-atomics.patch b/clucene/patches/clucene-gcc-atomics.patch
new file mode 100644
index 000000000000..d4b47b22cc7b
--- /dev/null
+++ b/clucene/patches/clucene-gcc-atomics.patch
@@ -0,0 +1,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)
diff --git a/clucene/source/Makefile b/clucene/source/Makefile
index a53a47ea6846..a4131df73d74 100644
--- a/clucene/source/Makefile
+++ b/clucene/source/Makefile
@@ -41,6 +41,7 @@ done :
$(GNUTAR) -x --strip-component=1 -f $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
$(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-internal-zlib.patch
$(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-warnings.patch
+ $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-gcc-atomics.patch
#FIXME ?, our rules expect .cxx
for i in `find . -name "*.cpp"`; do mv $$i $${i%%cpp}cxx; done
ifneq ($(OS),WNT)