Added conditional CPP.

This commit is contained in:
Schell Scivally 2013-11-12 15:56:45 -08:00 committed by Kazu Yamamoto
parent b8e20d8e2e
commit aedc11f21c

View File

@ -1,4 +1,4 @@
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns, CPP #-}
module Language.Haskell.GhcMod.ErrMsg ( module Language.Haskell.GhcMod.ErrMsg (
LogReader LogReader
@ -55,7 +55,11 @@ errBagToStrList dflag ls = map (ppErrMsg dflag ls) . reverse . bagToList
ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String
ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext
where where
#if __GLASGOW_HASKELL__ >= 707
spn = errMsgSpan err spn = errMsgSpan err
#else
spn = head (errMsgSpans err)
#endif
msg = errMsgShortDoc err msg = errMsgShortDoc err
ext = showMsg dflag ls (errMsgExtraInfo err) ext = showMsg dflag ls (errMsgExtraInfo err)