Skip to content

Commit c045755

Browse files
ivanperez-keeradpwiz
authored andcommitted
Enable compatibility with base < 4.11 (#310)
This commit enables compatibility of sdl2 with base versions prior to 4.11 (corresponding to GHC versions prior to 8.4). The patch requires introducing protections around a warning flag that didn't exist prior to GHC 8.4, and a conditional import.
1 parent 5c92d46 commit c045755

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/SDL/Input/Keyboard/Codes.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveDataTypeable #-}
23
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE MultiParamTypeClasses #-}
45
{-# LANGUAGE PatternSynonyms #-}
56

7+
#if MIN_VERSION_base(4,11,0)
68
{-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-}
9+
#endif
710
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
811

912
{-|

src/SDL/Input/Mouse.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ import qualified SDL.Raw.Types as Raw
6868
import Control.Applicative
6969
#endif
7070

71+
#if !MIN_VERSION_base(4,11,0)
72+
import Data.Monoid ((<>))
73+
#endif
74+
7175
data LocationMode
7276
= AbsoluteLocation
7377
| RelativeLocation

src/SDL/Raw/Enum.hsc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE ScopedTypeVariables #-}
23
{-# LANGUAGE PatternSynonyms #-}
34

5+
#if MIN_VERSION_base(4,11,0)
46
{-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-}
7+
#endif
58
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
69

710
module SDL.Raw.Enum (

0 commit comments

Comments
 (0)