[PATCH 10/13] mghttpd: Don't use __sync_XXX_and_fetch functions.

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Apr 21 08:49:50 UTC 2016


From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>

This patch should be replaced by one that uses libatomic as soon as it
is provided by our toolchain.
---
 cpukit/mghttpd/civetweb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/cpukit/mghttpd/civetweb.c b/cpukit/mghttpd/civetweb.c
index 0c907f0..edc13d6 100644
--- a/cpukit/mghttpd/civetweb.c
+++ b/cpukit/mghttpd/civetweb.c
@@ -1371,7 +1371,9 @@ mg_atomic_inc(volatile int *addr)
 	 * so whatever you use, the other SDK is likely to raise a warning. */
 	ret = InterlockedIncrement((volatile long *)addr);
 #elif defined(__GNUC__)                                                        \
-    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))
+    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))           \
+    && !defined(__rtems__)
+    /* FIXME: Use libatomic support as soon as it is provided. */
 	ret = __sync_add_and_fetch(addr, 1);
 #else
 	ret = (++(*addr));
@@ -1390,7 +1392,9 @@ mg_atomic_dec(volatile int *addr)
 	 * so whatever you use, the other SDK is likely to raise a warning. */
 	ret = InterlockedDecrement((volatile long *)addr);
 #elif defined(__GNUC__)                                                        \
-    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))
+    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))           \
+    && !defined(__rtems__)
+    /* FIXME: Use libatomic support as soon as it is provided. */
 	ret = __sync_sub_and_fetch(addr, 1);
 #else
 	ret = (--(*addr));
-- 
1.8.4.5



More information about the devel mailing list