Make `#include "Rts.h"` C++-compatible again (re #8676)
authorHerbert Valerio Riedel <hvr@gnu.org>
Sun, 19 Jan 2014 13:37:05 +0000 (14:37 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Sun, 19 Jan 2014 13:43:38 +0000 (14:43 +0100)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
includes/rts/Threads.h
includes/rts/storage/Block.h
includes/rts/storage/ClosureMacros.h

index e6844a3..da6f7a4 100644 (file)
@@ -68,6 +68,6 @@ extern Capability MainCapability;
 // Change the number of capabilities (only supports increasing the
 // current value at the moment).
 //
-extern void setNumCapabilities (nat new);
+extern void setNumCapabilities (nat new_);
 
 #endif /* RTS_THREADS_H */
index 7b3bc99..5567bf4 100644 (file)
@@ -248,17 +248,17 @@ dbl_link_insert_after(bdescr *bd, bdescr *after)
 }
 
 INLINE_HEADER void
-dbl_link_replace(bdescr *new, bdescr *old, bdescr **list)
+dbl_link_replace(bdescr *new_, bdescr *old, bdescr **list)
 {
-    new->link = old->link;
-    new->u.back = old->u.back;
+    new_->link = old->link;
+    new_->u.back = old->u.back;
     if (old->link) {
-        old->link->u.back = new;
+        old->link->u.back = new_;
     }
     if (old->u.back) {
-        old->u.back->link = new;
+        old->u.back->link = new_;
     } else {
-        *list = new;
+        *list = new_;
     }
 }
 
index 8933e85..88434d4 100644 (file)
@@ -245,12 +245,12 @@ TAG_CLOSURE(StgWord tag,StgClosure * p)
 INLINE_HEADER rtsBool LOOKS_LIKE_INFO_PTR_NOT_NULL (StgWord p)
 {
     StgInfoTable *info = INFO_PTR_TO_STRUCT((StgInfoTable *)p);
-    return info->type != INVALID_OBJECT && info->type < N_CLOSURE_TYPES;
+    return (info->type != INVALID_OBJECT && info->type < N_CLOSURE_TYPES) ? rtsTrue : rtsFalse;
 }
 
 INLINE_HEADER rtsBool LOOKS_LIKE_INFO_PTR (StgWord p)
 {
-    return p && (IS_FORWARDING_PTR(p) || LOOKS_LIKE_INFO_PTR_NOT_NULL(p));
+    return (p && (IS_FORWARDING_PTR(p) || LOOKS_LIKE_INFO_PTR_NOT_NULL(p))) ? rtsTrue : rtsFalse;
 }
 
 INLINE_HEADER rtsBool LOOKS_LIKE_CLOSURE_PTR (void *p)