summaryrefslogtreecommitdiff
path: root/debian/patches/00_0175-fix-s390-qatomic.dpatch
blob: 11fec9e398f8ef7a403faccd1608808f28a82d73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/sh /usr/share/dpatch/dpatch-run
## 00_0175-fix-s390-qatomic.dpatch by Dirk Mueller <mueller@kde.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix s390(x) build.

@DPATCH@
diff -urNad qt4-x11-4.3.0~rc1~/src/corelib/arch/qatomic_s390.h qt4-x11-4.3.0~rc1/src/corelib/arch/qatomic_s390.h
--- qt4-x11-4.3.0~rc1~/src/corelib/arch/qatomic_s390.h	2007-05-06 17:54:22.000000000 +0200
+++ qt4-x11-4.3.0~rc1/src/corelib/arch/qatomic_s390.h	2007-05-17 19:13:18.000000000 +0200
@@ -182,10 +182,20 @@
 #endif
 }
 
-#error "fetch-and-add not implemented"
-// int q_atomic_fetch_and_add_int(volatile int *ptr, int value);
-// int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value);
-// int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value);
+inline int q_atomic_fetch_and_add_int(volatile int *ptr, int value)
+{
+    return __sync_fetch_and_add(ptr, value);
+}
+
+inline int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value)
+{
+    return __sync_fetch_and_add(ptr, value);
+}
+
+inline int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value)
+{
+    return __sync_fetch_and_add(ptr, value);
+}
 
 QT_END_HEADER