CPP corrections.

This commit is contained in:
Schell Scivally 2013-11-12 16:10:25 -08:00 committed by Kazu Yamamoto
parent aedc11f21c
commit e5ee3da399
2 changed files with 10 additions and 4 deletions

Binary file not shown.

View File

@ -52,16 +52,22 @@ errBagToStrList dflag ls = map (ppErrMsg dflag ls) . reverse . bagToList
----------------------------------------------------------------
#if __GLASGOW_HASKELL__ >= 707
ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String
ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext
where
#if __GLASGOW_HASKELL__ >= 707
spn = errMsgSpan err
#else
spn = head (errMsgSpans err)
#endif
msg = errMsgShortDoc err
ext = showMsg dflag ls (errMsgExtraInfo err)
#else
ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String
ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext
where
spn = head (errMsgSpans err)
msg = errMsgShortDoc err
ext = showMsg dflag ls (errMsgExtraInfo err)
#endif
ppMsg :: SrcSpan -> Severity-> DynFlags -> LineSeparator -> SDoc -> String
ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts ++ lsep