mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-17 05:03:55 -07:00
use FiniteBitSize with ghc >= 7.8
This commit is contained in:
@@ -225,6 +225,12 @@ clientMessages = [("_NET_ACTIVE_WINDOW",("_NET_ACTIVE_WINDOW",32,1))
|
|||||||
,("WM_SAVE_YOURSELF" ,("STRING" , 8,0))
|
,("WM_SAVE_YOURSELF" ,("STRING" , 8,0))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
#if __GLASGOW_HASKELL__ < 707
|
||||||
|
finiteBitSize :: Bits a => a -> Int
|
||||||
|
finiteBitSize x = bitSize x
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
-- | Convert a modifier mask into a useful string
|
-- | Convert a modifier mask into a useful string
|
||||||
vmask :: KeyMask -> KeyMask -> String
|
vmask :: KeyMask -> KeyMask -> String
|
||||||
vmask numLockMask msk = unwords $
|
vmask numLockMask msk = unwords $
|
||||||
@@ -232,7 +238,7 @@ vmask numLockMask msk = unwords $
|
|||||||
fst $
|
fst $
|
||||||
foldr vmask' ([],msk) masks
|
foldr vmask' ([],msk) masks
|
||||||
where
|
where
|
||||||
masks = map (\m -> (m,show m)) [0..toEnum (bitSize msk - 1)] ++
|
masks = map (\m -> (m,show m)) [0..toEnum (finiteBitSize msk - 1)] ++
|
||||||
[(numLockMask,"num" )
|
[(numLockMask,"num" )
|
||||||
,( lockMask,"lock" )
|
,( lockMask,"lock" )
|
||||||
,(controlMask,"ctrl" )
|
,(controlMask,"ctrl" )
|
||||||
|
Reference in New Issue
Block a user