[commit: ghc] master: Make headers C++ compatible (fixes #10700) (e7c331a)
git at git.haskell.org
git at git.haskell.org
Thu Jul 30 15:04:56 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e7c331af4674dd072a9f1d67feb586679b365b98/ghc
>---------------------------------------------------------------
commit e7c331af4674dd072a9f1d67feb586679b365b98
Author: Alexey Shmalko <rasen.dubi at gmail.com>
Date: Thu Jul 30 10:37:05 2015 +0200
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
>---------------------------------------------------------------
e7c331af4674dd072a9f1d67feb586679b365b98
includes/stg/Prim.h | 8 ++++----
includes/stg/SMP.h | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h
index 80f4f8e..b07e177 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 2bc0015..b0636d5 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
}
More information about the ghc-commits
mailing list