on master help sign in
Fix up the CPP flags that are defined (#1694)
e17aa60Neil Mitchell
src/Development/IDE/Functions/CPP.hs+7−5
@@ -28,6 +28,7 @@ import FileCleanup
28import System.Directory
28import System.Directory
29import System.FilePath
29import System.FilePath
30import Control.Monad
30import Control.Monad
31+import System.Info
31import Data.List ( intercalate )
32import Data.List ( intercalate )
32import Data.Maybe
33import Data.Maybe
33import Data.Version
34import Data.Version
@@ -52,11 +53,12 @@ doCpp dflags raw input_fn output_fn = do
52 | otherwise = SysTools.runCc
53 | otherwise = SysTools.runCc
53 dflags (SysTools.Option "-E" : args)
54 dflags (SysTools.Option "-E" : args)
54
55
55− let target_defs = [] {-
56+ let target_defs =
57+ -- NEIL: Patched to use System.Info instead of constants from CPP
56− [ "-D" ++ HOST_OS ++ "_BUILD_OS",
58+ [ "-D" ++ os ++ "_BUILD_OS",
57− "-D" ++ HOST_ARCH ++ "_BUILD_ARCH",
59+ "-D" ++ arch ++ "_BUILD_ARCH",
58− "-D" ++ TARGET_OS ++ "_HOST_OS",
60+ "-D" ++ os ++ "_HOST_OS",
59− "-D" ++ TARGET_ARCH ++ "_HOST_ARCH" ] -}
61+ "-D" ++ arch ++ "_HOST_ARCH" ]
60 -- remember, in code we *compile*, the HOST is the same our TARGET,
62 -- remember, in code we *compile*, the HOST is the same our TARGET,
61 -- and BUILD is the same as our HOST.
63 -- and BUILD is the same as our HOST.
62
64