[commit: ghc] ghc-7.10: Make headers C++ compatible (fixes #10700) (5c1fff2)

git at git.haskell.org git at git.haskell.org
Sat Oct 3 07:50:40 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/5c1fff2acdb57300411c3e803fbf6a9caaf2580b/ghc

>---------------------------------------------------------------

commit 5c1fff2acdb57300411c3e803fbf6a9caaf2580b
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


>---------------------------------------------------------------

5c1fff2acdb57300411c3e803fbf6a9caaf2580b
 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 156ee42..eace694 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
 }
 



More information about the ghc-commits mailing list