From c0ead7b5a8d8f0740d8481273e27bf5b65e0c324 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 3 Apr 2009 17:55:12 +0000 Subject: [PATCH] Added some of the standard occam defines, such as TARGET.BITS.PER.WORD For the moment, TARGET.HAS.FPU is left out, because a lot of occam libraries seem to do ASM if it's defined, and we can't handle ASM --- data/CompState.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/CompState.hs b/data/CompState.hs index aae0f2e..561082c 100644 --- a/data/CompState.hs +++ b/data/CompState.hs @@ -34,6 +34,7 @@ import qualified AST as A import Errors (Die, dieP, ErrorReport, Warn, WarningType(..), warnP, WarningReport) import Metadata import OrdAST () +import TypeSizes import UnifyType import Utils @@ -179,7 +180,11 @@ emptyState = CompState { csCurrentFile = "none", csUsedFiles = Set.empty, - csDefinitions = Map.insert "COMPILER.TOCK" PreprocNothing Map.empty, + csDefinitions = Map.fromList [("COMPILER.TOCK", PreprocNothing) + ,("TARGET.BITS.PER.WORD", PreprocInt $ show cIntSize) + ,("TARGET.BYTES.PER.WORD", PreprocInt $ show $ cIntSize `div` 8) +-- ,("TARGET.HAS.FPU", PreprocNothing) + ], csLocalNames = [], csMainLocals = [],