clucene-gcc-atomics.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. --- src/shared/CLucene/config/threads.cpp 2012-02-23 12:06:55.355506304 +0000
  2. +++ src/shared/CLucene/config/threads.cpp 2012-02-23 12:07:17.131766381 +0000
  3. @@ -185,7 +185,7 @@
  4. }
  5. int32_t atomic_threads::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
  6. - #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
  7. + #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
  8. return __sync_add_and_fetch(theInteger, 1);
  9. #else
  10. SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)
  11. @@ -193,7 +193,7 @@
  12. #endif
  13. }
  14. int32_t atomic_threads::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
  15. - #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
  16. + #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
  17. return __sync_sub_and_fetch(theInteger, 1);
  18. #else
  19. SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)
  20. --- src/shared/CLucene/LuceneThreads.h 2012-02-23 12:36:28.388299322 +0000
  21. +++ src/shared/CLucene/LuceneThreads.h 2012-02-23 12:37:23.131885433 +0000
  22. @@ -70,7 +70,7 @@
  23. void NotifyAll();
  24. };
  25. - #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
  26. + #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
  27. #define _LUCENE_ATOMIC_INT uint32_t
  28. #define _LUCENE_ATOMIC_INT_SET(x,v) x=v
  29. #define _LUCENE_ATOMIC_INT_GET(x) x