PKGBUILDs/community/qtractor/04-q_atomic_ftbfs.patch
2014-01-03 02:40:56 +00:00

64 lines
1.6 KiB
Diff

Description: Definte generic atomic function to prevent FTBFS on most
architectures.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725611
Author: Alessio Treglia <alessio@debian.org>
---
src/qtractorAtomic.h | 40 ++++++++++++----------------------------
1 file changed, 12 insertions(+), 28 deletions(-)
--- qtractor.orig/src/qtractorAtomic.h
+++ qtractor/src/qtractorAtomic.h
@@ -35,33 +35,7 @@ extern "C" {
#if defined(__GNUC__)
-#if defined(powerpc) || defined(__ppc__)
-
-static inline int ATOMIC_CAS1 (
- volatile int *pAddr, int iOldValue, int iNewValue )
-{
- register int result;
- asm volatile (
- "# ATOMIC_CAS1 \n"
- " lwarx r0, 0, %1 \n"
- " cmpw r0, %2 \n"
- " bne- 1f \n"
- " sync \n"
- " stwcx. %3, 0, %1 \n"
- " bne- 1f \n"
- " li %0, 1 \n"
- " b 2f \n"
- "1: \n"
- " li %0, 0 \n"
- "2: \n"
- : "=r" (result)
- : "r" (pValue), "r" (iOldValue), "r" (iNewValue)
- : "r0"
- );
- return result;
-}
-
-#elif defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__)
static inline int ATOMIC_CAS1 (
volatile int *pValue, int iOldValue, int iNewValue )
@@ -79,7 +53,17 @@ static inline int ATOMIC_CAS1 (
}
#else
-# error "qtractorAtomic.h: unsupported target compiler processor (GNUC)."
+
+#if QT_VERSION < 0x040400
+
+static inline int ATOMIC_CAS1 (
+ volatile int *pAddr, int iOldValue, int iNewValue )
+{
+ return q_atomic_test_and_set_int(pAddr, iOldValue, iNewValue);
+}
+
+#endif
+
#endif
#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32)