[commit: hsc2hs] master: Don't emit #define/#undef in generated .hs files (4a0f677)

git at git.haskell.org git
Wed Oct 2 05:55:10 UTC 2013


Repository : ssh://git at git.haskell.org/hsc2hs

On branch  : master
Link       : http://git.haskell.org/hsc2hs.git/commitdiff/4a0f67704d89712f8493a0c7eccffa9243d6ef09

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

commit 4a0f67704d89712f8493a0c7eccffa9243d6ef09
Author: Reid Barton <rwbarton at gmail.com>
Date:   Tue Oct 1 13:02:26 2013 -0400

    Don't emit #define/#undef in generated .hs files
    
    ... just like they aren't emitted in the ordinary case; see outTokenHs
    in C.hs.
    
    Closes #8393.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

4a0f67704d89712f8493a0c7eccffa9243d6ef09
 CrossCodegen.hs |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CrossCodegen.hs b/CrossCodegen.hs
index 573edcc..725a94b 100644
--- a/CrossCodegen.hs
+++ b/CrossCodegen.hs
@@ -228,8 +228,8 @@ outputSpecial output (z at ZCursor {zCursor=Special pos@(SourcePos file line)  key
        "error" -> testFail pos ("#error " ++ value)
        "warning" -> liftTestIO $ putStrLn (file ++ ":" ++ show line ++ " warning: " ++ value)
        "include" -> return ()
-       "define" -> output $ outHeaderCProg' (zCursor z)
-       "undef" -> output $ outHeaderCProg' (zCursor z)
+       "define" -> return ()
+       "undef" -> return ()
        _ -> testFail pos ("directive " ++ key ++ " cannot be handled in cross-compilation mode")
     where outputConst value' formatter = computeConst z value' >>= (output . formatter)
 outputSpecial _ _ = error "outputSpecial's argument isn't a Special"




More information about the ghc-commits mailing list