summaryrefslogtreecommitdiff
path: root/includes/stg
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2015-07-30 10:37:05 +0200
committerBen Gamari <ben@smart-cactus.org>2015-07-30 17:05:35 +0200
commite7c331af4674dd072a9f1d67feb586679b365b98 (patch)
tree0500e1d52e1b084760ead905c6000b5ac011c1c8 /includes/stg
parent9f7cdfee3e9f9ca6fbfa27d3b2dc2d86ac4ee226 (diff)
downloadhaskell-e7c331af4674dd072a9f1d67feb586679b365b98.tar.gz
Make headers C++ compatible (fixes #10700)
Some headers used `new` as parameter name, which is reserved word in C++. This patch changes these names to `new_`. Test Plan: validate Reviewers: austin, ezyang, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1107 GHC Trac Issues: #10700
Diffstat (limited to 'includes/stg')
-rw-r--r--includes/stg/Prim.h8
-rw-r--r--includes/stg/SMP.h16
2 files changed, 12 insertions, 12 deletions
diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h
index 80f4f8e9aa..b07e177542 100644
--- a/includes/stg/Prim.h
+++ b/includes/stg/Prim.h
@@ -39,10 +39,10 @@ StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val);
StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val);
StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val);
StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
-StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new);
-StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new);
-StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new);
-StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new);
+StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new_);
+StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new_);
+StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new_);
+StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new_);
StgWord hs_atomicread8(volatile StgWord8 *x);
StgWord hs_atomicread16(volatile StgWord16 *x);
StgWord hs_atomicread32(volatile StgWord32 *x);
diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h
index 2bc00155c5..b0636d5b65 100644
--- a/includes/stg/SMP.h
+++ b/includes/stg/SMP.h
@@ -302,12 +302,12 @@ atomic_inc(StgVolatilePtr p, StgWord incr)
);
return r + incr;
#else
- StgWord old, new;
+ StgWord old, new_;
do {
old = *p;
- new = old + incr;
- } while (cas(p, old, new) != old);
- return new;
+ new_ = old + incr;
+ } while (cas(p, old, new_) != old);
+ return new_;
#endif
}
@@ -323,12 +323,12 @@ atomic_dec(StgVolatilePtr p)
);
return r-1;
#else
- StgWord old, new;
+ StgWord old, new_;
do {
old = *p;
- new = old - 1;
- } while (cas(p, old, new) != old);
- return new;
+ new_ = old - 1;
+ } while (cas(p, old, new_) != old);
+ return new_;
#endif
}