]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGAtomic.cxx
Modified Files:
[simgear.git] / simgear / structure / SGAtomic.cxx
index 3505fabf601b2c9ca57eccf0f8e6f48ea3285b51..9eabf4ec816719557daa2c42ae9830e3f4845a95 100644 (file)
@@ -39,7 +39,7 @@ unsigned __sync_sub_and_fetch_4(volatile void *ptr, unsigned value)
                        : "=r" (result), "=m" (*mem)
                        : "0" (-value), "m" (*mem)
                        : "memory");
-  return result;
+  return result - value;
 }
 
 unsigned __sync_add_and_fetch_4(volatile void *ptr, unsigned value)
@@ -50,7 +50,7 @@ unsigned __sync_add_and_fetch_4(volatile void *ptr, unsigned value)
                        : "=r" (result), "=m" (*mem)
                        : "0" (value), "m" (*mem)
                        : "memory");
-  return result;
+  return result + value;
 }
 
 void __sync_synchronize()