From a5596651376acbab028be83da2455a72552ed715 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Mon, 24 Nov 1997 20:18:07 +0000
Subject: [PATCH] [project @ 1997-11-24 20:18:06 by sof] Fix to have _casm_gc_
 cope with statement blocks; misc import mods to have modules compile with
 2.09 (and later.)

---
 ghc/compiler/absCSyn/CStrings.lhs | 3 +++
 ghc/compiler/absCSyn/PprAbsC.lhs  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ghc/compiler/absCSyn/CStrings.lhs b/ghc/compiler/absCSyn/CStrings.lhs
index c6beabf931e0..b47da2bf0c93 100644
--- a/ghc/compiler/absCSyn/CStrings.lhs
+++ b/ghc/compiler/absCSyn/CStrings.lhs
@@ -18,6 +18,9 @@ IMPORT_1_3(Char (isAlphanum,ord,chr))
 CHK_Ubiq() -- debugging consistency check
 
 import Pretty
+#if __GLASGOW_HASKELL__ >= 209
+import Addr
+#endif
 
 \end{code}
 
diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs
index bfa229b9a321..fe822b41243e 100644
--- a/ghc/compiler/absCSyn/PprAbsC.lhs
+++ b/ghc/compiler/absCSyn/PprAbsC.lhs
@@ -634,8 +634,8 @@ pprCCall sty op@(CCallOp op_str is_asm may_gc _ _) args results liveness_mask vo
     (pp_saves, pp_restores) = ppr_vol_regs sty vol_regs
     (pp_save_context, pp_restore_context) =
 	if may_gc
-	then (	text "extern StgInt inCCallGC; SaveAllStgRegs(); inCCallGC++;",
-		text "inCCallGC--; RestoreAllStgRegs();")
+	then (	text "do { extern StgInt inCCallGC; SaveAllStgRegs(); inCCallGC++;",
+		text "inCCallGC--; RestoreAllStgRegs();} while(0);")
 	else (	pp_basic_saves $$ pp_saves,
 		pp_basic_restores $$ pp_restores)
 
-- 
GitLab