summaryrefslogtreecommitdiff
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-10-22 14:26:46 +0200
commit284a4317a61f639f085f74be4f32a3e63b62e0f4 (patch)
tree28dce0e1d646f696a394ef8a21a2fa0764b023f6
parentf05a75c0831ce9a5dd92c595fececb78c2de4977 (diff)
downloadhaskell-284a4317a61f639f085f74be4f32a3e63b62e0f4.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
-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 156ee42fd3..eace6946ae 100644
--- a/includes/stg/SMP.h
+++ b/includes/stg/SMP.h
@@ -280,12 +280,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
}
@@ -301,12 +301,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
}