base 4.14.3.0 → 4.15.0.0
raw patch · 151 files changed
+45885/−37485 lines, 151 filesdep +ghc-bignumdep −integer-gmpdep −integer-simpledep −invalid-cabal-flag-settingsdep ~ghc-primdep ~rtsPVP ok
version bump matches the API change (PVP)
Dependencies added: ghc-bignum
Dependencies removed: integer-gmp, integer-simple, invalid-cabal-flag-settings
Dependency ranges changed: ghc-prim, rts
API changes (from Hackage documentation)
- Control.Exception.Base: absentSumFieldError :: a
- Data.Bits: instance Data.Bits.Bits GHC.Integer.Type.Integer
- Data.Bits: instance Data.Bits.Bits GHC.Natural.Natural
- Data.Data: instance Data.Data.Data GHC.Integer.Type.Integer
- Data.Data: instance Data.Data.Data GHC.Natural.Natural
- Data.Ord: instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Ord.Down a)
- Data.Ord: instance GHC.Real.Integral a => GHC.Real.Integral (Data.Ord.Down a)
- GHC.Enum: instance GHC.Enum.Enum GHC.Integer.Type.Integer
- GHC.Enum: instance GHC.Enum.Enum GHC.Natural.Natural
- GHC.Exts: data BCO# :: TYPE 'UnliftedRep
- GHC.Float: integerLogBase :: Integer -> Integer -> Int
- GHC.Ix: instance GHC.Ix.Ix GHC.Integer.Type.Integer
- GHC.Ix: instance GHC.Ix.Ix GHC.Natural.Natural
- GHC.Natural: NatJ# :: {-# UNPACK #-} !BigNat -> Natural
- GHC.Natural: NatS# :: GmpLimb# -> Natural
- GHC.Natural: instance GHC.Classes.Eq GHC.Natural.Natural
- GHC.Natural: instance GHC.Classes.Ord GHC.Natural.Natural
- GHC.Natural: intToNatural :: Int -> Natural
- GHC.Natural: naturalToInt :: Natural -> Int
- GHC.Natural: wordToNaturalBase :: Word# -> Natural
- GHC.Num: instance GHC.Num.Num GHC.Integer.Type.Integer
- GHC.Num: instance GHC.Num.Num GHC.Natural.Natural
- GHC.Read: instance GHC.Read.Read GHC.Integer.Type.Integer
- GHC.Read: instance GHC.Read.Read GHC.Natural.Natural
- GHC.Real: gcdInt' :: Int -> Int -> Int
- GHC.Real: gcdWord' :: Word -> Word -> Word
- GHC.Real: instance GHC.Real.Integral GHC.Integer.Type.Integer
- GHC.Real: instance GHC.Real.Integral GHC.Natural.Natural
- GHC.Real: instance GHC.Real.Real GHC.Integer.Type.Integer
- GHC.Real: instance GHC.Real.Real GHC.Natural.Natural
- GHC.Show: instance GHC.Show.Show GHC.Integer.Type.Integer
- GHC.Show: instance GHC.Show.Show GHC.Natural.Natural
- Text.Printf: instance Text.Printf.PrintfArg GHC.Integer.Type.Integer
- Text.Printf: instance Text.Printf.PrintfArg GHC.Natural.Natural
+ Control.Monad.Fix: instance Control.Monad.Fix.MonadFix Solo
+ Control.Monad.Zip: instance Control.Monad.Zip.MonadZip Solo
+ Data.Bits: instance Data.Bits.Bits GHC.Num.Integer.Integer
+ Data.Bits: instance Data.Bits.Bits GHC.Num.Natural.Natural
+ Data.Complex: instance Control.Monad.Fix.MonadFix Data.Complex.Complex
+ Data.Complex: instance Control.Monad.Zip.MonadZip Data.Complex.Complex
+ Data.Data: instance Data.Data.Data GHC.Num.Integer.Integer
+ Data.Data: instance Data.Data.Data GHC.Num.Natural.Natural
+ Data.Data: instance Data.Data.Data a => Data.Data.Data (Solo a)
+ Data.Foldable: instance Data.Foldable.Foldable Solo
+ Data.Functor.Classes: instance Data.Functor.Classes.Eq1 Solo
+ Data.Functor.Classes: instance Data.Functor.Classes.Ord1 Solo
+ Data.Functor.Classes: instance Data.Functor.Classes.Read1 Solo
+ Data.Functor.Classes: instance Data.Functor.Classes.Show1 Solo
+ Data.Kind: data FUN
+ Data.List: singleton :: a -> [a]
+ Data.List.NonEmpty: singleton :: a -> NonEmpty a
+ Data.Traversable: instance Data.Traversable.Traversable Solo
+ GHC.Base: instance GHC.Base.Applicative Solo
+ GHC.Base: instance GHC.Base.Functor Solo
+ GHC.Base: instance GHC.Base.Monad Solo
+ GHC.Base: instance GHC.Base.Monoid a => GHC.Base.Monoid (Solo a)
+ GHC.Base: instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Solo a)
+ GHC.ByteOrder: instance GHC.Generics.Generic GHC.ByteOrder.ByteOrder
+ GHC.Conc: BlockedOnIOCompletion :: BlockReason
+ GHC.Conc.IO: interruptIOManager :: IO ()
+ GHC.Conc.Sync: BlockedOnIOCompletion :: BlockReason
+ GHC.Conc.Sync: showThreadId :: ThreadId -> String
+ GHC.Enum: instance GHC.Enum.Enum GHC.Num.Integer.Integer
+ GHC.Enum: instance GHC.Enum.Enum GHC.Num.Natural.Natural
+ GHC.Event.TimeOut: TK :: Unique -> TimeoutKey
+ GHC.Event.TimeOut: instance GHC.Classes.Eq GHC.Event.TimeOut.TimeoutKey
+ GHC.Event.TimeOut: instance GHC.Classes.Ord GHC.Event.TimeOut.TimeoutKey
+ GHC.Event.TimeOut: newtype TimeoutKey
+ GHC.Event.TimeOut: type TimeoutCallback = IO ()
+ GHC.Event.TimeOut: type TimeoutEdit = TimeoutQueue -> TimeoutQueue
+ GHC.Event.TimeOut: type TimeoutQueue = PSQ TimeoutCallback
+ GHC.Exts: SPEC :: SPEC
+ GHC.Exts: SPEC2 :: SPEC
+ GHC.Exts: atomicCasAddrAddr# :: Addr# -> Addr# -> Addr# -> State# d -> (# State# d, Addr# #)
+ GHC.Exts: atomicCasWordAddr# :: Addr# -> Word# -> Word# -> State# d -> (# State# d, Word# #)
+ GHC.Exts: atomicExchangeAddrAddr# :: Addr# -> Addr# -> State# d -> (# State# d, Addr# #)
+ GHC.Exts: atomicExchangeWordAddr# :: Addr# -> Word# -> State# d -> (# State# d, Word# #)
+ GHC.Exts: cstringLength# :: Addr# -> Int#
+ GHC.Exts: data BCO
+ GHC.Exts: data FUN
+ GHC.Exts: data IOPort# a b :: TYPE 'UnliftedRep
+ GHC.Exts: data SPEC
+ GHC.Exts: keepAlive# :: forall (q :: RuntimeRep) (a :: TYPE q) (r :: RuntimeRep) (b :: TYPE r). a -> State# RealWorld -> (State# RealWorld -> b) -> b
+ GHC.Exts: newIOPort# :: State# d -> (# State# d, IOPort# d a #)
+ GHC.Exts: noinline :: a -> a
+ GHC.Exts: readIOPort# :: IOPort# d a -> State# d -> (# State# d, a #)
+ GHC.Exts: sameIOPort# :: IOPort# d a -> IOPort# d a -> Int#
+ GHC.Exts: timesInt2# :: Int# -> Int# -> (# Int#, Int#, Int# #)
+ GHC.Exts: unpackAppendCString# :: Addr# -> [Char] -> [Char]
+ GHC.Exts: unpackCString# :: Addr# -> [Char]
+ GHC.Exts: unpackCStringUtf8# :: Addr# -> [Char]
+ GHC.Exts: unpackFoldrCString# :: Addr# -> (Char -> a -> a) -> a -> a
+ GHC.Exts: unpackNBytes# :: Addr# -> Int# -> [Char]
+ GHC.Exts: writeIOPort# :: IOPort# d a -> a -> State# d -> (# State# d, Int# #)
+ GHC.Float: roundingMode# :: Integer -> Int# -> Int#
+ GHC.ForeignPtr: FinalPtr :: ForeignPtrContents
+ GHC.ForeignPtr: unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
+ GHC.ForeignPtr: withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
+ GHC.Generics: instance GHC.Generics.Generic (Solo a)
+ GHC.Generics: instance GHC.Generics.Generic GHC.Fingerprint.Type.Fingerprint
+ GHC.Generics: instance GHC.Generics.Generic GHC.Stack.Types.SrcLoc
+ GHC.Generics: instance GHC.Generics.Generic GHC.Unicode.GeneralCategory
+ GHC.Generics: instance GHC.Generics.Generic1 Solo
+ GHC.IO.Buffer: [bufOffset] :: Buffer e -> !Word64
+ GHC.IO.Buffer: bufferAddOffset :: Int -> Buffer e -> Buffer e
+ GHC.IO.Buffer: bufferAdjustOffset :: Word64 -> Buffer e -> Buffer e
+ GHC.IO.Buffer: bufferOffset :: Buffer e -> Word64
+ GHC.IO.Handle: hGetContents' :: Handle -> IO String
+ GHC.IO.Handle.Internals: traceIO :: String -> IO ()
+ GHC.IO.Handle.Text: hGetContents' :: Handle -> IO String
+ GHC.IO.Handle.Types: isAppendHandleType :: HandleType -> Bool
+ GHC.IO.StdHandles: openBinaryFile :: FilePath -> IOMode -> IO Handle
+ GHC.IO.StdHandles: openFile :: FilePath -> IOMode -> IO Handle
+ GHC.IO.StdHandles: openFileBlocking :: FilePath -> IOMode -> IO Handle
+ GHC.IO.StdHandles: stderr :: Handle
+ GHC.IO.StdHandles: stdin :: Handle
+ GHC.IO.StdHandles: stdout :: Handle
+ GHC.IO.SubSystem: (<!>) :: a -> a -> a
+ GHC.IO.SubSystem: IoNative :: IoSubSystem
+ GHC.IO.SubSystem: IoPOSIX :: IoSubSystem
+ GHC.IO.SubSystem: conditional :: a -> a -> a
+ GHC.IO.SubSystem: data IoSubSystem
+ GHC.IO.SubSystem: infixl 7 <!>
+ GHC.IO.SubSystem: ioSubSystem :: IoSubSystem
+ GHC.IO.SubSystem: isWindowsNativeIO :: Bool
+ GHC.IO.SubSystem: whenIoSubSystem :: IoSubSystem -> IO () -> IO ()
+ GHC.IO.SubSystem: withIoSubSystem :: (IoSubSystem -> IO a) -> IO a
+ GHC.IO.SubSystem: withIoSubSystem' :: (IoSubSystem -> a) -> a
+ GHC.Integer: absInteger :: Integer -> Integer
+ GHC.Integer: andInteger :: Integer -> Integer -> Integer
+ GHC.Integer: bitInteger :: Int# -> Integer
+ GHC.Integer: compareInteger :: Integer -> Integer -> Ordering
+ GHC.Integer: complementInteger :: Integer -> Integer
+ GHC.Integer: data Integer
+ GHC.Integer: decodeDoubleInteger :: Double# -> (# Integer, Int# #)
+ GHC.Integer: divInteger :: Integer -> Integer -> Integer
+ GHC.Integer: divModInteger :: Integer -> Integer -> (# Integer, Integer #)
+ GHC.Integer: doubleFromInteger :: Integer -> Double#
+ GHC.Integer: encodeDoubleInteger :: Integer -> Int# -> Double#
+ GHC.Integer: encodeFloatInteger :: Integer -> Int# -> Float#
+ GHC.Integer: eqInteger :: Integer -> Integer -> Bool
+ GHC.Integer: eqInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: floatFromInteger :: Integer -> Float#
+ GHC.Integer: geInteger :: Integer -> Integer -> Bool
+ GHC.Integer: geInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: gtInteger :: Integer -> Integer -> Bool
+ GHC.Integer: gtInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: hashInteger :: Integer -> Int#
+ GHC.Integer: integerToInt :: Integer -> Int#
+ GHC.Integer: integerToWord :: Integer -> Word#
+ GHC.Integer: leInteger :: Integer -> Integer -> Bool
+ GHC.Integer: leInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: ltInteger :: Integer -> Integer -> Bool
+ GHC.Integer: ltInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: minusInteger :: Integer -> Integer -> Integer
+ GHC.Integer: modInteger :: Integer -> Integer -> Integer
+ GHC.Integer: negateInteger :: Integer -> Integer
+ GHC.Integer: neqInteger :: Integer -> Integer -> Bool
+ GHC.Integer: neqInteger# :: Integer -> Integer -> Int#
+ GHC.Integer: orInteger :: Integer -> Integer -> Integer
+ GHC.Integer: plusInteger :: Integer -> Integer -> Integer
+ GHC.Integer: popCountInteger :: Integer -> Int#
+ GHC.Integer: quotInteger :: Integer -> Integer -> Integer
+ GHC.Integer: quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
+ GHC.Integer: remInteger :: Integer -> Integer -> Integer
+ GHC.Integer: shiftLInteger :: Integer -> Int# -> Integer
+ GHC.Integer: shiftRInteger :: Integer -> Int# -> Integer
+ GHC.Integer: signumInteger :: Integer -> Integer
+ GHC.Integer: smallInteger :: Int# -> Integer
+ GHC.Integer: testBitInteger :: Integer -> Int# -> Bool
+ GHC.Integer: timesInteger :: Integer -> Integer -> Integer
+ GHC.Integer: wordToInteger :: Word# -> Integer
+ GHC.Integer: xorInteger :: Integer -> Integer -> Integer
+ GHC.Integer.Logarithms: integerLog2# :: Integer -> Int#
+ GHC.Integer.Logarithms: integerLogBase# :: Integer -> Integer -> Int#
+ GHC.Integer.Logarithms: wordLog2# :: Word# -> Int#
+ GHC.Ix: indexError :: Show a => (a, a) -> a -> String -> b
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA, GHC.Ix.Ix aB) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA, GHC.Ix.Ix aB, GHC.Ix.Ix aC) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA, GHC.Ix.Ix aB, GHC.Ix.Ix aC, GHC.Ix.Ix aD) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA, GHC.Ix.Ix aB, GHC.Ix.Ix aC, GHC.Ix.Ix aD, GHC.Ix.Ix aE) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE)
+ GHC.Ix: instance (GHC.Ix.Ix a1, GHC.Ix.Ix a2, GHC.Ix.Ix a3, GHC.Ix.Ix a4, GHC.Ix.Ix a5, GHC.Ix.Ix a6, GHC.Ix.Ix a7, GHC.Ix.Ix a8, GHC.Ix.Ix a9, GHC.Ix.Ix aA, GHC.Ix.Ix aB, GHC.Ix.Ix aC, GHC.Ix.Ix aD, GHC.Ix.Ix aE, GHC.Ix.Ix aF) => GHC.Ix.Ix (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF)
+ GHC.Ix: instance GHC.Ix.Ix GHC.Num.Integer.Integer
+ GHC.Ix: instance GHC.Ix.Ix GHC.Num.Natural.Natural
+ GHC.Natural: BN# :: BigNat# -> BigNat
+ GHC.Natural: [unBigNat] :: BigNat -> BigNat#
+ GHC.Natural: data BigNat
+ GHC.Natural: pattern NatJ# :: BigNat -> Natural
+ GHC.Natural: pattern NatS# :: Word# -> Natural
+ GHC.Num: instance GHC.Num.Num GHC.Num.Integer.Integer
+ GHC.Num: instance GHC.Num.Num GHC.Num.Natural.Natural
+ GHC.Num: quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
+ GHC.OldList: singleton :: a -> [a]
+ GHC.RTS.Flags: IoNative :: IoSubSystem
+ GHC.RTS.Flags: IoPOSIX :: IoSubSystem
+ GHC.RTS.Flags: [ioManager] :: MiscFlags -> IoSubSystem
+ GHC.RTS.Flags: [numIoWorkerThreads] :: MiscFlags -> Word32
+ GHC.RTS.Flags: data IoSubSystem
+ GHC.RTS.Flags: getIoManagerFlag :: IO IoSubSystem
+ GHC.RTS.Flags: instance Foreign.Storable.Storable GHC.RTS.Flags.IoSubSystem
+ GHC.RTS.Flags: instance GHC.Classes.Eq GHC.RTS.Flags.IoSubSystem
+ GHC.RTS.Flags: instance GHC.Enum.Enum GHC.RTS.Flags.IoSubSystem
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.CCFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.ConcFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.DebugFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.DoCostCentres
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.DoHeapProfile
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.DoTrace
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.GCFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.GiveGCStats
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.MiscFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.ParFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.ProfFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.RTSFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.TickyFlags
+ GHC.RTS.Flags: instance GHC.Generics.Generic GHC.RTS.Flags.TraceFlags
+ GHC.RTS.Flags: instance GHC.Show.Show GHC.RTS.Flags.IoSubSystem
+ GHC.Read: instance GHC.Read.Read GHC.Num.Integer.Integer
+ GHC.Read: instance GHC.Read.Read GHC.Num.Natural.Natural
+ GHC.Read: instance GHC.Read.Read a => GHC.Read.Read (Solo a)
+ GHC.Real: instance GHC.Real.Integral GHC.Num.Integer.Integer
+ GHC.Real: instance GHC.Real.Integral GHC.Num.Natural.Natural
+ GHC.Real: instance GHC.Real.Real GHC.Num.Integer.Integer
+ GHC.Real: instance GHC.Real.Real GHC.Num.Natural.Natural
+ GHC.Show: instance GHC.Show.Show GHC.Num.Integer.Integer
+ GHC.Show: instance GHC.Show.Show GHC.Num.Natural.Natural
+ GHC.Show: instance GHC.Show.Show a => GHC.Show.Show (Solo a)
+ GHC.Stats: instance GHC.Generics.Generic GHC.Stats.GCDetails
+ GHC.Stats: instance GHC.Generics.Generic GHC.Stats.RTSStats
+ GHC.Unicode: unicodeVersion :: Version
+ System.IO: getContents' :: IO String
+ System.IO: hGetContents' :: Handle -> IO String
+ System.IO: readFile' :: FilePath -> IO String
+ System.Info: fullCompilerVersion :: Version
+ Text.Printf: instance Text.Printf.PrintfArg GHC.Num.Integer.Integer
+ Text.Printf: instance Text.Printf.PrintfArg GHC.Num.Natural.Natural
+ Unsafe.Coerce: [UnsafeRefl] :: UnsafeEquality a a
+ Unsafe.Coerce: data UnsafeEquality a b
+ Unsafe.Coerce: unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). a -> b
+ Unsafe.Coerce: unsafeCoerceAddr :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'AddrRep). a -> b
+ Unsafe.Coerce: unsafeCoerceUnlifted :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'UnliftedRep). a -> b
+ Unsafe.Coerce: unsafeEqualityProof :: forall a b. UnsafeEquality a b
- Control.Monad.Instances: infixl 1 >>=
+ Control.Monad.Instances: infixl 1 >>
- Data.Coerce: coerce :: forall (k :: RuntimeRep) (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
+ Data.Coerce: coerce :: forall {k :: RuntimeRep} (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
- Data.Functor.Contravariant: contramap :: Contravariant f => (a -> b) -> f b -> f a
+ Data.Functor.Contravariant: contramap :: Contravariant f => (a' -> a) -> f a -> f a'
- GHC.Base: infixl 1 >>=
+ GHC.Base: infixl 1 >>
- GHC.Exts: coerce :: forall (k :: RuntimeRep) (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
+ GHC.Exts: coerce :: forall {k :: RuntimeRep} (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
- GHC.Exts: infix 4 <=##
+ GHC.Exts: infix 4 ~~
- GHC.Exts: mkApUpd0# :: BCO# -> (# a #)
+ GHC.Exts: mkApUpd0# :: BCO -> (# a #)
- GHC.Exts: newBCO# :: ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> State# d -> (# State# d, BCO# #)
+ GHC.Exts: newBCO# :: ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> State# d -> (# State# d, BCO #)
- GHC.Exts: proxy# :: forall k (a :: k). Proxy# a
+ GHC.Exts: proxy# :: forall {k} (a :: k). Proxy# a
- GHC.Exts: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b
+ GHC.Exts: seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
- GHC.Exts: unsafeCoerce# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (a :: TYPE k0) (b :: TYPE k1). a -> b
+ GHC.Exts: unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). a -> b
- GHC.IO.Buffer: Buffer :: !RawBuffer e -> BufferState -> !Int -> !Int -> !Int -> Buffer e
+ GHC.IO.Buffer: Buffer :: !RawBuffer e -> BufferState -> !Int -> !Word64 -> !Int -> !Int -> Buffer e
- GHC.IO.Device: read :: RawIO a => a -> Ptr Word8 -> Int -> IO Int
+ GHC.IO.Device: read :: RawIO a => a -> Ptr Word8 -> Word64 -> Int -> IO Int
- GHC.IO.Device: readNonBlocking :: RawIO a => a -> Ptr Word8 -> Int -> IO (Maybe Int)
+ GHC.IO.Device: readNonBlocking :: RawIO a => a -> Ptr Word8 -> Word64 -> Int -> IO (Maybe Int)
- GHC.IO.Device: seek :: IODevice a => a -> SeekMode -> Integer -> IO ()
+ GHC.IO.Device: seek :: IODevice a => a -> SeekMode -> Integer -> IO Integer
- GHC.IO.Device: write :: RawIO a => a -> Ptr Word8 -> Int -> IO ()
+ GHC.IO.Device: write :: RawIO a => a -> Ptr Word8 -> Word64 -> Int -> IO ()
- GHC.IO.Device: writeNonBlocking :: RawIO a => a -> Ptr Word8 -> Int -> IO Int
+ GHC.IO.Device: writeNonBlocking :: RawIO a => a -> Ptr Word8 -> Word64 -> Int -> IO Int
- GHC.IO.Handle: mkDuplexHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle
+ GHC.IO.Handle: mkDuplexHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle
- GHC.IO.Handle: mkFileHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> IOMode -> Maybe TextEncoding -> NewlineMode -> IO Handle
+ GHC.IO.Handle: mkFileHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> IOMode -> Maybe TextEncoding -> NewlineMode -> IO Handle
- GHC.IO.Handle.Internals: mkDuplexHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle
+ GHC.IO.Handle.Internals: mkDuplexHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle
- GHC.IO.Handle.Internals: mkFileHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> IOMode -> Maybe TextEncoding -> NewlineMode -> IO Handle
+ GHC.IO.Handle.Internals: mkFileHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> IOMode -> Maybe TextEncoding -> NewlineMode -> IO Handle
- GHC.IO.Handle.Internals: mkHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> HandleType -> Bool -> Maybe TextEncoding -> NewlineMode -> Maybe HandleFinalizer -> Maybe (MVar Handle__) -> IO Handle
+ GHC.IO.Handle.Internals: mkHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> HandleType -> Bool -> Maybe TextEncoding -> NewlineMode -> Maybe HandleFinalizer -> Maybe (MVar Handle__) -> IO Handle
- GHC.Natural: wordToNatural# :: Word# -> Natural
+ GHC.Natural: wordToNatural# :: Word -> Natural
- GHC.RTS.Flags: MiscFlags :: RtsTime -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Word -> MiscFlags
+ GHC.RTS.Flags: MiscFlags :: RtsTime -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Word -> IoSubSystem -> Word32 -> MiscFlags
- GHC.TypeLits: sameNat :: (KnownNat a, KnownNat b) => Proxy a -> Proxy b -> Maybe (a :~: b)
+ GHC.TypeLits: sameNat :: (KnownNat a, KnownNat b) => proxy1 a -> proxy2 b -> Maybe (a :~: b)
- GHC.TypeLits: sameSymbol :: (KnownSymbol a, KnownSymbol b) => Proxy a -> Proxy b -> Maybe (a :~: b)
+ GHC.TypeLits: sameSymbol :: (KnownSymbol a, KnownSymbol b) => proxy1 a -> proxy2 b -> Maybe (a :~: b)
- GHC.TypeNats: sameNat :: (KnownNat a, KnownNat b) => Proxy a -> Proxy b -> Maybe (a :~: b)
+ GHC.TypeNats: sameNat :: (KnownNat a, KnownNat b) => proxy1 a -> proxy2 b -> Maybe (a :~: b)
- Prelude: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b
+ Prelude: seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
- Unsafe.Coerce: unsafeCoerce :: a -> b
+ Unsafe.Coerce: unsafeCoerce :: forall (a :: Type) (b :: Type). a -> b
Files
- Control/Applicative.hs +17/−0
- Control/Category.hs +64/−0
- Control/Concurrent.hs-boot +30/−0
- Control/Exception/Base.hs +2/−6
- Control/Monad.hs +11/−26
- Control/Monad/Fix.hs +6/−0
- Control/Monad/IO/Class.hs +34/−0
- Control/Monad/ST/Lazy/Imp.hs +8/−9
- Control/Monad/Zip.hs +6/−0
- Data/Bifoldable.hs +589/−8
- Data/Bifunctor.hs +4/−0
- Data/Bitraversable.hs +67/−2
- Data/Bits.hs +44/−24
- Data/Complex.hs +10/−0
- Data/Data.hs +5/−1
- Data/Fixed.hs +58/−0
- Data/Foldable.hs +2260/−742
- Data/Functor.hs +1/−22
- Data/Functor/Classes.hs +20/−0
- Data/Functor/Contravariant.hs +131/−35
- Data/IORef.hs +1/−1
- Data/Kind.hs +2/−1
- Data/List.hs +1/−0
- Data/List/NonEmpty.hs +7/−0
- Data/Maybe.hs +2/−2
- Data/Monoid.hs +27/−21
- Data/OldList.hs +12/−1
- Data/Ord.hs +29/−6
- Data/STRef.hs +1/−1
- Data/Semigroup.hs +34/−7
- Data/Semigroup/Internal.hs +1/−1
- Data/Semigroup/Internal.hs-boot +1/−1
- Data/Traversable.hs +555/−92
- Data/Type/Equality.hs +1/−1
- Data/Typeable/Internal.hs +37/−28
- Data/Unique.hs +1/−2
- Data/Version.hs-boot +12/−0
- Data/Void.hs +1/−10
- Foreign/ForeignPtr/Imp.hs +0/−25
- Foreign/Marshal/Alloc.hs +4/−25
- Foreign/Marshal/Utils.hs +21/−11
- GHC/Base.hs +167/−120
- GHC/ByteOrder.hs +4/−0
- GHC/Conc/IO.hs +21/−7
- GHC/Conc/POSIX.hs +305/−0
- GHC/Conc/POSIX/Const.hsc +29/−0
- GHC/Conc/Sync.hs +20/−14
- GHC/Conc/Sync.hs-boot +72/−0
- GHC/Conc/WinIO.hs +28/−0
- GHC/Conc/Windows.hs +21/−247
- GHC/ConsoleHandler.hs +0/−162
- GHC/ConsoleHandler.hsc +142/−0
- GHC/Desugar.hs +4/−4
- GHC/Enum.hs +61/−22
- GHC/Err.hs +1/−5
- GHC/Event/Array.hs +31/−14
- GHC/Event/IntTable.hs +8/−5
- GHC/Event/Internal.hs +17/−135
- GHC/Event/Internal/Types.hs +160/−0
- GHC/Event/Manager.hs +2/−15
- GHC/Event/Thread.hs +3/−3
- GHC/Event/TimeOut.hs +40/−0
- GHC/Event/TimerManager.hs +3/−15
- GHC/Event/Windows.hsc +1291/−0
- GHC/Event/Windows/Clock.hs +55/−0
- GHC/Event/Windows/ConsoleEvent.hsc +72/−0
- GHC/Event/Windows/FFI.hsc +469/−0
- GHC/Event/Windows/ManagedThreadPool.hs +93/−0
- GHC/Event/Windows/Thread.hs +35/−0
- GHC/ExecutionStack/Internal.hsc +1/−1
- GHC/Exts.hs +22/−6
- GHC/Float.hs +85/−41
- GHC/Float/ConversionUtils.hs +7/−7
- GHC/Float/RealFracMethods.hs +26/−26
- GHC/Foreign.hs +13/−51
- GHC/ForeignPtr.hs +240/−35
- GHC/Generics.hs +20/−2
- GHC/IO.hs +6/−5
- GHC/IO.hs-boot +1/−1
- GHC/IO/Buffer.hs +55/−13
- GHC/IO/BufferedIO.hs +16/−8
- GHC/IO/Device.hs +19/−16
- GHC/IO/Encoding.hs +12/−2
- GHC/IO/Encoding/CodePage.hs +8/−11
- GHC/IO/Encoding/CodePage/API.hs +5/−13
- GHC/IO/FD.hs +51/−41
- GHC/IO/Handle.hs +44/−19
- GHC/IO/Handle/FD.hs +5/−0
- GHC/IO/Handle/Internals.hs +83/−25
- GHC/IO/Handle/Lock.hs +1/−1
- GHC/IO/Handle/Lock/Windows.hsc +66/−17
- GHC/IO/Handle/Text.hs +228/−95
- GHC/IO/Handle/Types.hs +9/−2
- GHC/IO/Handle/Windows.hs +235/−0
- GHC/IO/StdHandles.hs +73/−0
- GHC/IO/StdHandles.hs-boot +23/−0
- GHC/IO/SubSystem.hs +79/−0
- GHC/IO/Windows/Encoding.hs +218/−0
- GHC/IO/Windows/Handle.hsc +966/−0
- GHC/IO/Windows/Paths.hs +49/−0
- GHC/IOPort.hs +122/−0
- GHC/Int.hs +34/−34
- GHC/Integer.hs +219/−0
- GHC/Integer/Logarithms.hs +24/−0
- GHC/Ix.hs +428/−1
- GHC/List.hs +450/−84
- GHC/Maybe.hs +1/−1
- GHC/Natural.hs +114/−549
- GHC/Num.hs +33/−19
- GHC/OverloadedLabels.hs +2/−2
- GHC/Ptr.hs +5/−6
- GHC/RTS/Flags.hsc +82/−2
- GHC/Read.hs +6/−2
- GHC/Real.hs +74/−59
- GHC/ST.hs +2/−2
- GHC/Show.hs +11/−8
- GHC/Stable.hs +4/−2
- GHC/Stack/Types.hs +2/−3
- GHC/StaticPtr.hs +5/−4
- GHC/Stats.hsc +4/−0
- GHC/TopHandler.hs +1/−1
- GHC/TypeLits.hs +1/−1
- GHC/TypeNats.hs +3/−3
- GHC/Unicode.hs +7/−0
- GHC/Windows.hs +64/−13
- GHC/Word.hs +55/−21
- Numeric.hs +2/−0
- Numeric/Natural.hs +1/−1
- System/CPUTime.hsc +1/−1
- System/IO.hs +69/−10
- System/Info.hs +69/−10
- System/Posix/Internals.hs +1/−1
- System/Timeout.hs +1/−1
- Text/ParserCombinators/ReadPrec.hs +3/−3
- Text/Printf.hs +1/−0
- Unsafe/Coerce.hs +298/−49
- base.cabal +57/−31
- cbits/IOutils.c +484/−0
- cbits/WCsubst.c +30/−81
- cbits/Win32Utils.c +98/−4
- cbits/consUtils.c +5/−27
- cbits/fs.c +1/−1
- changelog.md +40/−12
- config.guess +25/−27
- config.sub +4/−8
- configure +32940/−33998
- configure.ac +2/−2
- include/HsBaseConfig.h.in +22/−81
- include/consUtils.h +1/−2
- include/fs.h +0/−1
- include/winio_structs.h +40/−0
Control/Applicative.hs view
@@ -141,5 +141,22 @@ -- extra functions -- | One or none.+--+-- It is useful for modelling any computation that is allowed to fail.+--+-- ==== __Examples__+--+-- Using the 'Alternative' instance of `Control.Monad.Except`, the following functions:+--+-- >>> canFail = throwError "it failed" :: Except String Int+-- >>> final = return 42 :: Except String Int+--+-- Can be combined by allowing the first function to fail:+--+-- >>> runExcept $ canFail *> final+-- Left "it failed"+-- >>> runExcept $ optional canFail *> final+-- Right 42+ optional :: Alternative f => f a -> f (Maybe a) optional v = Just <$> v <|> pure Nothing
Control/Category.hs view
@@ -77,3 +77,67 @@ -- | Left-to-right composition (>>>) :: Category cat => cat a b -> cat b c -> cat a c f >>> g = g . f+{-# INLINE (>>>) #-} -- see Note [INLINE on >>>]++{- Note [INLINE on >>>]+~~~~~~~~~~~~~~~~~~~~~~~+It’s crucial that we include an INLINE pragma on >>>, which may be+surprising. After all, its unfolding is tiny, so GHC will be extremely+keen to inline it even without the pragma. Indeed, it is actually+/too/ keen: unintuitively, the pragma is needed to rein in inlining,+not to encourage it.++How is that possible? The difference lies entirely in whether GHC will+inline unsaturated calls. With no pragma at all, we get the following+unfolding guidance:+ ALWAYS_IF(arity=3,unsat_ok=True,boring_ok=True)+But with the pragma, we restrict inlining to saturated calls:+ ALWAYS_IF(arity=3,unsat_ok=False,boring_ok=True)+Why does this matter? Because the programmer may have put an INLINE+pragma on (.):++ instance Functor f => Category (Blah f) where+ id = ...+ Blah f . Blah g = buildBlah (\x -> ...)+ {-# INLINE (.) #-}++The intent here is to inline (.) at all saturated call sites. Perhaps+there is a RULE on buildBlah the programmer wants to fire, or maybe+they just expect the inlining to expose further simplifications.+Either way, code that uses >>> should not defeat this inlining, but if+we inline unsaturated calls, it might! Consider:++ let comp = (>>>) ($fCategoryBlah $dFunctor) in f `comp` (g `comp` h)++While simplifying this expression, we’ll start with the RHS of comp.+Without the INLINE pragma on >>>, we’ll inline it immediately, even+though it isn’t saturated:++ let comp = \f g -> $fCategoryBlah_$c. $dFunctor g f+ in f `comp` (g `comp` h)++Now `$fCategoryBlah_$c. $dFunctor g f` /is/ a fully-saturated call, so+it will get inlined immediately, too:++ let comp = \(Blah g) (Blah f) -> buildBlah (\x -> ...)+ in f `comp` (g `comp` h)++All okay so far. But if the RHS of (.) is large, comp won’t be inlined+at its use sites, and any RULEs on `buildBlah` will never fire. Bad!++What happens differently with the INLINE pragma on >>>? Well, we won’t+inline >>> immediately, since it isn’t saturated, which means comp’s+unfolding will be tiny. GHC will inline it at both use sites:++ (>>>) ($fCategoryBlah $dFunctor) f+ ((>>>) ($fCategoryBlah $dFunctor) g h)++And now the calls to >>> are saturated, so they’ll be inlined,+followed by (.), and any RULEs can fire as desired. Problem solved.++This situation might seem academic --- who would ever write a+definition like comp? Probably nobody, but GHC generates such+definitions when desugaring proc notation, which causes real problems+(see #18013). That could be fixed by changing the proc desugaring, but+fixing it this way is the Right Thing, it might benefit other programs+in more subtle ways too, and it’s easier to boot. -}
+ Control/Concurrent.hs-boot view
@@ -0,0 +1,30 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}++-----------------------------------------------------------------------------+-- |+-- Module : Control.Concurrent+-- Copyright : (c) The University of Glasgow 2018-2019+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable (concurrency)+--+-- A common interface to a collection of useful concurrency+-- abstractions.+--+-----------------------------------------------------------------------------+module Control.Concurrent (+ -- * Bound Threads+ rtsSupportsBoundThreads,+ forkOS+ ) where++import Data.Bool++import GHC.IO+import GHC.Conc.Sync++rtsSupportsBoundThreads :: Bool+forkOS :: IO () -> IO ThreadId
Control/Exception/Base.hs view
@@ -95,7 +95,7 @@ -- * Calls for GHC runtime recSelError, recConError, runtimeError, nonExhaustiveGuardsError, patError, noMethodBindingError,- absentError, absentSumFieldError, typeError,+ absentError, typeError, nonTermination, nestedAtomically, ) where @@ -166,7 +166,7 @@ -- | Similar to 'catch', but returns an 'Either' result which is -- @('Right' a)@ if no exception of type @e@ was raised, or @('Left' ex)@ -- if an exception of type @e@ was raised and its value is @ex@.--- If any other type of exception is raised than it will be propogated+-- If any other type of exception is raised then it will be propagated -- up to the next enclosing exception handler. -- -- > try a = catch (Right `liftM` a) (return . Left)@@ -398,7 +398,3 @@ -- GHC's RTS calls this nestedAtomically :: SomeException nestedAtomically = toException NestedAtomically---- Introduced by unarise for unused unboxed sum fields-absentSumFieldError :: a-absentSumFieldError = absentError " in unboxed sum."#
Control/Monad.hs view
@@ -164,17 +164,6 @@ -- | Repeat an action indefinitely. ----- Using @ApplicativeDo@: \'@'forever' as@\' can be understood as the--- pseudo-@do@ expression------ @--- do as--- as--- ..--- @------ with @as@ repeating.--- -- ==== __Examples__ -- -- A common use of 'forever' is to process input from network sockets,@@ -197,6 +186,10 @@ -- echo client = 'forever' $ -- hGetLine client >>= hPutStrLn client -- @+--+-- Note that "forever" isn't necessarily non-terminating.+-- If the action is in a @'MonadPlus'@ and short-circuits after some number of iterations.+-- then @'forever'@ actually returns `mzero`, effectively short-circuiting its caller. forever :: (Applicative f) => f a -> f b {-# INLINE forever #-} forever a = let a' = a *> a' in a'@@ -284,22 +277,14 @@ Core: https://gitlab.haskell.org/ghc/ghc/issues/11795#note_118976 -} --- | @'replicateM' n act@ performs the action @n@ times,--- gathering the results.------ Using @ApplicativeDo@: \'@'replicateM' 5 as@\' can be understood as--- the @do@ expression------ @--- do a1 <- as--- a2 <- as--- a3 <- as--- a4 <- as--- a5 <- as--- pure [a1,a2,a3,a4,a5]--- @+-- | @'replicateM' n act@ performs the action @act@ @n@ times,+-- and then returns the list of results: ----- Note the @Applicative@ constraint.+-- ==== __Examples__+-- >>> replicateM 3 (putStrLn "a")+-- a+-- a+-- a replicateM :: (Applicative m) => Int -> m a -> m [a] {-# INLINABLE replicateM #-} {-# SPECIALISE replicateM :: Int -> IO a -> IO [a] #-}
Control/Monad/Fix.hs view
@@ -33,6 +33,7 @@ import GHC.Base ( Monad, NonEmpty(..), errorWithoutStackTrace, (.) ) import GHC.Generics import GHC.List ( head, tail )+import GHC.Tuple (Solo (..)) import Control.Monad.ST.Imp import System.IO @@ -62,6 +63,11 @@ mfix :: (a -> m a) -> m a -- Instances of MonadFix for Prelude monads++-- | @since 4.15+instance MonadFix Solo where+ mfix f = let a = f (unSolo a) in a+ where unSolo (Solo x) = x -- | @since 2.01 instance MonadFix Maybe where
Control/Monad/IO/Class.hs view
@@ -30,8 +30,42 @@ class (Monad m) => MonadIO m where -- | Lift a computation from the 'IO' monad.+ -- This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations+ -- (i.e. 'IO' is the base monad for the stack).+ --+ -- === __Example__+ --+ --+ -- > import Control.Monad.Trans.State -- from the "transformers" library+ -- >+ -- > printState :: Show s => StateT s IO ()+ -- > printState = do+ -- > state <- get+ -- > liftIO $ print state+ --+ --+ -- Had we omitted @'liftIO'@, we would have ended up with this error:+ --+ -- > • Couldn't match type ‘IO’ with ‘StateT s IO’+ -- > Expected type: StateT s IO ()+ -- > Actual type: IO ()+ --+ -- The important part here is the mismatch between @StateT s IO ()@ and @'IO' ()@.+ --+ -- Luckily, we know of a function that takes an @'IO' a@ and returns an @(m a)@: @'liftIO'@,+ -- enabling us to run the program and see the expected results:+ --+ -- @+ -- > evalStateT printState "hello"+ -- "hello"+ --+ -- > evalStateT printState 3+ -- 3+ -- @+ -- liftIO :: IO a -> m a -- | @since 4.9.0.0 instance MonadIO IO where liftIO = id+
Control/Monad/ST/Lazy/Imp.hs view
@@ -8,7 +8,7 @@ -- Module : Control.Monad.ST.Lazy.Imp -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (requires universal quantification for runST)@@ -44,12 +44,11 @@ import qualified GHC.ST as GHC.ST import GHC.Base-import qualified Control.Monad.Fail as Fail --- | The lazy @'ST' monad.--- The ST monad allows for destructive updates, but is escapable (unlike IO).+-- | The lazy @'ST'@ monad.+-- The ST monad allows for destructive updates, but is escapable (unlike @IO@). -- A computation of type @'ST' s a@ returns a value of type @a@, and--- execute in "thread" @s@. The @s@ parameter is either+-- executes in "thread" @s@. The @s@ parameter is either -- -- * an uninstantiated type variable (inside invocations of 'runST'), or --@@ -192,7 +191,7 @@ unST (k r) new_s -- | @since 4.10-instance Fail.MonadFail (ST s) where+instance MonadFail (ST s) where fail s = errorWithoutStackTrace s -- | Return the value computed by an 'ST' computation.@@ -205,8 +204,8 @@ -- inside the computation. -- Note that if @f@ is strict, @'fixST' f = _|_@. fixST :: (a -> ST s a) -> ST s a-fixST m = ST (\ s -> - let +fixST m = ST (\ s ->+ let q@(r,_s') = unST (m r) s in q) -- Why don't we need unsafePerformIO in fixST? We create a thunk, q,@@ -233,7 +232,7 @@ (# s', a #) -> (a, S# s') -- See Note [Lazy ST: not producing lazy pairs] -{-| +{-| Convert a lazy 'ST' computation into a strict one. -} lazyToStrictST :: ST s a -> ST.ST s a
Control/Monad/Zip.hs view
@@ -25,6 +25,7 @@ import Data.Proxy import qualified Data.List.NonEmpty as NE import GHC.Generics+import GHC.Tuple (Solo (..)) -- | Instances should satisfy the laws: --@@ -70,6 +71,11 @@ instance MonadZip Identity where mzipWith = liftM2 munzip (Identity (a, b)) = (Identity a, Identity b)++-- | @since 4.15.0.0+instance MonadZip Solo where+ mzipWith = liftM2+ munzip (Solo (a, b)) = (Solo a, Solo b) -- | @since 4.8.0.0 instance MonadZip Dual where
Data/Bifoldable.hs view
@@ -55,9 +55,16 @@ import Data.Monoid import GHC.Generics (K1(..)) +-- $setup+-- >>> import Prelude+-- >>> import Data.Char+-- >>> import Data.Monoid (Product (..), Sum (..))+-- >>> data BiList a b = BiList [a] [b]+-- >>> instance Bifoldable BiList where bifoldr f g z (BiList as bs) = foldr f (foldr g z bs) as+ -- | 'Bifoldable' identifies foldable structures with two different varieties -- of elements (as opposed to 'Foldable', which has one variety of element).--- Common examples are 'Either' and '(,)':+-- Common examples are 'Either' and @(,)@: -- -- > instance Bifoldable Either where -- > bifoldMap f _ (Left a) = f a@@ -66,6 +73,15 @@ -- > instance Bifoldable (,) where -- > bifoldr f g z (a, b) = f a (g b z) --+-- Some examples below also use the following BiList to showcase empty+-- Bifoldable behaviors when relevant ('Either' and '(,)' containing always exactly+-- resp. 1 and 2 elements):+--+-- > data BiList a b = BiList [a] [b]+-- >+-- > instance Bifoldable BiList where+-- > bifoldr f g z (BiList as bs) = foldr f (foldr g z bs) as+-- -- A minimal 'Bifoldable' definition consists of either 'bifoldMap' or -- 'bifoldr'. When defining more than this minimal set, one should ensure -- that the following identities hold:@@ -96,6 +112,25 @@ -- -- @'bifold' ≡ 'bifoldMap' 'id' 'id'@ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> bifold (Right [1, 2, 3])+ -- [1,2,3]+ --+ -- >>> bifold (Left [5, 6])+ -- [5,6]+ --+ -- >>> bifold ([1, 2, 3], [4, 5])+ -- [1,2,3,4,5]+ --+ -- >>> bifold (Product 6, Product 7)+ -- Product {getProduct = 42}+ --+ -- >>> bifold (Sum 6, Sum 7)+ -- Sum {getSum = 13}+ -- -- @since 4.10.0.0 bifold :: Monoid m => p m m -> m bifold = bifoldMap id id@@ -103,9 +138,21 @@ -- | Combines the elements of a structure, given ways of mapping them to a -- common monoid. --- -- @'bifoldMap' f g- -- ≡ 'bifoldr' ('mappend' . f) ('mappend' . g) 'mempty'@+ -- @'bifoldMap' f g ≡ 'bifoldr' ('mappend' . f) ('mappend' . g) 'mempty'@ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> bifoldMap (take 3) (fmap digitToInt) ([1..], "89")+ -- [1,2,3,8,9]+ --+ -- >>> bifoldMap (take 3) (fmap digitToInt) (Left [1..])+ -- [1,2,3]+ --+ -- >>> bifoldMap (take 3) (fmap digitToInt) (Right "89")+ -- [8,9]+ -- -- @since 4.10.0.0 bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> p a b -> m bifoldMap f g = bifoldr (mappend . f) (mappend . g) mempty@@ -117,6 +164,24 @@ -- -- @'bifoldr' f g z ≡ 'foldr' ('either' f g) z . toEitherList@ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- @+ -- > bifoldr (+) (*) 3 (5, 7)+ -- 26 -- 5 + (7 * 3)+ --+ -- > bifoldr (+) (*) 3 (7, 5)+ -- 22 -- 7 + (5 * 3)+ --+ -- > bifoldr (+) (*) 3 (Right 5)+ -- 15 -- 5 * 3+ --+ -- > bifoldr (+) (*) 3 (Left 5)+ -- 8 -- 5 + 3+ -- @+ -- -- @since 4.10.0.0 bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c bifoldr f g z t = appEndo (bifoldMap (Endo #. f) (Endo #. g) t) z@@ -133,6 +198,24 @@ -- force the "inner" results, resulting in a thunk chain which then must be -- evaluated from the outside-in. --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- @+ -- > bifoldl (+) (*) 3 (5, 7)+ -- 56 -- (5 + 3) * 7+ --+ -- > bifoldl (+) (*) 3 (7, 5)+ -- 50 -- (7 + 3) * 5+ --+ -- > bifoldl (+) (*) 3 (Right 5)+ -- 15 -- 5 * 3+ --+ -- > bifoldl (+) (*) 3 (Left 5)+ -- 8 -- 5 + 3+ -- @+ -- -- @since 4.10.0.0 bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c bifoldl f g z t = appEndo (getDual (bifoldMap (Dual . Endo . flip f)@@ -187,6 +270,32 @@ -- | A variant of 'bifoldr' that has no base case, -- and thus may only be applied to non-empty structures. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bifoldr1 (+) (5, 7)+-- 12+--+-- >>> bifoldr1 (+) (Right 7)+-- 7+--+-- >>> bifoldr1 (+) (Left 5)+-- 5+--+-- @+-- > bifoldr1 (+) (BiList [1, 2] [3, 4])+-- 10 -- 1 + (2 + (3 + 4))+-- @+--+-- >>> bifoldr1 (+) (BiList [1, 2] [])+-- 3+--+-- On empty structures, this function throws an exception:+--+-- >>> bifoldr1 (+) (BiList [] [])+-- *** Exception: bifoldr1: empty structure+-- -- @since 4.10.0.0 bifoldr1 :: Bifoldable t => (a -> a -> a) -> t a a -> a bifoldr1 f xs = fromMaybe (error "bifoldr1: empty structure")@@ -222,6 +331,32 @@ -- | A variant of 'bifoldl' that has no base case, -- and thus may only be applied to non-empty structures. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bifoldl1 (+) (5, 7)+-- 12+--+-- >>> bifoldl1 (+) (Right 7)+-- 7+--+-- >>> bifoldl1 (+) (Left 5)+-- 5+--+-- @+-- > bifoldl1 (+) (BiList [1, 2] [3, 4])+-- 10 -- ((1 + 2) + 3) + 4+-- @+--+-- >>> bifoldl1 (+) (BiList [1, 2] [])+-- 3+--+-- On empty structures, this function throws an exception:+--+-- >>> bifoldl1 (+) (BiList [] [])+-- *** Exception: bifoldl1: empty structure+-- -- @since 4.10.0.0 bifoldl1 :: Bifoldable t => (a -> a -> a) -> t a a -> a bifoldl1 f xs = fromMaybe (error "bifoldl1: empty structure")@@ -233,6 +368,23 @@ -- | Left associative monadic bifold over a structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 ("Hello", True)+-- "Hello"+-- "True"+-- 42+--+-- >>> bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 (Right True)+-- "True"+-- 42+--+-- >>> bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 (Left "Hello")+-- "Hello"+-- 42+-- -- @since 4.10.0.0 bifoldlM :: (Bifoldable t, Monad m) => (a -> b -> m a) -> (a -> c -> m a) -> a -> t b c -> m a@@ -244,6 +396,20 @@ -- actions from left to right, and ignore the results. For a version that -- doesn't ignore the results, see 'Data.Bitraversable.bitraverse'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bitraverse_ print (print . show) ("Hello", True)+-- "Hello"+-- "True"+--+-- >>> bitraverse_ print (print . show) (Right True)+-- "True"+--+-- >>> bitraverse_ print (print . show) (Left "Hello")+-- "Hello"+-- -- @since 4.10.0.0 bitraverse_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()@@ -252,10 +418,20 @@ -- | As 'bitraverse_', but with the structure as the primary argument. For a -- version that doesn't ignore the results, see 'Data.Bitraversable.bifor'. ----- >>> > bifor_ ('a', "bc") print (print . reverse)--- 'a'--- "cb"+-- ==== __Examples__ --+-- Basic usage:+--+-- >>> bifor_ ("Hello", True) print (print . show)+-- "Hello"+-- "True"+--+-- >>> bifor_ (Right True) print (print . show)+-- "True"+--+-- >>> bifor_ (Left "Hello") print (print . show)+-- "Hello"+-- -- @since 4.10.0.0 bifor_ :: (Bifoldable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f ()@@ -285,12 +461,42 @@ -- results. For a version that doesn't ignore the results, see -- 'Data.Bitraversable.bisequence'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bisequence_ (print "Hello", print "World")+-- "Hello"+-- "World"+--+-- >>> bisequence_ (Left (print "Hello"))+-- "Hello"+--+-- >>> bisequence_ (Right (print "World"))+-- "World"+-- -- @since 4.10.0.0 bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f () bisequence_ = bifoldr (*>) (*>) (pure ()) -- | The sum of a collection of actions, generalizing 'biconcat'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biasum (Nothing, Nothing)+-- Nothing+--+-- >>> biasum (Nothing, Just 42)+-- Just 42+--+-- >>> biasum (Just 18, Nothing)+-- Just 18+--+-- >>> biasum (Just 18, Just 42)+-- Just 18+-- -- @since 4.10.0.0 biasum :: (Bifoldable t, Alternative f) => t (f a) (f a) -> f a biasum = bifoldr (<|>) (<|>) empty@@ -303,36 +509,138 @@ -- | Collects the list of elements of a structure, from left to right. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biList (18, 42)+-- [18,42]+--+-- >>> biList (Left 18)+-- [18]+-- -- @since 4.10.0.0 biList :: Bifoldable t => t a a -> [a] biList = bifoldr (:) (:) [] -- | Test whether the structure is empty. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> binull (18, 42)+-- False+--+-- >>> binull (Right 42)+-- False+--+-- >>> binull (BiList [] [])+-- True+-- -- @since 4.10.0.0 binull :: Bifoldable t => t a b -> Bool binull = bifoldr (\_ _ -> False) (\_ _ -> False) True -- | Returns the size/length of a finite structure as an 'Int'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bilength (True, 42)+-- 2+--+-- >>> bilength (Right 42)+-- 1+--+-- >>> bilength (BiList [1,2,3] [4,5])+-- 5+--+-- >>> bilength (BiList [] [])+-- 0+--+-- On infinite structures, this function hangs:+--+-- @+-- > bilength (BiList [1..] [])+-- * Hangs forever *+-- @+-- -- @since 4.10.0.0 bilength :: Bifoldable t => t a b -> Int bilength = bifoldl' (\c _ -> c+1) (\c _ -> c+1) 0 -- | Does the element occur in the structure? --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bielem 42 (17, 42)+-- True+--+-- >>> bielem 42 (17, 43)+-- False+--+-- >>> bielem 42 (Left 42)+-- True+--+-- >>> bielem 42 (Right 13)+-- False+--+-- >>> bielem 42 (BiList [1..5] [1..100])+-- True+--+-- >>> bielem 42 (BiList [1..5] [1..41])+-- False+-- -- @since 4.10.0.0 bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool bielem x = biany (== x) (== x) -- | Reduces a structure of lists to the concatenation of those lists. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biconcat ([1, 2, 3], [4, 5])+-- [1,2,3,4,5]+--+-- >>> biconcat (Left [1, 2, 3])+-- [1,2,3]+--+-- >>> biconcat (BiList [[1, 2, 3, 4, 5], [6, 7, 8]] [[9]])+-- [1,2,3,4,5,6,7,8,9]+-- -- @since 4.10.0.0 biconcat :: Bifoldable t => t [a] [a] -> [a] biconcat = bifold -- | The largest element of a non-empty structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bimaximum (42, 17)+-- 42+--+-- >>> bimaximum (Right 42)+-- 42+--+-- >>> bimaximum (BiList [13, 29, 4] [18, 1, 7])+-- 29+--+-- >>> bimaximum (BiList [13, 29, 4] [])+-- 29+--+-- On empty structures, this function throws an exception:+--+-- >>> bimaximum (BiList [] [])+-- *** Exception: bimaximum: empty structure+-- -- @since 4.10.0.0 bimaximum :: forall t a. (Bifoldable t, Ord a) => t a a -> a bimaximum = fromMaybe (error "bimaximum: empty structure") .@@ -341,6 +649,27 @@ -- | The least element of a non-empty structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biminimum (42, 17)+-- 17+--+-- >>> biminimum (Right 42)+-- 42+--+-- >>> biminimum (BiList [13, 29, 4] [18, 1, 7])+-- 1+--+-- >>> biminimum (BiList [13, 29, 4] [])+-- 4+--+-- On empty structures, this function throws an exception:+--+-- >>> biminimum (BiList [] [])+-- *** Exception: biminimum: empty structure+-- -- @since 4.10.0.0 biminimum :: forall t a. (Bifoldable t, Ord a) => t a a -> a biminimum = fromMaybe (error "biminimum: empty structure") .@@ -349,6 +678,25 @@ -- | The 'bisum' function computes the sum of the numbers of a structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bisum (42, 17)+-- 59+--+-- >>> bisum (Right 42)+-- 42+--+-- >>> bisum (BiList [13, 29, 4] [18, 1, 7])+-- 72+--+-- >>> bisum (BiList [13, 29, 4] [])+-- 46+--+-- >>> bisum (BiList [] [])+-- 0+-- -- @since 4.10.0.0 bisum :: (Bifoldable t, Num a) => t a a -> a bisum = getSum #. bifoldMap Sum Sum@@ -356,6 +704,25 @@ -- | The 'biproduct' function computes the product of the numbers of a -- structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biproduct (42, 17)+-- 714+--+-- >>> biproduct (Right 42)+-- 42+--+-- >>> biproduct (BiList [13, 29, 4] [18, 1, 7])+-- 190008+--+-- >>> biproduct (BiList [13, 29, 4] [])+-- 1508+--+-- >>> biproduct (BiList [] [])+-- 1+-- -- @since 4.10.0.0 biproduct :: (Bifoldable t, Num a) => t a a -> a biproduct = getProduct #. bifoldMap Product Product@@ -363,6 +730,19 @@ -- | Given a means of mapping the elements of a structure to lists, computes the -- concatenation of all such lists in order. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biconcatMap (take 3) (fmap digitToInt) ([1..], "89")+-- [1,2,3,8,9]+--+-- >>> biconcatMap (take 3) (fmap digitToInt) (Left [1..])+-- [1,2,3]+--+-- >>> biconcatMap (take 3) (fmap digitToInt) (Right "89")+-- [8,9]+-- -- @since 4.10.0.0 biconcatMap :: Bifoldable t => (a -> [c]) -> (b -> [c]) -> t a b -> [c] biconcatMap = bifoldMap@@ -371,6 +751,43 @@ -- result to be 'True', the container must be finite; 'False', however, -- results from a 'False' value finitely far from the left end. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biand (True, False)+-- False+--+-- >>> biand (True, True)+-- True+--+-- >>> biand (Left True)+-- True+--+-- Empty structures yield 'True':+--+-- >>> biand (BiList [] [])+-- True+--+-- A 'False' value finitely far from the left end yields 'False' (short circuit):+--+-- >>> biand (BiList [True, True, False, True] (repeat True))+-- False+--+-- A 'False' value infinitely far from the left end hangs:+--+-- @+-- > biand (BiList (repeat True) [False])+-- * Hangs forever *+-- @+--+-- An infinitely 'True' value hangs:+--+-- @+-- > biand (BiList (repeat True) [])+-- * Hangs forever *+-- @+-- -- @since 4.10.0.0 biand :: Bifoldable t => t Bool Bool -> Bool biand = getAll #. bifoldMap All All@@ -379,20 +796,108 @@ -- result to be 'False', the container must be finite; 'True', however, -- results from a 'True' value finitely far from the left end. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bior (True, False)+-- True+--+-- >>> bior (False, False)+-- False+--+-- >>> bior (Left True)+-- True+--+-- Empty structures yield 'False':+--+-- >>> bior (BiList [] [])+-- False+--+-- A 'True' value finitely far from the left end yields 'True' (short circuit):+--+-- >>> bior (BiList [False, False, True, False] (repeat False))+-- True+--+-- A 'True' value infinitely far from the left end hangs:+--+-- @+-- > bior (BiList (repeat False) [True])+-- * Hangs forever *+-- @+--+-- An infinitely 'False' value hangs:+--+-- @+-- > bior (BiList (repeat False) [])+-- * Hangs forever *+-- @+-- -- @since 4.10.0.0 bior :: Bifoldable t => t Bool Bool -> Bool bior = getAny #. bifoldMap Any Any -- | Determines whether any element of the structure satisfies its appropriate--- predicate argument.+-- predicate argument. Empty structures yield 'False'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biany even isDigit (27, 't')+-- False+--+-- >>> biany even isDigit (27, '8')+-- True+--+-- >>> biany even isDigit (26, 't')+-- True+--+-- >>> biany even isDigit (Left 27)+-- False+--+-- >>> biany even isDigit (Left 26)+-- True+--+-- >>> biany even isDigit (BiList [27, 53] ['t', '8'])+-- True+--+-- Empty structures yield 'False':+--+-- >>> biany even isDigit (BiList [] [])+-- False+-- -- @since 4.10.0.0 biany :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool biany p q = getAny #. bifoldMap (Any . p) (Any . q) -- | Determines whether all elements of the structure satisfy their appropriate--- predicate argument.+-- predicate argument. Empty structures yield 'True'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biall even isDigit (27, 't')+-- False+--+-- >>> biall even isDigit (26, '8')+-- True+--+-- >>> biall even isDigit (Left 27)+-- False+--+-- >>> biall even isDigit (Left 26)+-- True+--+-- >>> biall even isDigit (BiList [26, 52] ['3', '8'])+-- True+--+-- Empty structures yield 'True':+--+-- >>> biall even isDigit (BiList [] [])+-- True+-- -- @since 4.10.0.0 biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool biall p q = getAll #. bifoldMap (All . p) (All . q)@@ -400,6 +905,24 @@ -- | The largest element of a non-empty structure with respect to the -- given comparison function. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bimaximumBy compare (42, 17)+-- 42+--+-- >>> bimaximumBy compare (Left 17)+-- 17+--+-- >>> bimaximumBy compare (BiList [42, 17, 23] [-5, 18])+-- 42+--+-- On empty structures, this function throws an exception:+--+-- >>> bimaximumBy compare (BiList [] [])+-- *** Exception: bifoldr1: empty structure+-- -- @since 4.10.0.0 bimaximumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a bimaximumBy cmp = bifoldr1 max'@@ -410,6 +933,24 @@ -- | The least element of a non-empty structure with respect to the -- given comparison function. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> biminimumBy compare (42, 17)+-- 17+--+-- >>> biminimumBy compare (Left 17)+-- 17+--+-- >>> biminimumBy compare (BiList [42, 17, 23] [-5, 18])+-- -5+--+-- On empty structures, this function throws an exception:+--+-- >>> biminimumBy compare (BiList [] [])+-- *** Exception: bifoldr1: empty structure+-- -- @since 4.10.0.0 biminimumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a biminimumBy cmp = bifoldr1 min'@@ -419,6 +960,28 @@ -- | 'binotElem' is the negation of 'bielem'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> binotElem 42 (17, 42)+-- False+--+-- >>> binotElem 42 (17, 43)+-- True+--+-- >>> binotElem 42 (Left 42)+-- False+--+-- >>> binotElem 42 (Right 13)+-- True+--+-- >>> binotElem 42 (BiList [1..5] [1..100])+-- False+--+-- >>> binotElem 42 (BiList [1..5] [1..41])+-- True+-- -- @since 4.10.0.0 binotElem :: (Bifoldable t, Eq a) => a -> t a a-> Bool binotElem x = not . bielem x@@ -426,6 +989,24 @@ -- | The 'bifind' function takes a predicate and a structure and returns -- the leftmost element of the structure matching the predicate, or -- 'Nothing' if there is no such element.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bifind even (27, 53)+-- Nothing+--+-- >>> bifind even (27, 52)+-- Just 52+--+-- >>> bifind even (26, 52)+-- Just 26+--+-- Empty structures always yield 'Nothing':+--+-- >>> bifind even (BiList [] [])+-- Nothing -- -- @since 4.10.0.0 bifind :: Bifoldable t => (a -> Bool) -> t a a -> Maybe a
Data/Bifunctor.hs view
@@ -20,6 +20,10 @@ import Control.Applicative ( Const(..) ) import GHC.Generics ( K1(..) ) +-- $setup+-- >>> import Prelude+-- >>> import Data.Char (toUpper)+ -- | A bifunctor is a type constructor that takes -- two type arguments and is a functor in /both/ arguments. That -- is, unlike with 'Functor', a type constructor such as 'Either'
Data/Bitraversable.hs view
@@ -73,7 +73,7 @@ -- 'Data.Functor.Compose.Compose' are from "Data.Functor.Identity" and -- "Data.Functor.Compose". ----- Some simple examples are 'Either' and '(,)':+-- Some simple examples are 'Either' and @(,)@: -- -- > instance Bitraversable Either where -- > bitraverse f _ (Left x) = Left <$> f x@@ -101,6 +101,25 @@ -- -- For a version that ignores the results, see 'bitraverse_'. --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> bitraverse listToMaybe (find odd) (Left [])+ -- Nothing+ --+ -- >>> bitraverse listToMaybe (find odd) (Left [1, 2, 3])+ -- Just (Left 1)+ --+ -- >>> bitraverse listToMaybe (find odd) (Right [4, 5])+ -- Just (Right 5)+ --+ -- >>> bitraverse listToMaybe (find odd) ([1, 2, 3], [4, 5])+ -- Just (1,5)+ --+ -- >>> bitraverse listToMaybe (find odd) ([], [4, 5])+ -- Nothing+ -- -- @since 4.10.0.0 bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> t a b -> f (t c d) bitraverse f g = bisequenceA . bimap f g@@ -124,6 +143,19 @@ -- -- @'bisequence' ≡ 'bitraverse' 'id' 'id'@ --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bisequence (Just 4, Nothing)+-- Nothing+--+-- >>> bisequence (Just 4, Just 5)+-- Just (4,5)+--+-- >>> bisequence ([1, 2, 3], [4, 5])+-- [(1,4),(1,5),(2,4),(2,5),(3,4),(3,5)]+-- -- @since 4.10.0.0 bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b) bisequence = bitraverse id id@@ -169,6 +201,25 @@ -- | 'bifor' is 'bitraverse' with the structure as the first argument. For a -- version that ignores the results, see 'bifor_'. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bifor (Left []) listToMaybe (find even)+-- Nothing+--+-- >>> bifor (Left [1, 2, 3]) listToMaybe (find even)+-- Just (Left 1)+--+-- >>> bifor (Right [4, 5]) listToMaybe (find even)+-- Just (Right 4)+--+-- >>> bifor ([1, 2, 3], [4, 5]) listToMaybe (find even)+-- Just (1,4)+--+-- >>> bifor ([], [4, 5]) listToMaybe (find even)+-- Nothing+-- -- @since 4.10.0.0 bifor :: (Bitraversable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f (t c d)@@ -186,6 +237,13 @@ -- of type @a@ and using the given actions to compute new elements for the -- structure. --+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bimapAccumL (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")+-- (8,("True","oof"))+-- -- @since 4.10.0.0 bimapAccumL :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)@@ -193,9 +251,16 @@ = runStateL (bitraverse (StateL . flip f) (StateL . flip g) t) s -- | The 'bimapAccumR' function behaves like a combination of 'bimap' and--- 'bifoldl'; it traverses a structure from right to left, threading a state+-- 'bifoldr'; it traverses a structure from right to left, threading a state -- of type @a@ and using the given actions to compute new elements for the -- structure.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> bimapAccumR (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")+-- (7,("True","oof")) -- -- @since 4.10.0.0 bimapAccumR :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e))
Data/Bits.hs view
@@ -168,10 +168,14 @@ -- | @x \`complementBit\` i@ is the same as @x \`xor\` bit i@ complementBit :: a -> Int -> a - -- | Return 'True' if the @n@th bit of the argument is 1- --- -- Can be implemented using `testBitDefault' if @a@ is also an- -- instance of 'Num'.+ {-| @x \`testBit\` i@ is the same as @x .&. bit n /= 0@++ In other words it returns True if the bit at offset @n+ is set.++ Can be implemented using `testBitDefault' if @a@ is also an+ instance of 'Num'.+ -} testBit :: a -> Int -> Bool {-| Return the number of bits in the type of the argument. The actual@@ -529,17 +533,25 @@ -- | @since 2.01 instance Bits Integer where- (.&.) = andInteger- (.|.) = orInteger- xor = xorInteger- complement = complementInteger- shift x i@(I# i#) | i >= 0 = shiftLInteger x i#- | otherwise = shiftRInteger x (negateInt# i#)- testBit x (I# i) = testBitInteger x i- zeroBits = 0+ (.&.) = integerAnd+ (.|.) = integerOr+ xor = integerXor+ complement = integerComplement+ unsafeShiftR x i = integerShiftR x (fromIntegral i)+ unsafeShiftL x i = integerShiftL x (fromIntegral i)+ shiftR x i@(I# i#)+ | isTrue# (i# >=# 0#) = unsafeShiftR x i+ | otherwise = overflowError+ shiftL x i@(I# i#)+ | isTrue# (i# >=# 0#) = unsafeShiftL x i+ | otherwise = overflowError+ shift x i | i >= 0 = integerShiftL x (fromIntegral i)+ | otherwise = integerShiftR x (fromIntegral (negate i))+ testBit x i = integerTestBit x (fromIntegral i)+ zeroBits = integerZero - bit (I# i#) = bitInteger i#- popCount x = I# (popCountInteger x)+ bit (I# i) = integerBit# (int2Word# i)+ popCount x = I# (integerPopCount# x) rotate x i = shift x i -- since an Integer never wraps around @@ -549,20 +561,28 @@ -- | @since 4.8.0 instance Bits Natural where- (.&.) = andNatural- (.|.) = orNatural- xor = xorNatural- complement _ = errorWithoutStackTrace+ (.&.) = naturalAnd+ (.|.) = naturalOr+ xor = naturalXor+ complement _ = errorWithoutStackTrace "Bits.complement: Natural complement undefined"+ unsafeShiftR x i = naturalShiftR x (fromIntegral i)+ unsafeShiftL x i = naturalShiftL x (fromIntegral i)+ shiftR x i@(I# i#)+ | isTrue# (i# >=# 0#) = unsafeShiftR x i+ | otherwise = overflowError+ shiftL x i@(I# i#)+ | isTrue# (i# >=# 0#) = unsafeShiftL x i+ | otherwise = overflowError shift x i- | i >= 0 = shiftLNatural x i- | otherwise = shiftRNatural x (negate i)- testBit x i = testBitNatural x i- zeroBits = wordToNaturalBase 0##+ | i >= 0 = naturalShiftL x (fromIntegral i)+ | otherwise = naturalShiftR x (fromIntegral (negate i))+ testBit x i = naturalTestBit x (fromIntegral i)+ zeroBits = naturalZero clearBit x i = x `xor` (bit i .&. x) - bit (I# i#) = bitNatural i#- popCount x = popCountNatural x+ bit (I# i) = naturalBit# (int2Word# i)+ popCount x = I# (word2Int# (naturalPopCount# x)) rotate x i = shift x i -- since an Natural never wraps around
Data/Complex.hs view
@@ -42,6 +42,8 @@ import Data.Data (Data) import Foreign (Storable, castPtr, peek, poke, pokeElemOff, peekElemOff, sizeOf, alignment)+import Control.Monad.Fix (MonadFix(..))+import Control.Monad.Zip (MonadZip(..)) infix 6 :+ @@ -250,6 +252,14 @@ -- | @since 4.9.0.0 instance Monad Complex where a :+ b >>= f = realPart (f a) :+ imagPart (f b)++-- | @since 4.15.0.0+instance MonadZip Complex where+ mzipWith = liftA2++-- | @since 4.15.0.0+instance MonadFix Complex where+ mfix f = (let a :+ _ = f a in a) :+ (let _ :+ a = f a in a) -- ----------------------------------------------------------------------------- -- Rules on Complex
Data/Data.hs view
@@ -128,6 +128,7 @@ import GHC.Num import GHC.Read import GHC.Show+import GHC.Tuple (Solo (..)) import Text.Read( reads ) -- Imports for the instances@@ -194,7 +195,7 @@ needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., @(:)@). When the query is meant to compute a value-of type @r@, then the result type withing generic folding is @r -> r@.+of type @r@, then the result type within generic folding is @r -> r@. So the result of folding is a function to which we finally pass the right unit. @@ -1184,6 +1185,9 @@ -- | @since 4.0.0.0 deriving instance Data ()++-- | @since 4.15+deriving instance Data a => Data (Solo a) -- | @since 4.0.0.0 deriving instance (Data a, Data b) => Data (a,b)
Data/Fixed.hs view
@@ -94,6 +94,64 @@ withResolution foo = withType (foo . resolution) -- | @since 2.01+--+-- Recall that, for numeric types, 'succ' and 'pred' typically add and subtract+-- @1@, respectively. This is not true in the case of 'Fixed', whose successor+-- and predecessor functions intuitively return the "next" and "previous" values+-- in the enumeration. The results of these functions thus depend on the+-- resolution of the 'Fixed' value. For example, when enumerating values of+-- resolution @10^-3@ of @type Milli = Fixed E3@,+--+-- @+-- succ (0.000 :: Milli) == 1.001+-- @+--+--+-- and likewise+--+-- @+-- pred (0.000 :: Milli) == -0.001+-- @+--+--+-- In other words, 'succ' and 'pred' increment and decrement a fixed-precision+-- value by the least amount such that the value's resolution is unchanged.+-- For example, @10^-12@ is the smallest (positive) amount that can be added to+-- a value of @type Pico = Fixed E12@ without changing its resolution, and so+--+-- @+-- succ (0.000000000000 :: Pico) == 0.000000000001+-- @+--+--+-- and similarly+--+-- @+-- pred (0.000000000000 :: Pico) == -0.000000000001+-- @+--+--+-- This is worth bearing in mind when defining 'Fixed' arithmetic sequences. In+-- particular, you may be forgiven for thinking the sequence+--+-- @+-- [1..10] :: [Pico]+-- @+--+--+-- evaluates to @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] :: [Pico]@.+--+-- However, this is not true. On the contrary, similarly to the above+-- implementations of 'succ' and 'pred', @enumFromTo :: Pico -> Pico -> [Pico]@+-- has a "step size" of @10^-12@. Hence, the list @[1..10] :: [Pico]@ has+-- the form+--+-- @+-- [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]+-- @+--+--+-- and contains @9 * 10^12 + 1@ values. instance Enum (Fixed a) where succ (MkFixed a) = MkFixed (succ a) pred (MkFixed a) = MkFixed (pred a)
Data/Foldable.hs view
@@ -48,745 +48,2263 @@ -- * Searches notElem, find- ) where--import Data.Bool-import Data.Either-import Data.Eq-import Data.Functor.Utils (Max(..), Min(..), (#.))-import qualified GHC.List as List-import Data.Maybe-import Data.Monoid-import Data.Ord-import Data.Proxy--import GHC.Arr ( Array(..), elems, numElements,- foldlElems, foldrElems,- foldlElems', foldrElems',- foldl1Elems, foldr1Elems)-import GHC.Base hiding ( foldr )-import GHC.Generics-import GHC.Num ( Num(..) )--infix 4 `elem`, `notElem`---- | Data structures that can be folded.------ For example, given a data type------ > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)------ a suitable instance would be------ > instance Foldable Tree where--- > foldMap f Empty = mempty--- > foldMap f (Leaf x) = f x--- > foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r------ This is suitable even for abstract types, as the monoid is assumed--- to satisfy the monoid laws. Alternatively, one could define @foldr@:------ > instance Foldable Tree where--- > foldr f z Empty = z--- > foldr f z (Leaf x) = f x z--- > foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l------ @Foldable@ instances are expected to satisfy the following laws:------ > foldr f z t = appEndo (foldMap (Endo . f) t ) z------ > foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z------ > fold = foldMap id------ > length = getSum . foldMap (Sum . const 1)------ @sum@, @product@, @maximum@, and @minimum@ should all be essentially--- equivalent to @foldMap@ forms, such as------ > sum = getSum . foldMap Sum------ but may be less defined.------ If the type is also a 'Functor' instance, it should satisfy------ > foldMap f = fold . fmap f------ which implies that------ > foldMap f . fmap g = foldMap (f . g)--class Foldable t where- {-# MINIMAL foldMap | foldr #-}-- -- | Combine the elements of a structure using a monoid.- fold :: Monoid m => t m -> m- fold = foldMap id-- -- | Map each element of the structure to a monoid,- -- and combine the results.- foldMap :: Monoid m => (a -> m) -> t a -> m- {-# INLINE foldMap #-}- -- This INLINE allows more list functions to fuse. See #9848.- foldMap f = foldr (mappend . f) mempty-- -- | A variant of 'foldMap' that is strict in the accumulator.- --- -- @since 4.13.0.0- foldMap' :: Monoid m => (a -> m) -> t a -> m- foldMap' f = foldl' (\ acc a -> acc <> f a) mempty-- -- | Right-associative fold of a structure.- --- -- In the case of lists, 'foldr', when applied to a binary operator, a- -- starting value (typically the right-identity of the operator), and a- -- list, reduces the list using the binary operator, from right to left:- --- -- > foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)- --- -- Note that, since the head of the resulting expression is produced by- -- an application of the operator to the first element of the list,- -- 'foldr' can produce a terminating expression from an infinite list.- --- -- For a general 'Foldable' structure this should be semantically identical- -- to,- --- -- @foldr f z = 'List.foldr' f z . 'toList'@- --- foldr :: (a -> b -> b) -> b -> t a -> b- foldr f z t = appEndo (foldMap (Endo #. f) t) z-- -- | Right-associative fold of a structure, but with strict application of- -- the operator.- --- -- @since 4.6.0.0- foldr' :: (a -> b -> b) -> b -> t a -> b- foldr' f z0 xs = foldl f' id xs z0- where f' k x z = k $! f x z-- -- | Left-associative fold of a structure.- --- -- In the case of lists, 'foldl', when applied to a binary- -- operator, a starting value (typically the left-identity of the operator),- -- and a list, reduces the list using the binary operator, from left to- -- right:- --- -- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn- --- -- Note that to produce the outermost application of the operator the- -- entire input list must be traversed. This means that 'foldl'' will- -- diverge if given an infinite list.- --- -- Also note that if you want an efficient left-fold, you probably want to- -- use 'foldl'' instead of 'foldl'. The reason for this is that latter does- -- not force the "inner" results (e.g. @z \`f\` x1@ in the above example)- -- before applying them to the operator (e.g. to @(\`f\` x2)@). This results- -- in a thunk chain \(\mathcal{O}(n)\) elements long, which then must be- -- evaluated from the outside-in.- --- -- For a general 'Foldable' structure this should be semantically identical- -- to,- --- -- @foldl f z = 'List.foldl' f z . 'toList'@- --- foldl :: (b -> a -> b) -> b -> t a -> b- foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z- -- There's no point mucking around with coercions here,- -- because flip forces us to build a new function anyway.-- -- | Left-associative fold of a structure but with strict application of- -- the operator.- --- -- This ensures that each step of the fold is forced to weak head normal- -- form before being applied, avoiding the collection of thunks that would- -- otherwise occur. This is often what you want to strictly reduce a finite- -- list to a single, monolithic result (e.g. 'length').- --- -- For a general 'Foldable' structure this should be semantically identical- -- to,- --- -- @foldl' f z = 'List.foldl'' f z . 'toList'@- --- -- @since 4.6.0.0- foldl' :: (b -> a -> b) -> b -> t a -> b- foldl' f z0 xs = foldr f' id xs z0- where f' x k z = k $! f z x-- -- | A variant of 'foldr' that has no base case,- -- and thus may only be applied to non-empty structures.- --- -- @'foldr1' f = 'List.foldr1' f . 'toList'@- foldr1 :: (a -> a -> a) -> t a -> a- foldr1 f xs = fromMaybe (errorWithoutStackTrace "foldr1: empty structure")- (foldr mf Nothing xs)- where- mf x m = Just (case m of- Nothing -> x- Just y -> f x y)-- -- | A variant of 'foldl' that has no base case,- -- and thus may only be applied to non-empty structures.- --- -- @'foldl1' f = 'List.foldl1' f . 'toList'@- foldl1 :: (a -> a -> a) -> t a -> a- foldl1 f xs = fromMaybe (errorWithoutStackTrace "foldl1: empty structure")- (foldl mf Nothing xs)- where- mf m y = Just (case m of- Nothing -> y- Just x -> f x y)-- -- | List of elements of a structure, from left to right.- --- -- @since 4.8.0.0- toList :: t a -> [a]- {-# INLINE toList #-}- toList t = build (\ c n -> foldr c n t)-- -- | Test whether the structure is empty. The default implementation is- -- optimized for structures that are similar to cons-lists, because there- -- is no general way to do better.- --- -- @since 4.8.0.0- null :: t a -> Bool- null = foldr (\_ _ -> False) True-- -- | Returns the size/length of a finite structure as an 'Int'. The- -- default implementation is optimized for structures that are similar to- -- cons-lists, because there is no general way to do better.- --- -- @since 4.8.0.0- length :: t a -> Int- length = foldl' (\c _ -> c+1) 0-- -- | Does the element occur in the structure?- --- -- @since 4.8.0.0- elem :: Eq a => a -> t a -> Bool- elem = any . (==)-- -- | The largest element of a non-empty structure.- --- -- @since 4.8.0.0- maximum :: forall a . Ord a => t a -> a- maximum = fromMaybe (errorWithoutStackTrace "maximum: empty structure") .- getMax . foldMap (Max #. (Just :: a -> Maybe a))-- -- | The least element of a non-empty structure.- --- -- @since 4.8.0.0- minimum :: forall a . Ord a => t a -> a- minimum = fromMaybe (errorWithoutStackTrace "minimum: empty structure") .- getMin . foldMap (Min #. (Just :: a -> Maybe a))-- -- | The 'sum' function computes the sum of the numbers of a structure.- --- -- @since 4.8.0.0- sum :: Num a => t a -> a- sum = getSum #. foldMap Sum-- -- | The 'product' function computes the product of the numbers of a- -- structure.- --- -- @since 4.8.0.0- product :: Num a => t a -> a- product = getProduct #. foldMap Product---- instances for Prelude types---- | @since 2.01-instance Foldable Maybe where- foldMap = maybe mempty-- foldr _ z Nothing = z- foldr f z (Just x) = f x z-- foldl _ z Nothing = z- foldl f z (Just x) = f z x---- | @since 2.01-instance Foldable [] where- elem = List.elem- foldl = List.foldl- foldl' = List.foldl'- foldl1 = List.foldl1- foldr = List.foldr- foldr1 = List.foldr1- length = List.length- maximum = List.maximum- minimum = List.minimum- null = List.null- product = List.product- sum = List.sum- toList = id---- | @since 4.9.0.0-instance Foldable NonEmpty where- foldr f z ~(a :| as) = f a (List.foldr f z as)- foldl f z (a :| as) = List.foldl f (f z a) as- foldl1 f (a :| as) = List.foldl f a as-- -- GHC isn't clever enough to transform the default definition- -- into anything like this, so we'd end up shuffling a bunch of- -- Maybes around.- foldr1 f (p :| ps) = foldr go id ps p- where- go x r prev = f prev (r x)-- -- We used to say- --- -- length (_ :| as) = 1 + length as- --- -- but the default definition is better, counting from 1.- --- -- The default definition also works great for null and foldl'.- -- As usual for cons lists, foldr' is basically hopeless.-- foldMap f ~(a :| as) = f a `mappend` foldMap f as- fold ~(m :| ms) = m `mappend` fold ms- toList ~(a :| as) = a : as---- | @since 4.7.0.0-instance Foldable (Either a) where- foldMap _ (Left _) = mempty- foldMap f (Right y) = f y-- foldr _ z (Left _) = z- foldr f z (Right y) = f y z-- length (Left _) = 0- length (Right _) = 1-- null = isLeft---- | @since 4.7.0.0-instance Foldable ((,) a) where- foldMap f (_, y) = f y-- foldr f z (_, y) = f y z- length _ = 1- null _ = False---- | @since 4.8.0.0-instance Foldable (Array i) where- foldr = foldrElems- foldl = foldlElems- foldl' = foldlElems'- foldr' = foldrElems'- foldl1 = foldl1Elems- foldr1 = foldr1Elems- toList = elems- length = numElements- null a = numElements a == 0---- | @since 4.7.0.0-instance Foldable Proxy where- foldMap _ _ = mempty- {-# INLINE foldMap #-}- fold _ = mempty- {-# INLINE fold #-}- foldr _ z _ = z- {-# INLINE foldr #-}- foldl _ z _ = z- {-# INLINE foldl #-}- foldl1 _ _ = errorWithoutStackTrace "foldl1: Proxy"- foldr1 _ _ = errorWithoutStackTrace "foldr1: Proxy"- length _ = 0- null _ = True- elem _ _ = False- sum _ = 0- product _ = 1---- | @since 4.8.0.0-instance Foldable Dual where- foldMap = coerce-- elem = (. getDual) #. (==)- foldl = coerce- foldl' = coerce- foldl1 _ = getDual- foldr f z (Dual x) = f x z- foldr' = foldr- foldr1 _ = getDual- length _ = 1- maximum = getDual- minimum = getDual- null _ = False- product = getDual- sum = getDual- toList (Dual x) = [x]---- | @since 4.8.0.0-instance Foldable Sum where- foldMap = coerce-- elem = (. getSum) #. (==)- foldl = coerce- foldl' = coerce- foldl1 _ = getSum- foldr f z (Sum x) = f x z- foldr' = foldr- foldr1 _ = getSum- length _ = 1- maximum = getSum- minimum = getSum- null _ = False- product = getSum- sum = getSum- toList (Sum x) = [x]---- | @since 4.8.0.0-instance Foldable Product where- foldMap = coerce-- elem = (. getProduct) #. (==)- foldl = coerce- foldl' = coerce- foldl1 _ = getProduct- foldr f z (Product x) = f x z- foldr' = foldr- foldr1 _ = getProduct- length _ = 1- maximum = getProduct- minimum = getProduct- null _ = False- product = getProduct- sum = getProduct- toList (Product x) = [x]---- | @since 4.8.0.0-instance Foldable First where- foldMap f = foldMap f . getFirst---- | @since 4.8.0.0-instance Foldable Last where- foldMap f = foldMap f . getLast---- | @since 4.12.0.0-instance (Foldable f) => Foldable (Alt f) where- foldMap f = foldMap f . getAlt---- | @since 4.12.0.0-instance (Foldable f) => Foldable (Ap f) where- foldMap f = foldMap f . getAp---- Instances for GHC.Generics--- | @since 4.9.0.0-instance Foldable U1 where- foldMap _ _ = mempty- {-# INLINE foldMap #-}- fold _ = mempty- {-# INLINE fold #-}- foldr _ z _ = z- {-# INLINE foldr #-}- foldl _ z _ = z- {-# INLINE foldl #-}- foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"- foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"- length _ = 0- null _ = True- elem _ _ = False- sum _ = 0- product _ = 1---- | @since 4.9.0.0-deriving instance Foldable V1---- | @since 4.9.0.0-deriving instance Foldable Par1---- | @since 4.9.0.0-deriving instance Foldable f => Foldable (Rec1 f)---- | @since 4.9.0.0-deriving instance Foldable (K1 i c)---- | @since 4.9.0.0-deriving instance Foldable f => Foldable (M1 i c f)---- | @since 4.9.0.0-deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)---- | @since 4.9.0.0-deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)---- | @since 4.9.0.0-deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)---- | @since 4.9.0.0-deriving instance Foldable UAddr---- | @since 4.9.0.0-deriving instance Foldable UChar---- | @since 4.9.0.0-deriving instance Foldable UDouble---- | @since 4.9.0.0-deriving instance Foldable UFloat---- | @since 4.9.0.0-deriving instance Foldable UInt---- | @since 4.9.0.0-deriving instance Foldable UWord---- Instances for Data.Ord--- | @since 4.12.0.0-deriving instance Foldable Down---- | Monadic fold over the elements of a structure,--- associating to the right, i.e. from right to left.-foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b-foldrM f z0 xs = foldl c return xs z0- -- See Note [List fusion and continuations in 'c']- where c k x z = f x z >>= k- {-# INLINE c #-}---- | Monadic fold over the elements of a structure,--- associating to the left, i.e. from left to right.-foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b-foldlM f z0 xs = foldr c return xs z0- -- See Note [List fusion and continuations in 'c']- where c x k z = f z x >>= k- {-# INLINE c #-}---- | Map each element of a structure to an action, evaluate these--- actions from left to right, and ignore the results. For a version--- that doesn't ignore the results see 'Data.Traversable.traverse'.-traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()-traverse_ f = foldr c (pure ())- -- See Note [List fusion and continuations in 'c']- where c x k = f x *> k- {-# INLINE c #-}---- | 'for_' is 'traverse_' with its arguments flipped. For a version--- that doesn't ignore the results see 'Data.Traversable.for'.------ >>> for_ [1..4] print--- 1--- 2--- 3--- 4-for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()-{-# INLINE for_ #-}-for_ = flip traverse_---- | Map each element of a structure to a monadic action, evaluate--- these actions from left to right, and ignore the results. For a--- version that doesn't ignore the results see--- 'Data.Traversable.mapM'.------ As of base 4.8.0.0, 'mapM_' is just 'traverse_', specialized to--- 'Monad'.-mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()-mapM_ f = foldr c (return ())- -- See Note [List fusion and continuations in 'c']- where c x k = f x >> k- {-# INLINE c #-}---- | 'forM_' is 'mapM_' with its arguments flipped. For a version that--- doesn't ignore the results see 'Data.Traversable.forM'.------ As of base 4.8.0.0, 'forM_' is just 'for_', specialized to 'Monad'.-forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()-{-# INLINE forM_ #-}-forM_ = flip mapM_---- | Evaluate each action in the structure from left to right, and--- ignore the results. For a version that doesn't ignore the results--- see 'Data.Traversable.sequenceA'.-sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()-sequenceA_ = foldr c (pure ())- -- See Note [List fusion and continuations in 'c']- where c m k = m *> k- {-# INLINE c #-}---- | Evaluate each monadic action in the structure from left to right,--- and ignore the results. For a version that doesn't ignore the--- results see 'Data.Traversable.sequence'.------ As of base 4.8.0.0, 'sequence_' is just 'sequenceA_', specialized--- to 'Monad'.-sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()-sequence_ = foldr c (return ())- -- See Note [List fusion and continuations in 'c']- where c m k = m >> k- {-# INLINE c #-}---- | The sum of a collection of actions, generalizing 'concat'.------ >>> asum [Just "Hello", Nothing, Just "World"]--- Just "Hello"-asum :: (Foldable t, Alternative f) => t (f a) -> f a-{-# INLINE asum #-}-asum = foldr (<|>) empty---- | The sum of a collection of actions, generalizing 'concat'.--- As of base 4.8.0.0, 'msum' is just 'asum', specialized to 'MonadPlus'.-msum :: (Foldable t, MonadPlus m) => t (m a) -> m a-{-# INLINE msum #-}-msum = asum---- | The concatenation of all the elements of a container of lists.-concat :: Foldable t => t [a] -> [a]-concat xs = build (\c n -> foldr (\x y -> foldr c y x) n xs)-{-# INLINE concat #-}---- | Map a function over all the elements of a container and concatenate--- the resulting lists.-concatMap :: Foldable t => (a -> [b]) -> t a -> [b]-concatMap f xs = build (\c n -> foldr (\x b -> foldr c b (f x)) n xs)-{-# INLINE concatMap #-}---- These use foldr rather than foldMap to avoid repeated concatenation.---- | 'and' returns the conjunction of a container of Bools. For the--- result to be 'True', the container must be finite; 'False', however,--- results from a 'False' value finitely far from the left end.-and :: Foldable t => t Bool -> Bool-and = getAll #. foldMap All---- | 'or' returns the disjunction of a container of Bools. For the--- result to be 'False', the container must be finite; 'True', however,--- results from a 'True' value finitely far from the left end.-or :: Foldable t => t Bool -> Bool-or = getAny #. foldMap Any---- | Determines whether any element of the structure satisfies the predicate.-any :: Foldable t => (a -> Bool) -> t a -> Bool-any p = getAny #. foldMap (Any #. p)---- | Determines whether all elements of the structure satisfy the predicate.-all :: Foldable t => (a -> Bool) -> t a -> Bool-all p = getAll #. foldMap (All #. p)---- | The largest element of a non-empty structure with respect to the--- given comparison function.---- See Note [maximumBy/minimumBy space usage]-maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a-maximumBy cmp = foldl1 max'- where max' x y = case cmp x y of- GT -> x- _ -> y---- | The least element of a non-empty structure with respect to the--- given comparison function.---- See Note [maximumBy/minimumBy space usage]-minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a-minimumBy cmp = foldl1 min'- where min' x y = case cmp x y of- GT -> y- _ -> x---- | 'notElem' is the negation of 'elem'.-notElem :: (Foldable t, Eq a) => a -> t a -> Bool-notElem x = not . elem x---- | The 'find' function takes a predicate and a structure and returns--- the leftmost element of the structure matching the predicate, or--- 'Nothing' if there is no such element.-find :: Foldable t => (a -> Bool) -> t a -> Maybe a-find p = getFirst . foldMap (\ x -> First (if p x then Just x else Nothing))--{--Note [List fusion and continuations in 'c']-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-Suppose we define- mapM_ f = foldr ((>>) . f) (return ())-(this is the way it used to be).--Now suppose we want to optimise the call-- mapM_ <big> (build g)- where- g c n = ...(c x1 y1)...(c x2 y2)....n...--GHC used to proceed like this:-- mapM_ <big> (build g)-- = { Definition of mapM_ }- foldr ((>>) . <big>) (return ()) (build g)-- = { foldr/build rule }- g ((>>) . <big>) (return ())-- = { Inline g }- let c = (>>) . <big>- n = return ()- in ...(c x1 y1)...(c x2 y2)....n...--The trouble is that `c`, being big, will not be inlined. And that can-be absolutely terrible for performance, as we saw in #8763.--It's much better to define-- mapM_ f = foldr c (return ())- where- c x k = f x >> k- {-# INLINE c #-}--Now we get- mapM_ <big> (build g)-- = { inline mapM_ }- foldr c (return ()) (build g)- where c x k = f x >> k- {-# INLINE c #-}- f = <big>--Notice that `f` does not inline into the RHS of `c`,-because the INLINE pragma stops it; see-Note [Simplifying inside stable unfoldings] in SimplUtils.-Continuing:-- = { foldr/build rule }- g c (return ())- where ...- c x k = f x >> k- {-# INLINE c #-}- f = <big>-- = { inline g }- ...(c x1 y1)...(c x2 y2)....n...- where c x k = f x >> k- {-# INLINE c #-}- f = <big>- n = return ()-- Now, crucially, `c` does inline-- = { inline c }- ...(f x1 >> y1)...(f x2 >> y2)....n...- where f = <big>- n = return ()--And all is well! The key thing is that the fragment-`(f x1 >> y1)` is inlined into the body of the builder-`g`.--}--{--Note [maximumBy/minimumBy space usage]-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-When the type signatures of maximumBy and minimumBy were generalized to work-over any Foldable instance (instead of just lists), they were defined using-foldr1. This was problematic for space usage, as the semantics of maximumBy-and minimumBy essentially require that they examine every element of the-data structure. Using foldr1 to examine every element results in space usage-proportional to the size of the data structure. For the common case of lists,-this could be particularly bad (see #10830).--For the common case of lists, switching the implementations of maximumBy and-minimumBy to foldl1 solves the issue, as GHC's strictness analysis can then-make these functions only use O(1) stack space. It is perhaps not the optimal-way to fix this problem, as there are other conceivable data structures-(besides lists) which might benefit from specialized implementations for-maximumBy and minimumBy (see-https://gitlab.haskell.org/ghc/ghc/issues/10830#note_129843 for a further-discussion). But using foldl1 is at least always better than using foldr1, so-GHC has chosen to adopt that approach for now.--}++ -- * Overview+ -- $overview++ -- ** Recursive and corecursive reduction+ -- $reduction++ -- *** Strict recursive folds+ -- $strict++ -- **** List of strict functions+ -- $strictlist++ -- *** Lazy corecursive folds+ -- $lazy++ -- **** List of lazy functions+ -- $lazylist++ -- *** Short-circuit folds+ -- $shortcircuit++ -- **** List of short-circuit functions+ -- $shortlist++ -- *** Hybrid folds+ -- $hybrid++ -- ** Generative Recursion+ -- $generative++ -- ** Avoiding multi-pass folds+ -- $multipass++ -- * Defining instances+ -- $instances++ -- *** Being strict by being lazy+ -- $strictlazy++ -- * Laws+ -- $laws++ -- * Notes+ -- $notes++ -- * See also+ -- $also+ ) where++import Data.Bool+import Data.Either+import Data.Eq+import Data.Functor.Utils (Max(..), Min(..), (#.))+import qualified GHC.List as List+import Data.Maybe+import Data.Monoid+import Data.Ord+import Data.Proxy++import GHC.Arr ( Array(..), elems, numElements,+ foldlElems, foldrElems,+ foldlElems', foldrElems',+ foldl1Elems, foldr1Elems)+import GHC.Base hiding ( foldr )+import GHC.Generics+import GHC.Tuple (Solo (..))+import GHC.Num ( Num(..) )++-- $setup+-- >>> :set -XDeriveFoldable+-- >>> import Prelude+-- >>> import Data.Monoid (Product (..), Sum (..))+-- >>> data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving (Show, Foldable)++infix 4 `elem`, `notElem`++-- XXX: Missing haddock feature. Links to anchors in other modules+-- don't have a sensible way to name the link within the module itself.+-- Thus, the below "Data.Foldable#overview" works well when shown as+-- @Data.Foldable@ from other modules, but in the home module it should+-- be possible to specify alternative link text. :-(++-- | The Foldable class represents data structures that can be reduced to a+-- summary value one element at a time. Strict left-associative folds are a+-- good fit for space-efficient reduction, while lazy right-associative folds+-- are a good fit for corecursive iteration, or for folds that short-circuit+-- after processing an initial subsequence of the structure's elements.+--+-- Instances can be derived automatically by enabling the @DeriveFoldable@+-- extension. For example, a derived instance for a binary tree might be:+--+-- > {-# LANGUAGE DeriveFoldable #-}+-- > data Tree a = Empty+-- > | Leaf a+-- > | Node (Tree a) a (Tree a)+-- > deriving Foldable+--+-- A more detailed description can be found in the overview section of+-- "Data.Foldable#overview".+--+class Foldable t where+ {-# MINIMAL foldMap | foldr #-}++ -- | Given a structure with elements whose type is a 'Monoid', combine them+ -- via the monoid's @('<>')@ operator. This fold is right-associative and+ -- lazy in the accumulator. When you need a strict left-associative fold,+ -- use `foldMap'` instead, with 'id' as the map.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> fold [[1, 2, 3], [4, 5], [6], []]+ -- [1,2,3,4,5,6]+ --+ -- >>> fold $ Node (Leaf (Sum 1)) (Sum 3) (Leaf (Sum 5))+ -- Sum {getSum = 9}+ --+ -- Folds of unbounded structures do not terminate when the monoid's+ -- @('<>')@ operator is strict:+ --+ -- >>> fold (repeat Nothing)+ -- * Hangs forever *+ --+ -- Lazy corecursive folds of unbounded structures are fine:+ --+ -- >>> take 12 $ fold $ map (\i -> [i..i+2]) [0..]+ -- [0,1,2,1,2,3,2,3,4,3,4,5]+ -- >>> sum $ take 4000000 $ fold $ map (\i -> [i..i+2]) [0..]+ -- 2666668666666+ --+ fold :: Monoid m => t m -> m+ fold = foldMap id++ -- | Map each element of the structure into a monoid, and combine the+ -- results with @('<>')@. This fold is right-associative and lazy in the+ -- accumulator. For strict left-associative folds consider `foldMap'`+ -- instead.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> foldMap Sum [1, 3, 5]+ -- Sum {getSum = 9}+ --+ -- >>> foldMap Product [1, 3, 5]+ -- Product {getProduct = 15}+ --+ -- >>> foldMap (replicate 3) [1, 2, 3]+ -- [1,1,1,2,2,2,3,3,3]+ --+ -- When a Monoid's @('<>')@ is lazy in its second argument, 'foldMap' can+ -- return a result even from an unbounded structure. For example, lazy+ -- accumulation enables "Data.ByteString.Builder" to efficiently serialise+ -- large data structures and produce the output incrementally:+ --+ -- >>> import qualified Data.ByteString.Lazy as L+ -- >>> import qualified Data.ByteString.Builder as B+ -- >>> let bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x20+ -- >>> let lbs = B.toLazyByteString $ foldMap bld [0..]+ -- >>> L.take 64 lbs+ -- "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"+ --+ foldMap :: Monoid m => (a -> m) -> t a -> m+ {-# INLINE foldMap #-}+ -- This INLINE allows more list functions to fuse. See #9848.+ foldMap f = foldr (mappend . f) mempty++ -- | A left-associative variant of 'foldMap' that is strict in the+ -- accumulator. Use this method for strict reduction when partial+ -- results are merged via @('<>')@.+ --+ -- ==== __Examples__+ --+ -- Define a 'Monoid' over finite bit strings under 'xor'. Use it to+ -- strictly compute the `xor` of a list of 'Int' values.+ --+ -- >>> :set -XGeneralizedNewtypeDeriving+ -- >>> import Data.Bits (Bits, FiniteBits, xor, zeroBits)+ -- >>> import Data.Foldable (foldMap')+ -- >>> import Numeric (showHex)+ -- >>>+ -- >>> newtype X a = X a deriving (Eq, Bounded, Enum, Bits, FiniteBits)+ -- >>> instance Bits a => Semigroup (X a) where X a <> X b = X (a `xor` b)+ -- >>> instance Bits a => Monoid (X a) where mempty = X zeroBits+ -- >>>+ -- >>> let bits :: [Int]; bits = [0xcafe, 0xfeed, 0xdeaf, 0xbeef, 0x5411]+ -- >>> (\ (X a) -> showString "0x" . showHex a $ "") $ foldMap' X bits+ -- "0x42"+ --+ -- @since 4.13.0.0+ foldMap' :: Monoid m => (a -> m) -> t a -> m+ foldMap' f = foldl' (\ acc a -> acc <> f a) mempty++ -- | Right-associative fold of a structure, lazy in the accumulator.+ --+ -- In the case of lists, 'foldr', when applied to a binary operator, a+ -- starting value (typically the right-identity of the operator), and a+ -- list, reduces the list using the binary operator, from right to left:+ --+ -- > foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)+ --+ -- Note that since the head of the resulting expression is produced by an+ -- application of the operator to the first element of the list, given an+ -- operator lazy in its right argument, 'foldr' can produce a terminating+ -- expression from an unbounded list.+ --+ -- For a general 'Foldable' structure this should be semantically identical+ -- to,+ --+ -- @foldr f z = 'List.foldr' f z . 'toList'@+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> foldr (||) False [False, True, False]+ -- True+ --+ -- >>> foldr (||) False []+ -- False+ --+ -- >>> foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd']+ -- "foodcba"+ --+ -- ===== Infinite structures+ --+ -- ⚠️ Applying 'foldr' to infinite structures usually doesn't terminate.+ --+ -- It may still terminate under one of the following conditions:+ --+ -- * the folding function is short-circuiting+ -- * the folding function is lazy on its second argument+ --+ -- ====== Short-circuiting+ --+ -- @('||')@ short-circuits on 'True' values, so the following terminates+ -- because there is a 'True' value finitely far from the left side:+ --+ -- >>> foldr (||) False (True : repeat False)+ -- True+ --+ -- But the following doesn't terminate:+ --+ -- >>> foldr (||) False (repeat False ++ [True])+ -- * Hangs forever *+ --+ -- ====== Laziness in the second argument+ --+ -- Applying 'foldr' to infinite structures terminates when the operator is+ -- lazy in its second argument (the initial accumulator is never used in+ -- this case, and so could be left 'undefined', but @[]@ is more clear):+ --+ -- >>> take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1)+ -- [1,4,7,10,13]+ foldr :: (a -> b -> b) -> b -> t a -> b+ foldr f z t = appEndo (foldMap (Endo #. f) t) z++ -- | Right-associative fold of a structure, strict in the accumulator.+ -- This is rarely what you want.+ --+ -- @since 4.6.0.0+ foldr' :: (a -> b -> b) -> b -> t a -> b+ foldr' f z0 xs = foldl f' id xs z0+ where f' k x z = k $! f x z++ -- | Left-associative fold of a structure, lazy in the accumulator. This+ -- is rarely what you want, but can work well for structures with efficient+ -- right-to-left sequencing and an operator that is lazy in its left+ -- argument.+ --+ -- In the case of lists, 'foldl', when applied to a binary operator, a+ -- starting value (typically the left-identity of the operator), and a+ -- list, reduces the list using the binary operator, from left to right:+ --+ -- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn+ --+ -- Note that to produce the outermost application of the operator the+ -- entire input list must be traversed. Like all left-associative folds,+ -- 'foldl' will diverge if given an infinite list.+ --+ -- If you want an efficient strict left-fold, you probably want to use+ -- `foldl'` instead of 'foldl'. The reason for this is that the latter+ -- does not force the /inner/ results (e.g. @z \`f\` x1@ in the above+ -- example) before applying them to the operator (e.g. to @(\`f\` x2)@).+ -- This results in a thunk chain \(\mathcal{O}(n)\) elements long, which+ -- then must be evaluated from the outside-in.+ --+ -- For a general 'Foldable' structure this should be semantically identical+ -- to:+ --+ -- @foldl f z = 'List.foldl' f z . 'toList'@+ --+ -- ==== __Examples__+ --+ -- The first example is a strict fold, which in practice is best performed+ -- with `foldl'`.+ --+ -- >>> foldl (+) 42 [1,2,3,4]+ -- 52+ --+ -- Though the result below is lazy, the input is reversed before prepending+ -- it to the initial accumulator, so corecursion begins only after traversing+ -- the entire input string.+ --+ -- >>> foldl (\acc c -> c : acc) "abcd" "efgh"+ -- "hgfeabcd"+ --+ -- A left fold of a structure that is infinite on the right cannot+ -- terminate, even when for any finite input the fold just returns the+ -- initial accumulator:+ --+ -- >>> foldl (\a _ -> a) 0 $ repeat 1+ -- * Hangs forever *+ --+ foldl :: (b -> a -> b) -> b -> t a -> b+ foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z+ -- There's no point mucking around with coercions here,+ -- because flip forces us to build a new function anyway.++ -- | Left-associative fold of a structure but with strict application of+ -- the operator.+ --+ -- This ensures that each step of the fold is forced to Weak Head Normal+ -- Form before being applied, avoiding the collection of thunks that would+ -- otherwise occur. This is often what you want to strictly reduce a+ -- finite structure to a single strict result (e.g. 'sum').+ --+ -- For a general 'Foldable' structure this should be semantically identical+ -- to,+ --+ -- @foldl' f z = 'List.foldl'' f z . 'toList'@+ --+ -- @since 4.6.0.0+ foldl' :: (b -> a -> b) -> b -> t a -> b+ foldl' f z0 xs = foldr f' id xs z0+ where f' x k z = k $! f z x++ -- | A variant of 'foldr' that has no base case,+ -- and thus may only be applied to non-empty structures.+ --+ -- This function is non-total and will raise a runtime exception if the+ -- structure happens to be empty.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> foldr1 (+) [1..4]+ -- 10+ --+ -- >>> foldr1 (+) []+ -- Exception: Prelude.foldr1: empty list+ --+ -- >>> foldr1 (+) Nothing+ -- *** Exception: foldr1: empty structure+ --+ -- >>> foldr1 (-) [1..4]+ -- -2+ --+ -- >>> foldr1 (&&) [True, False, True, True]+ -- False+ --+ -- >>> foldr1 (||) [False, False, True, True]+ -- True+ --+ -- >>> foldr1 (+) [1..]+ -- * Hangs forever *+ foldr1 :: (a -> a -> a) -> t a -> a+ foldr1 f xs = fromMaybe (errorWithoutStackTrace "foldr1: empty structure")+ (foldr mf Nothing xs)+ where+ mf x m = Just (case m of+ Nothing -> x+ Just y -> f x y)++ -- | A variant of 'foldl' that has no base case,+ -- and thus may only be applied to non-empty structures.+ --+ -- This function is non-total and will raise a runtime exception if the+ -- structure happens to be empty.+ --+ -- @'foldl1' f = 'List.foldl1' f . 'toList'@+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> foldl1 (+) [1..4]+ -- 10+ --+ -- >>> foldl1 (+) []+ -- *** Exception: Prelude.foldl1: empty list+ --+ -- >>> foldl1 (+) Nothing+ -- *** Exception: foldl1: empty structure+ --+ -- >>> foldl1 (-) [1..4]+ -- -8+ --+ -- >>> foldl1 (&&) [True, False, True, True]+ -- False+ --+ -- >>> foldl1 (||) [False, False, True, True]+ -- True+ --+ -- >>> foldl1 (+) [1..]+ -- * Hangs forever *+ foldl1 :: (a -> a -> a) -> t a -> a+ foldl1 f xs = fromMaybe (errorWithoutStackTrace "foldl1: empty structure")+ (foldl mf Nothing xs)+ where+ mf m y = Just (case m of+ Nothing -> y+ Just x -> f x y)++ -- | List of elements of a structure, from left to right. If the entire+ -- list is intended to be reduced via a fold, just fold the structure+ -- directly bypassing the list.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> toList Nothing+ -- []+ --+ -- >>> toList (Just 42)+ -- [42]+ --+ -- >>> toList (Left "foo")+ -- []+ --+ -- >>> toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8)))+ -- [5,17,12,8]+ --+ -- For lists, 'toList' is the identity:+ --+ -- >>> toList [1, 2, 3]+ -- [1,2,3]+ --+ -- @since 4.8.0.0+ toList :: t a -> [a]+ {-# INLINE toList #-}+ toList t = build (\ c n -> foldr c n t)++ -- | Test whether the structure is empty. The default implementation is+ -- Left-associative and lazy in both the initial element and the+ -- accumulator. Thus optimised for structures where the first element can+ -- be accessed in constant time. Structures where this is not the case+ -- should have a non-default implementation.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> null []+ -- True+ --+ -- >>> null [1]+ -- False+ --+ -- 'null' is expected to terminate even for infinite structures.+ -- The default implementation terminates provided the structure+ -- is bounded on the left (there is a left-most element).+ --+ -- >>> null [1..]+ -- False+ --+ -- @since 4.8.0.0+ null :: t a -> Bool+ null = foldr (\_ _ -> False) True++ -- | Returns the size/length of a finite structure as an 'Int'. The+ -- default implementation just counts elements starting with the left-most.+ -- Instances for structures that can compute the element count faster+ -- than via element-by-element counting, should provide a specialised+ -- implementation.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> length []+ -- 0+ --+ -- >>> length ['a', 'b', 'c']+ -- 3+ -- >>> length [1..]+ -- * Hangs forever *+ --+ -- @since 4.8.0.0+ length :: t a -> Int+ length = foldl' (\c _ -> c+1) 0++ -- | Does the element occur in the structure?+ --+ -- Note: 'elem' is often used in infix form.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> 3 `elem` []+ -- False+ --+ -- >>> 3 `elem` [1,2]+ -- False+ --+ -- >>> 3 `elem` [1,2,3,4,5]+ -- True+ --+ -- For infinite structures, the default implementation of 'elem'+ -- terminates if the sought-after value exists at a finite distance+ -- from the left side of the structure:+ --+ -- >>> 3 `elem` [1..]+ -- True+ --+ -- >>> 3 `elem` ([4..] ++ [3])+ -- * Hangs forever *+ --+ -- @since 4.8.0.0+ elem :: Eq a => a -> t a -> Bool+ elem = any . (==)++ -- | The largest element of a non-empty structure.+ --+ -- This function is non-total and will raise a runtime exception if the+ -- structure happens to be empty. A structure that supports random access+ -- and maintains its elements in order should provide a specialised+ -- implementation to return the maximum in faster than linear time.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> maximum [1..10]+ -- 10+ --+ -- >>> maximum []+ -- *** Exception: Prelude.maximum: empty list+ --+ -- >>> maximum Nothing+ -- *** Exception: maximum: empty structure+ --+ -- @since 4.8.0.0+ maximum :: forall a . Ord a => t a -> a+ maximum = fromMaybe (errorWithoutStackTrace "maximum: empty structure") .+ getMax . foldMap' (Max #. (Just :: a -> Maybe a))+ {-# INLINEABLE maximum #-}++ -- | The least element of a non-empty structure.+ --+ -- This function is non-total and will raise a runtime exception if the+ -- structure happens to be empty. A structure that supports random access+ -- and maintains its elements in order should provide a specialised+ -- implementation to return the minimum in faster than linear time.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> minimum [1..10]+ -- 1+ --+ -- >>> minimum []+ -- *** Exception: Prelude.minimum: empty list+ --+ -- >>> minimum Nothing+ -- *** Exception: minimum: empty structure+ --+ -- @since 4.8.0.0+ minimum :: forall a . Ord a => t a -> a+ minimum = fromMaybe (errorWithoutStackTrace "minimum: empty structure") .+ getMin . foldMap' (Min #. (Just :: a -> Maybe a))+ {-# INLINEABLE minimum #-}++ -- | The 'sum' function computes the sum of the numbers of a structure.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> sum []+ -- 0+ --+ -- >>> sum [42]+ -- 42+ --+ -- >>> sum [1..10]+ -- 55+ --+ -- >>> sum [4.1, 2.0, 1.7]+ -- 7.8+ --+ -- >>> sum [1..]+ -- * Hangs forever *+ --+ -- @since 4.8.0.0+ sum :: Num a => t a -> a+ sum = getSum #. foldMap' Sum+ {-# INLINEABLE sum #-}++ -- | The 'product' function computes the product of the numbers of a+ -- structure.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- >>> product []+ -- 1+ --+ -- >>> product [42]+ -- 42+ --+ -- >>> product [1..10]+ -- 3628800+ --+ -- >>> product [4.1, 2.0, 1.7]+ -- 13.939999999999998+ --+ -- >>> product [1..]+ -- * Hangs forever *+ --+ -- @since 4.8.0.0+ product :: Num a => t a -> a+ product = getProduct #. foldMap' Product+ {-# INLINEABLE product #-}++-- instances for Prelude types++-- | @since 2.01+instance Foldable Maybe where+ foldMap = maybe mempty++ foldr _ z Nothing = z+ foldr f z (Just x) = f x z++ foldl _ z Nothing = z+ foldl f z (Just x) = f z x++-- | @since 2.01+instance Foldable [] where+ elem = List.elem+ foldl = List.foldl+ foldl' = List.foldl'+ foldl1 = List.foldl1+ foldr = List.foldr+ foldr1 = List.foldr1+ length = List.length+ maximum = List.maximum+ minimum = List.minimum+ null = List.null+ product = List.product+ sum = List.sum+ toList = id++-- | @since 4.9.0.0+instance Foldable NonEmpty where+ foldr f z ~(a :| as) = f a (List.foldr f z as)+ foldl f z (a :| as) = List.foldl f (f z a) as+ foldl1 f (a :| as) = List.foldl f a as++ -- GHC isn't clever enough to transform the default definition+ -- into anything like this, so we'd end up shuffling a bunch of+ -- Maybes around.+ foldr1 f (p :| ps) = foldr go id ps p+ where+ go x r prev = f prev (r x)++ -- We used to say+ --+ -- length (_ :| as) = 1 + length as+ --+ -- but the default definition is better, counting from 1.+ --+ -- The default definition also works great for null and foldl'.+ -- As usual for cons lists, foldr' is basically hopeless.++ foldMap f ~(a :| as) = f a `mappend` foldMap f as+ fold ~(m :| ms) = m `mappend` fold ms+ toList ~(a :| as) = a : as++-- | @since 4.7.0.0+instance Foldable (Either a) where+ foldMap _ (Left _) = mempty+ foldMap f (Right y) = f y++ foldr _ z (Left _) = z+ foldr f z (Right y) = f y z++ length (Left _) = 0+ length (Right _) = 1++ null = isLeft++-- | @since 4.15+deriving instance Foldable Solo++-- | @since 4.7.0.0+instance Foldable ((,) a) where+ foldMap f (_, y) = f y++ foldr f z (_, y) = f y z+ length _ = 1+ null _ = False++-- | @since 4.8.0.0+instance Foldable (Array i) where+ foldr = foldrElems+ foldl = foldlElems+ foldl' = foldlElems'+ foldr' = foldrElems'+ foldl1 = foldl1Elems+ foldr1 = foldr1Elems+ toList = elems+ length = numElements+ null a = numElements a == 0++-- | @since 4.7.0.0+instance Foldable Proxy where+ foldMap _ _ = mempty+ {-# INLINE foldMap #-}+ fold _ = mempty+ {-# INLINE fold #-}+ foldr _ z _ = z+ {-# INLINE foldr #-}+ foldl _ z _ = z+ {-# INLINE foldl #-}+ foldl1 _ _ = errorWithoutStackTrace "foldl1: Proxy"+ foldr1 _ _ = errorWithoutStackTrace "foldr1: Proxy"+ length _ = 0+ null _ = True+ elem _ _ = False+ sum _ = 0+ product _ = 1++-- | @since 4.8.0.0+instance Foldable Dual where+ foldMap = coerce++ elem = (. getDual) #. (==)+ foldl = coerce+ foldl' = coerce+ foldl1 _ = getDual+ foldr f z (Dual x) = f x z+ foldr' = foldr+ foldr1 _ = getDual+ length _ = 1+ maximum = getDual+ minimum = getDual+ null _ = False+ product = getDual+ sum = getDual+ toList (Dual x) = [x]++-- | @since 4.8.0.0+instance Foldable Sum where+ foldMap = coerce++ elem = (. getSum) #. (==)+ foldl = coerce+ foldl' = coerce+ foldl1 _ = getSum+ foldr f z (Sum x) = f x z+ foldr' = foldr+ foldr1 _ = getSum+ length _ = 1+ maximum = getSum+ minimum = getSum+ null _ = False+ product = getSum+ sum = getSum+ toList (Sum x) = [x]++-- | @since 4.8.0.0+instance Foldable Product where+ foldMap = coerce++ elem = (. getProduct) #. (==)+ foldl = coerce+ foldl' = coerce+ foldl1 _ = getProduct+ foldr f z (Product x) = f x z+ foldr' = foldr+ foldr1 _ = getProduct+ length _ = 1+ maximum = getProduct+ minimum = getProduct+ null _ = False+ product = getProduct+ sum = getProduct+ toList (Product x) = [x]++-- | @since 4.8.0.0+instance Foldable First where+ foldMap f = foldMap f . getFirst++-- | @since 4.8.0.0+instance Foldable Last where+ foldMap f = foldMap f . getLast++-- | @since 4.12.0.0+instance (Foldable f) => Foldable (Alt f) where+ foldMap f = foldMap f . getAlt++-- | @since 4.12.0.0+instance (Foldable f) => Foldable (Ap f) where+ foldMap f = foldMap f . getAp++-- Instances for GHC.Generics+-- | @since 4.9.0.0+instance Foldable U1 where+ foldMap _ _ = mempty+ {-# INLINE foldMap #-}+ fold _ = mempty+ {-# INLINE fold #-}+ foldr _ z _ = z+ {-# INLINE foldr #-}+ foldl _ z _ = z+ {-# INLINE foldl #-}+ foldl1 _ _ = errorWithoutStackTrace "foldl1: U1"+ foldr1 _ _ = errorWithoutStackTrace "foldr1: U1"+ length _ = 0+ null _ = True+ elem _ _ = False+ sum _ = 0+ product _ = 1++-- | @since 4.9.0.0+deriving instance Foldable V1++-- | @since 4.9.0.0+deriving instance Foldable Par1++-- | @since 4.9.0.0+deriving instance Foldable f => Foldable (Rec1 f)++-- | @since 4.9.0.0+deriving instance Foldable (K1 i c)++-- | @since 4.9.0.0+deriving instance Foldable f => Foldable (M1 i c f)++-- | @since 4.9.0.0+deriving instance (Foldable f, Foldable g) => Foldable (f :+: g)++-- | @since 4.9.0.0+deriving instance (Foldable f, Foldable g) => Foldable (f :*: g)++-- | @since 4.9.0.0+deriving instance (Foldable f, Foldable g) => Foldable (f :.: g)++-- | @since 4.9.0.0+deriving instance Foldable UAddr++-- | @since 4.9.0.0+deriving instance Foldable UChar++-- | @since 4.9.0.0+deriving instance Foldable UDouble++-- | @since 4.9.0.0+deriving instance Foldable UFloat++-- | @since 4.9.0.0+deriving instance Foldable UInt++-- | @since 4.9.0.0+deriving instance Foldable UWord++-- Instances for Data.Ord+-- | @since 4.12.0.0+deriving instance Foldable Down++-- | Monadic fold over the elements of a structure. This type of fold is+-- left-associative in the monadic effects, and right-associative in the output+-- value.+--+-- Given a structure @t@ with elements @(a, b, c, ..., x, y)@, the result of+-- a fold with an operator function @f@ is equivalent to:+--+-- > foldrM f z t = do { yy <- f y z; xx <- f x yy; ... ; bb <- f b cc; f a bb }+--+-- If in a 'MonadPlus' the bind short-circuits, the evaluated effects will be+-- from a tail of the sequence. If you want to evaluate the monadic effects in+-- left-to-right order, or perhaps be able to short-circuit after an initial+-- sequence of elements, you'll need to use `foldlM` instead.+--+-- If the monadic effects don't short-circuit, the outer-most application of+-- @f@ is to left-most element @a@, so that, ignoring effects, the result looks+-- like a right fold:+--+-- > a `f` (b `f` (c `f` (... (x `f` (y `f` z))))).+--+-- and yet, left-associative monadic binds, rather than right-associative+-- applications of @f@, sequence the computation.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> let f i acc = do { print i ; return $ i : acc }+-- >>> foldrM f [] [0..3]+-- 3+-- 2+-- 1+-- 0+-- [0,1,2,3]+--+foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b+foldrM f z0 xs = foldl c return xs z0+ -- See Note [List fusion and continuations in 'c']+ where c k x z = f x z >>= k+ {-# INLINE c #-}++-- | Monadic fold over the elements of a structure. This type of fold is+-- right-associative in the monadic effects, and left-associative in the output+-- value.+--+-- Given a structure @t@ with elements @(a, b, ..., w, x, y)@, the result of+-- a fold with an operator function @f@ is equivalent to:+--+-- > foldlM f z t = do { aa <- f z a; bb <- f aa b; ... ; xx <- f ww x; f xx y }+--+-- If in a 'MonadPlus' the bind short-circuits, the evaluated effects will be+-- from an initial portion of the sequence. If you want to evaluate the+-- monadic effects in right-to-left order, or perhaps be able to short-circuit+-- after processing a tail of the sequence of elements, you'll need to use+-- `foldrM` instead.+--+-- If the monadic effects don't short-circuit, the outer-most application of+-- @f@ is to the right-most element @y@, so that, ignoring effects, the result+-- looks like a left fold:+--+-- > ((((z `f` a) `f` b) ... `f` w) `f` x) `f` y+--+-- and yet, right-associative monadic binds, rather than left-associative+-- applications of @f@, sequence the computation.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> let f a e = do { print e ; return $ e : a }+-- >>> foldlM f [] [0..3]+-- 0+-- 1+-- 2+-- 3+-- [3,2,1,0]+--+foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b+foldlM f z0 xs = foldr c return xs z0+ -- See Note [List fusion and continuations in 'c']+ where c x k z = f z x >>= k+ {-# INLINE c #-}++-- | Map each element of a structure to an 'Applicative' action, evaluate these+-- actions from left to right, and ignore the results. For a version that+-- doesn't ignore the results see 'Data.Traversable.traverse'.+--+-- 'traverse_' is just like 'mapM_', but generalised to 'Applicative' actions.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> traverse_ print ["Hello", "world", "!"]+-- "Hello"+-- "world"+-- "!"+traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()+traverse_ f = foldr c (pure ())+ -- See Note [List fusion and continuations in 'c']+ where c x k = f x *> k+ {-# INLINE c #-}++-- | 'for_' is 'traverse_' with its arguments flipped. For a version+-- that doesn't ignore the results see 'Data.Traversable.for'. This+-- is 'forM_' generalised to 'Applicative' actions.+--+-- 'for_' is just like 'forM_', but generalised to 'Applicative' actions.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> for_ [1..4] print+-- 1+-- 2+-- 3+-- 4+for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()+{-# INLINE for_ #-}+for_ = flip traverse_++-- | Map each element of a structure to a monadic action, evaluate+-- these actions from left to right, and ignore the results. For a+-- version that doesn't ignore the results see+-- 'Data.Traversable.mapM'.+--+-- 'mapM_' is just like 'traverse_', but specialised to monadic actions.+--+mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()+mapM_ f = foldr c (return ())+ -- See Note [List fusion and continuations in 'c']+ where c x k = f x >> k+ {-# INLINE c #-}++-- | 'forM_' is 'mapM_' with its arguments flipped. For a version that+-- doesn't ignore the results see 'Data.Traversable.forM'.+--+-- 'forM_' is just like 'for_', but specialised to monadic actions.+--+forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()+{-# INLINE forM_ #-}+forM_ = flip mapM_++-- | Evaluate each action in the structure from left to right, and+-- ignore the results. For a version that doesn't ignore the results+-- see 'Data.Traversable.sequenceA'.+--+-- 'sequenceA_' is just like 'sequence_', but generalised to 'Applicative'+-- actions.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> sequenceA_ [print "Hello", print "world", print "!"]+-- "Hello"+-- "world"+-- "!"+sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()+sequenceA_ = foldr c (pure ())+ -- See Note [List fusion and continuations in 'c']+ where c m k = m *> k+ {-# INLINE c #-}++-- | Evaluate each monadic action in the structure from left to right,+-- and ignore the results. For a version that doesn't ignore the+-- results see 'Data.Traversable.sequence'.+--+-- 'sequence_' is just like 'sequenceA_', but specialised to monadic+-- actions.+--+sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()+sequence_ = foldr c (return ())+ -- See Note [List fusion and continuations in 'c']+ where c m k = m >> k+ {-# INLINE c #-}++-- | The sum of a collection of actions, generalizing 'concat'.+--+-- 'asum' is just like 'msum', but generalised to 'Alternative'.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> asum [Just "Hello", Nothing, Just "World"]+-- Just "Hello"+asum :: (Foldable t, Alternative f) => t (f a) -> f a+{-# INLINE asum #-}+asum = foldr (<|>) empty++-- | The sum of a collection of actions, generalizing 'concat'.+--+-- 'msum' is just like 'asum', but specialised to 'MonadPlus'.+--+msum :: (Foldable t, MonadPlus m) => t (m a) -> m a+{-# INLINE msum #-}+msum = asum++-- | The concatenation of all the elements of a container of lists.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> concat (Just [1, 2, 3])+-- [1,2,3]+--+-- >>> concat (Left 42)+-- []+--+-- >>> concat [[1, 2, 3], [4, 5], [6], []]+-- [1,2,3,4,5,6]+--+concat :: Foldable t => t [a] -> [a]+concat xs = build (\c n -> foldr (\x y -> foldr c y x) n xs)+{-# INLINE concat #-}++-- | Map a function over all the elements of a container and concatenate+-- the resulting lists.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]+-- [1,2,3,10,11,12,100,101,102,1000,1001,1002]+--+-- >>> concatMap (take 3) (Just [1..])+-- [1,2,3]+concatMap :: Foldable t => (a -> [b]) -> t a -> [b]+concatMap f xs = build (\c n -> foldr (\x b -> foldr c b (f x)) n xs)+{-# INLINE concatMap #-}++-- These use foldr rather than foldMap to avoid repeated concatenation.++-- | 'and' returns the conjunction of a container of Bools. For the+-- result to be 'True', the container must be finite; 'False', however,+-- results from a 'False' value finitely far from the left end.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> and []+-- True+--+-- >>> and [True]+-- True+--+-- >>> and [False]+-- False+--+-- >>> and [True, True, False]+-- False+--+-- >>> and (False : repeat True) -- Infinite list [False,True,True,True,...+-- False+--+-- >>> and (repeat True)+-- * Hangs forever *+and :: Foldable t => t Bool -> Bool+and = getAll #. foldMap All++-- | 'or' returns the disjunction of a container of Bools. For the+-- result to be 'False', the container must be finite; 'True', however,+-- results from a 'True' value finitely far from the left end.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> or []+-- False+--+-- >>> or [True]+-- True+--+-- >>> or [False]+-- False+--+-- >>> or [True, True, False]+-- True+--+-- >>> or (True : repeat False) -- Infinite list [True,False,False,False,...+-- True+--+-- >>> or (repeat False)+-- * Hangs forever *+or :: Foldable t => t Bool -> Bool+or = getAny #. foldMap Any++-- | Determines whether any element of the structure satisfies the predicate.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> any (> 3) []+-- False+--+-- >>> any (> 3) [1,2]+-- False+--+-- >>> any (> 3) [1,2,3,4,5]+-- True+--+-- >>> any (> 3) [1..]+-- True+--+-- >>> any (> 3) [0, -1..]+-- * Hangs forever *+any :: Foldable t => (a -> Bool) -> t a -> Bool+any p = getAny #. foldMap (Any #. p)++-- | Determines whether all elements of the structure satisfy the predicate.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> all (> 3) []+-- True+--+-- >>> all (> 3) [1,2]+-- False+--+-- >>> all (> 3) [1,2,3,4,5]+-- False+--+-- >>> all (> 3) [1..]+-- False+--+-- >>> all (> 3) [4..]+-- * Hangs forever *+all :: Foldable t => (a -> Bool) -> t a -> Bool+all p = getAll #. foldMap (All #. p)++-- | The largest element of a non-empty structure with respect to the+-- given comparison function.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> maximumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]+-- "Longest"++-- See Note [maximumBy/minimumBy space usage]+maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a+maximumBy cmp = fromMaybe (errorWithoutStackTrace "maximumBy: empty structure")+ . foldl' max' Nothing+ where+ max' mx y = Just $! case mx of+ Nothing -> y+ Just x -> case cmp x y of+ GT -> x+ _ -> y+{-# INLINEABLE maximumBy #-}++-- | The least element of a non-empty structure with respect to the+-- given comparison function.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> minimumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]+-- "!"++-- See Note [maximumBy/minimumBy space usage]+minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a+minimumBy cmp = fromMaybe (errorWithoutStackTrace "minimumBy: empty structure")+ . foldl' min' Nothing+ where+ min' mx y = Just $! case mx of+ Nothing -> y+ Just x -> case cmp x y of+ GT -> y+ _ -> x+{-# INLINEABLE minimumBy #-}++-- | 'notElem' is the negation of 'elem'.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> 3 `notElem` []+-- True+--+-- >>> 3 `notElem` [1,2]+-- True+--+-- >>> 3 `notElem` [1,2,3,4,5]+-- False+--+-- For infinite structures, 'notElem' terminates if the value exists at a+-- finite distance from the left side of the structure:+--+-- >>> 3 `notElem` [1..]+-- False+--+-- >>> 3 `notElem` ([4..] ++ [3])+-- * Hangs forever *+notElem :: (Foldable t, Eq a) => a -> t a -> Bool+notElem x = not . elem x++-- | The 'find' function takes a predicate and a structure and returns+-- the leftmost element of the structure matching the predicate, or+-- 'Nothing' if there is no such element.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> find (> 42) [0, 5..]+-- Just 45+--+-- >>> find (> 12) [1..7]+-- Nothing+find :: Foldable t => (a -> Bool) -> t a -> Maybe a+find p = getFirst . foldMap (\ x -> First (if p x then Just x else Nothing))++{-+Note [List fusion and continuations in 'c']+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+Suppose we define+ mapM_ f = foldr ((>>) . f) (return ())+(this is the way it used to be).++Now suppose we want to optimise the call++ mapM_ <big> (build g)+ where+ g c n = ...(c x1 y1)...(c x2 y2)....n...++GHC used to proceed like this:++ mapM_ <big> (build g)++ = { Definition of mapM_ }+ foldr ((>>) . <big>) (return ()) (build g)++ = { foldr/build rule }+ g ((>>) . <big>) (return ())++ = { Inline g }+ let c = (>>) . <big>+ n = return ()+ in ...(c x1 y1)...(c x2 y2)....n...++The trouble is that `c`, being big, will not be inlined. And that can+be absolutely terrible for performance, as we saw in #8763.++It's much better to define++ mapM_ f = foldr c (return ())+ where+ c x k = f x >> k+ {-# INLINE c #-}++Now we get+ mapM_ <big> (build g)++ = { inline mapM_ }+ foldr c (return ()) (build g)+ where c x k = f x >> k+ {-# INLINE c #-}+ f = <big>++Notice that `f` does not inline into the RHS of `c`,+because the INLINE pragma stops it; see+Note [Simplifying inside stable unfoldings] in GHC.Core.Opt.Simplify.Utils.+Continuing:++ = { foldr/build rule }+ g c (return ())+ where ...+ c x k = f x >> k+ {-# INLINE c #-}+ f = <big>++ = { inline g }+ ...(c x1 y1)...(c x2 y2)....n...+ where c x k = f x >> k+ {-# INLINE c #-}+ f = <big>+ n = return ()++ Now, crucially, `c` does inline++ = { inline c }+ ...(f x1 >> y1)...(f x2 >> y2)....n...+ where f = <big>+ n = return ()++And all is well! The key thing is that the fragment+`(f x1 >> y1)` is inlined into the body of the builder+`g`.+-}++{-+Note [maximumBy/minimumBy space usage]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+When the type signatures of maximumBy and minimumBy were generalized to work+over any Foldable instance (instead of just lists), they were defined using+foldr1. This was problematic for space usage, as the semantics of maximumBy+and minimumBy essentially require that they examine every element of the+data structure. Using foldr1 to examine every element results in space usage+proportional to the size of the data structure. For the common case of lists,+this could be particularly bad (see #10830).++For the common case of lists, switching the implementations of maximumBy and+minimumBy to foldl1 solves the issue, assuming GHC's strictness analysis can then+make these functions only use O(1) stack space. As of base 4.16, we have switched to employing foldl' over foldl1, not relying on GHC's optimiser. See https://gitlab.haskell.org/ghc/ghc/-/issues/17867 for more context.+-}++--------------++-- $overview+--+-- #overview#+-- Foldable structures are reduced to a summary value by accumulating+-- contributions to the result one element at a time.+--+-- == Left and right folds+--+-- #leftright#+-- Merging the contribution of the current element with an accumulator value+-- from a partial result is performed by an /operator/ function, either+-- explicitly provided by the caller as in `foldr`, implicit as in `length`, or+-- partly implicit as in `foldMap` (where each element is mapped into a+-- 'Monoid', and the monoid's `mappend` operator performs the merge).+--+-- A key distinction is between left-associative and right-associative+-- folds:+--+-- * In left-associative folds the accumulator is a partial fold over the+-- elements that __precede__ the current element, and is passed to the+-- operator as its first (left) argument. The outer-most application of the+-- operator merges the contribution of the last element of the structure with+-- the contributions of all its predecessors.+--+-- * In right-associative folds the accumulator is a partial fold over the+-- elements that __follow__ the current element, and is passed to the+-- operator as its second (right) argument. The outer-most application of+-- the operator merges the contribution of the first element of the structure+-- with the contributions of all its successors.+--+-- These two types of folds are typified by the left-associative strict+-- `foldl'` and the right-associative lazy `foldr`.+--+-- @+-- `foldl'` :: Foldable t => (b -> a -> b) -> b -> t a -> b+-- `foldr` :: Foldable t => (a -> b -> b) -> b -> t a -> b+-- @+--+-- Example usage:+--+-- >>> foldl' (+) 0 [1..100]+-- 5050+-- >>> foldr (&&) True (repeat False)+-- False+--+-- The first argument of both is an explicit /operator/ that merges the+-- contribution of an element of the structure with a partial fold over,+-- respectively, either the preceding or following elements of the structure.+--+-- The second argument of both is an initial accumulator value @z@ of type+-- @b@. This is the result of the fold when the structure is empty.+-- When the structure is non-empty, this is the accumulator value merged with+-- the first element in left-associative folds, or with the last element in+-- right-associative folds.+--+-- The third and final argument is a @Foldable@ structure containing elements+-- @(a, b, c, …)@.+--+-- * __`foldl'`__ takes an operator function of the form:+--+-- @+-- f :: b -- accumulated fold of the initial elements+-- -> a -- current element+-- -> b -- updated fold, inclusive of current element+-- @+--+-- If the structure's last element is @y@, the result of the fold is:+--+-- @+-- g y . … . g c . g b . g a $ z+-- where g element !acc = f acc element+-- @+--+-- Since `foldl'` is strict in the accumulator, this is always+-- a [strict](#strict) reduction with no opportunity for early return or+-- intermediate results. The structure must be finite, since no result is+-- returned until the last element is processed. The advantage of+-- strictness is space efficiency: the final result can be computed without+-- storing a potentially deep stack of lazy intermediate results.+--+-- * __`foldr`__ takes an operator function of the form:+--+-- @+-- f :: a -- current element+-- -> b -- accumulated fold of the remaining elements+-- -> b -- updated fold, inclusive of current element+-- @+--+-- the result of the fold is:+--+-- @f a . f b . f c . … $ z@+--+-- If each call of @f@ on the current element @e@, (referenced as @(f e)@+-- below) returns a structure in which its second argument is captured in a+-- lazily-evaluated component, then the fold of the remaining elements is+-- available to the caller of `foldr` as a pending computation (thunk) that+-- is computed only when that component is evaluated.+--+-- Alternatively, if any of the @(f e)@ ignore their second argument, the+-- fold stops there, with the remaining elements unused. As a result,+-- `foldr` is well suited to define both [corecursive](#corec)+-- and [short-circuit](#short) reductions.+--+-- When the operator is always strict in the second argument, `foldl'` is+-- generally a better choice than `foldr`. When `foldr` is called with a+-- strict operator, evaluation cannot begin until the last element is+-- reached, by which point a deep stack of pending function applications+-- may have been built up in memory.+--+-- In finite structures for which right-to-left sequencing no less efficient+-- than left-to-right sequencing, there is no inherent performance distinction+-- between left-associative and right-associative folds. If the structure's+-- @Foldable@ instance takes advantage of this symmetry to also make strict+-- right folds space-efficient and lazy left folds corecursive, one need only+-- take care to choose either a strict or lazy method for the task at hand.++--------------++-- $reduction+--+-- As observed in the [above description](#leftright) of left and right folds,+-- there are three general ways in which a structure can be reduced to a+-- summary value:+--+-- * __Recursive__ reduction, which is strict in all the elements of the+-- structure. This produces a single final result only after processing the+-- entire input structure, and so the input must be finite.+--+-- * __Corecursion__, which yields intermediate results as it encounters+-- additional input elements. Lazy processing of the remaining elements+-- makes the intermediate results available even before the rest of the+-- input is processed. The input may be unbounded, and the caller can+-- stop processing intermediate results early.+--+-- * __Short-circuit__ reduction, which examines some initial sequence of the+-- input elements, but stops once a termination condition is met, returning a+-- final result based only on the elements considered up to that point. The+-- remaining elements are not considered. The input should generally be+-- finite, because the termination condition might otherwise never be met.+--+-- Whether a fold is recursive, corecursive or short-circuiting can depend on+-- both the method chosen to perform the fold and on the operator passed to+-- that method (which may be implicit, as with the `mappend` method of a monoid+-- instance).+--+-- There are also hybrid cases, where the method and/or operator are not well+-- suited to the task at hand, resulting in a fold that fails to yield+-- incremental results until the entire input is processed, or fails to+-- strictly evaluate results as it goes, deferring all the work to the+-- evaluation of a large final thunk. Such cases should be avoided, either by+-- selecting a more appropriate @Foldable@ method, or by tailoring the operator+-- to the chosen method.+--+-- The distinction between these types of folds is critical, both in deciding+-- which @Foldable@ method to use to perform the reduction efficiently, and in+-- writing @Foldable@ instances for new structures. Below is a more detailed+-- overview of each type.++--------------++-- $strict+-- #strict#+--+-- Common examples of strict recursive reduction are the various /aggregate/+-- functions, like 'sum', 'product', 'length', as well as more complex+-- summaries such as frequency counts. These functions return only a single+-- value after processing the entire input structure. In such cases, lazy+-- processing of the tail of the input structure is generally not only+-- unnecessary, but also inefficient. Thus, these and similar folds should be+-- implemented in terms of strict left-associative @Foldable@ methods (typically+-- `foldl'`) to perform an efficient reduction in constant space.+--+-- Conversely, an implementation of @Foldable@ for a new structure should+-- ensure that `foldl'` actually performs a strict left-associative reduction.+--+-- The `foldMap'` method is a special case of `foldl'`, in which the initial+-- accumulator is `mempty` and the operator is @mappend . f@, where @f@ maps+-- each input element into the 'Monoid' in question. Therefore, `foldMap'` is+-- an appropriate choice under essentially the same conditions as `foldl'`, and+-- its implementation for a given @Foldable@ structure should also be a strict+-- left-associative reduction.+--+-- While the examples below are not necessarily the most optimal definitions of+-- the intended functions, they are all cases in which `foldMap'` is far more+-- appropriate (as well as more efficient) than the lazy `foldMap`.+--+-- > length = getSum . foldMap' (const (Sum 1))+-- > sum = getSum . foldMap' Sum+-- > product = getProduct . foldMap' Product+--+-- [ The actual default definitions employ coercions to optimise out+-- 'getSum' and 'getProduct'. ]++--------------++-- $strictlist+--+-- The full list of strict recursive functions in this module is:+--+-- * Provided the operator is strict in its left argument:+--+-- @`foldl'` :: Foldable t => (b -> a -> b) -> b -> t a -> b@+--+-- * Provided `mappend` is strict in its left argument:+--+-- @`foldMap'` :: (Foldable t, Monoid m) => (a -> m) -> t a -> m@+--+-- * Provided the instance is correctly defined:+--+-- @+-- `length` :: Foldable t => t a -> Int+-- `sum` :: (Foldable t, Num a) => t a -> a+-- `product` :: (Foldable t, Num a) => t a -> a+-- `maximum` :: (Foldable t, Ord a) => t a -> a+-- `minimum` :: (Foldable t, Ord a) => t a -> a+-- `maximumBy` :: Foldable t => (a -> a -> Ordering) -> t a -> a+-- `minimumBy` :: Foldable t => (a -> a -> Ordering) -> t a -> a+-- @++--------------++-- $lazy+--+-- #corec#+-- Common examples of lazy corecursive reduction are functions that map and+-- flatten a structure to a lazy stream of result values, i.e. an iterator+-- over the transformed input elements. In such cases, it is important to+-- choose a @Foldable@ method that is lazy in the tail of the structure, such+-- as `foldr` (or `foldMap`, if the result @Monoid@ has a lazy `mappend` as+-- with e.g. ByteString Builders).+--+-- Conversely, an implementation of `foldr` for a structure that can+-- accommodate a large (and possibly unbounded) number of elements is expected+-- to be lazy in the tail of the input, allowing operators that are lazy in the+-- accumulator to yield intermediate results incrementally. Such folds are+-- right-associative, with the tail of the stream returned as a lazily+-- evaluated component of the result (an element of a tuple or some other+-- non-strict constructor, e.g. the @(:)@ constructor for lists).+--+-- The @toList@ function below lazily transforms a @Foldable@ structure to a+-- List. Note that this transformation may be lossy, e.g. for a keyed+-- container (@Map@, @HashMap@, …) the output stream holds only the+-- values, not the keys. Lossless transformations to\/from lists of @(key,+-- value)@ pairs are typically available in the modules for the specific+-- container types.+--+-- > toList = foldr (:) []++--------------++-- $lazylist+--+-- The full list of lazy corecursive functions in this module is:+--+-- * Provided the reduction function is lazy in its second argument,+-- (otherwise best to use a strict recursive reduction):+--+-- @+-- `foldr` :: Foldable t => (a -> b -> b) -> b -> t a -> b+-- `foldr1` :: Foldable t => (a -> a -> a) -> t a -> a+-- @+--+-- * Provided the 'Monoid' `mappend` is lazy in its second argument+-- (otherwise best to use a strict recursive reduction):+--+-- @+-- `fold` :: Foldable t => Monoid m => t m -> m+-- `foldMap` :: Foldable t => Monoid m => (a -> m) -> t a -> m+-- @+--+-- * Provided the instance is correctly defined:+--+-- @+-- `toList` :: Foldable t => t a -> [a]+-- `concat` :: Foldable t => t [a] -> [a]+-- `concatMap` :: Foldable t => (a -> [b]) -> t a -> [b]+-- @++--------------++-- $shortcircuit+--+-- #short#+-- Examples of short-cicuit reduction include various boolean predicates that+-- test whether some or all the elements of a structure satisfy a given+-- condition. Because these don't necessarily consume the entire list, they+-- typically employ `foldr` with an operator that is conditionally strict in+-- its second argument. Once the termination condition is met the second+-- argument (tail of the input structure) is ignored. No result is returned+-- until that happens.+--+-- The key distinguishing feature of these folds is /conditional/ strictness+-- in the second argument, it is sometimes evaluated and sometimes not.+--+-- The simplest (degenerate case) of these is 'null', which determines whether+-- a structure is empty or not. This only needs to look at the first element,+-- and only to the extent of whether it exists or not, and not its value. In+-- this case termination is guaranteed, and infinite input structures are fine.+-- Its default definition is of course in terms of the lazy 'foldr':+--+-- > null = foldr (\_ _ -> False) True+--+-- A more general example is `any`, which applies a predicate to each input+-- element in turn until it finds the first one for which the predicate is+-- true, at which point it returns success. If, in an infinite input stream+-- the predicate is false for all the elements, `any` will not terminate,+-- but since it runs in constant space, it typically won't run out of memory,+-- it'll just loop forever.++--------------++-- $shortlist+--+-- The full list of short-circuit folds in this module is:+--+-- * Boolean predicate folds.+-- These functions examine elements strictly until a condition is met,+-- but then return a result ignoring the rest (lazy in the tail). These+-- may loop forever given an unbounded input where no elements satisy the+-- termination condition.+--+-- @+-- `null` :: Foldable t => t a -> Bool+-- `elem` :: Foldable t => Eq a => a -> t a -> Bool+-- `notElem` :: (Foldable t, Eq a) => a -> t a -> Bool+-- `and` :: Foldable t => t Bool -> Bool+-- `or` :: Foldable t => t Bool -> Bool+-- `find` :: Foldable t => (a -> Bool) -> t a -> Maybe a+-- `any` :: Foldable t => (a -> Bool) -> t a -> Bool+-- `all` :: Foldable t => (a -> Bool) -> t a -> Bool+-- @+--+-- * Many instances of '<|>' (e.g. the 'Maybe' instance) are conditionally+-- lazy, and use or don't use their second argument depending on the value+-- of the first. These are used with the folds below, which terminate as+-- early as possible, but otherwise generally keep going. Some instances+-- (e.g. for List) are always strict, but the result is lazy in the tail+-- of the output, so that `asum` for a list of lists is in fact corecursive.+-- These folds are defined in terms of `foldr`.+--+-- @+-- `asum` :: (Foldable t, Alternative f) => t (f a) -> f a+-- `msum` :: (Foldable t, MonadPlus m) => t (m a) -> m a+-- @+--+-- * Likewise, the '*>' operator in some `Applicative` functors, and '>>'+-- in some monads are conditionally lazy and can /short-circuit/ a chain of+-- computations. The below folds will terminate as early as possible, but+-- even infinite loops can be productive here, when evaluated solely for+-- their stream of IO side-effects. See "Data.Traversable#validation"+-- for some additional discussion.+--+-- @+-- `traverse_` :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()+-- `for_` :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()+-- `sequenceA_` :: (Foldable t, Applicative f) => t (f a) -> f ()+-- `mapM_` :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()+-- `forM_` :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()+-- `sequence_` :: (Foldable t, Monad m) => t (m a) -> m ()+-- @+--+-- * Finally, there's one more special case, `foldlM`, which can short-circuit+-- when the monad @m@ is a 'MonadPlus', and the operator invokes 'mzero'.+--+-- @`foldlM` :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b@+--+-- This type of fold is right-associative in the monadic effects, and+-- left-associative in the output value.+--+-- Given a structure @t@ with elements @(a, b, ..., x, y)@, the result+-- of a fold with operator @f@ is equivalent to:+--+-- > foldlM f z t = do { aa <- f z a; bb <- f aa b; ... ; f xx y }+--+-- If in a 'MonadPlus' the bind short-circuits, the evaluated effects will+-- be from an initial portion of the sequence.+--+-- >>> :set -XBangPatterns+-- >>> import Control.Monad+-- >>> import Control.Monad.Trans.Class+-- >>> import Control.Monad.Trans.Maybe+-- >>> import Data.Foldable+-- >>> let f !_ e = when (e > 3) mzero >> lift (print e)+-- >>> runMaybeT $ foldlM f () [0..]+-- 0+-- 1+-- 2+-- 3+-- Nothing+--+-- Contrast this with `foldrM`, which uses `foldl` to sequence the effects,+-- and therefore diverges (running out of space) when given an unbounded+-- input structure. The short-circuit condition is never reached+--+-- >>> let f e _ = when (e > 3) mzero >> lift (print e)+-- >>> runMaybeT $ foldrM f () [0..]+-- ...hangs...+--+-- If instead the operator short-circuits on the initial elements and the+-- structure is finite, `foldrM` will perform the monadic effects in reverse+-- order:+--+-- >>> let f e _ = when (e < 3) mzero >> lift (print e)+-- >>> runMaybeT $ foldrM f () [0..5]+-- 5+-- 4+-- 3+-- Nothing++--------------++-- $hybrid+--+-- The below folds, are neither strict reductions that produce a final answer+-- in constant space, nor lazy corecursions, and so have limited applicability.+-- They do have specialised uses, but are best avoided when in doubt.+--+-- @+-- `foldr'` :: (a -> b -> b) -> b -> t a -> b+-- `foldl` :: (b -> a -> b) -> b -> t a -> b+-- `foldl1` :: (a -> a -> a) -> t a -> a+-- `foldrM` :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b+-- @+--+-- The lazy left-folds (used corecursively) and 'foldrM' (used to sequence+-- actions right-to-left) can be efficient in structures whose @Foldable@+-- instances take advantage of efficient right-to-left iteration to perform+-- lazy left folds outside-in from the right-most element.+--+-- The strict `foldr'` is the least likely to be useful, structures that+-- support efficient sequencing /only/ right-to-left are not at all common.++--------------++-- $instances+--+-- #instances#+-- For many structures reasonably efficient @Foldable@ instances can be derived+-- automatically, by enabling the @DeriveFoldable@ GHC extension. When this+-- works, it is generally not necessary to define a custom instance by hand.+-- Though in some cases one may be able to get slightly faster hand-tuned code,+-- care is required to avoid producing slower code, or code that is not+-- sufficiently lazy, strict or /lawful/.+--+-- The hand-crafted instances can get away with only defining one of 'foldr' or+-- 'foldMap'. All the other methods have default definitions in terms of one+-- of these. The default definitions have the expected strictness and the+-- expected asymptotic runtime and space costs, modulo small constant factors.+-- If you choose to hand-tune, benchmarking is advised to see whether you're+-- doing better than the default derived implementations, plus careful tests to+-- ensure that the custom methods are correct.+--+-- Below we construct a @Foldable@ instance for a data type representing a+-- (finite) binary tree with depth-first traversal.+--+-- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)+--+-- a suitable instance would be:+--+-- > instance Foldable Tree where+-- > foldr f z Empty = z+-- > foldr f z (Leaf x) = f x z+-- > foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l+--+-- The 'Node' case is a right fold of the left subtree whose initial+-- value is a right fold of the rest of the tree.+--+-- For example, when @f@ is @(':')@, all three cases return an immediate value,+-- respectively @z@ or a /cons cell/ holding @x@ or @l@, with the remainder the+-- structure, if any, encapsulated in a lazy thunk. This meets the expected+-- efficient [corecursive](#corec) behaviour of 'foldr'.+--+-- Alternatively, one could define @foldMap@:+--+-- > instance Foldable Tree where+-- > foldMap f Empty = mempty+-- > foldMap f (Leaf x) = f x+-- > foldMap f (Node l k r) = foldMap f l <> f k <> foldMap f r+--+-- And indeed some efficiency may be gained by directly defining both,+-- avoiding some indirection in the default definitions that express+-- one in terms of the other. If you implement just one, likely 'foldr'+-- is the better choice.+--+-- A binary tree typically (when balanced, or randomly biased) provides equally+-- efficient access to its left and right subtrees. This makes it possible to+-- define a `foldl` optimised for [corecursive](#corec) folds with operators+-- that are lazy in their first (left) argument.+--+-- > instance Foldable Tree where+-- > foldr f z Empty = z+-- > foldr f z (Leaf x) = f x z+-- > foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l+-- > --+-- > foldMap f Empty = mempty+-- > foldMap f (Leaf x) = f x+-- > foldMap f (Node l k r) = foldMap f l <> f k <> foldMap f r+-- > --+-- > foldl f z Empty = z+-- > foldl f z (Leaf x) = f z x+-- > foldl f z (Node l k r) = foldl f (f (foldl f z l) k) r+--+-- Now left-to-right and right-to-left iteration over the structure+-- elements are equally efficient (note the mirror-order output when+-- using `foldl`):+--+-- >>> foldr (\e acc -> e : acc) [] (Node (Leaf 1) 2 (Leaf 3))+-- [1,2,3]+-- >>> foldl (\acc e -> e : acc) [] (Node (Leaf 1) 2 (Leaf 3))+-- [3,2,1]+--+-- We can carry this further, and define more non-default methods...+--+-- The structure definition actually admits trees that are unbounded on either+-- or both sides. The only fold that can plausibly terminate for a tree+-- unbounded on both left and right is `null`, when defined as shown below.+-- The default definition in terms of `foldr` diverges if the tree is unbounded+-- on the left. Here we define a variant that avoids travelling down the tree+-- to find the left-most element and just examines the root node.+--+-- > null Empty = True+-- > null _ = False+--+-- This is a sound choice also for finite trees.+--+-- In practice, unbounded trees are quite uncommon, and can barely be said to+-- be @Foldable@. They would typically employ breadth first traversal, and+-- would support only corecursive and short-circuit folds (diverge under strict+-- reduction).+--+-- Returning to simpler instances, defined just in terms of `foldr`, it is+-- somewhat surprising that a fairly efficient /default/ implementation of the+-- strict `foldl'` is defined in terms of lazy `foldr` when only the latter is+-- explicitly provided by the instance. It may be instructive to take a look+-- at how this works.++--------------++-- $strictlazy+--+-- #strictlazy#+--+-- The left fold:+--+-- @foldl' f z [a, b, …, x, y]@+--+-- can be expanded as:+--+-- @+-- id . g y . g x . … . g b . g a $ z+-- where g = flip f+-- @+--+-- In which to maintain the expected strictness we need to perform function+-- application eagerly, and composition lazily. To that end we introduce a new+-- function @f'@ which maps each element @x@ to an eager application of @g x@+-- to its argument, followed by an application of a lazily computed composition+-- (@k@) of the @g e@ functions for the remaining elements @e@:+--+-- > f' x k z = k $! (g x) z = k $! f z x+--+-- We see that a lazy 'foldr' of the @g e@ endomorphisms, with @f'@ as as the+-- operator, in fact yields a strict left fold, that avoids building a+-- deep chain of intermediate thunks:+--+-- > foldl' f z0 xs = foldr f' id xs z0+-- > where f' x k z = k $! f z x+--+-- The function applied to @z0@ is built corecursively, and its terms are+-- applied eagerly to the accumulator before further terms are applied to+-- the result. So, as promised, this will run in constant space, and GHC+-- is able to optimise this to an efficient loop.++--------------++-- $generative+--+-- #generative#+-- So far, we have not discussed /generative recursion/. Unlike recursive+-- reduction or corecursion, instead of processing a sequence of elements+-- already in memory, generative recursion involves producing a possibly+-- unbounded sequence of values from an initial seed value. The canonical+-- example of this is 'Data.List.unfoldr' for Lists, with variants available+-- for Vectors and various other structures.+--+-- A key issue with lists, when used generatively as /iterators/, rather than as+-- poor-man's containers (see [[1\]](#uselistsnot)), is that such iterators+-- tend to consume memory when used more than once. A single traversal of a+-- list-as-iterator will run in constant space, but as soon as the list is+-- retained for reuse, its entire element sequence is stored in memory, and the+-- second traversal reads the copy, rather than regenerates the elements. It+-- is sometimes better to recompute the elements rather than memoise the list.+--+-- Memoisation happens because the built-in Haskell list __@[]@__ is+-- represented as __data__, either empty or a /cons-cell/ holding the first+-- element and the tail of the list. The @Foldable@ class enables a variant+-- representation of iterators as /functions/, which take an operator and a+-- starting accumulator and output a summary result.+--+-- The [@fmlist@](https://hackage.haskell.org/package/fmlist) package takes+-- this approach, by representing a list via its `foldMap` action.+--+-- Below we implement an analogous data structure using a representation+-- based on `foldr`. This is an example of /Church encoding/+-- (named after Alonzo Church, inventor of the lambda calculus).+--+-- > {-# LANGUAGE RankNTypes #-}+-- > newtype FRList a = FR { unFR :: forall b. (a -> b -> b) -> b -> b }+--+-- The __@unFR@__ field of this type is essentially its `foldr` method+-- with the list as its first rather than last argument. Thus we+-- immediately get a @Foldable@ instance (and a 'toList' function+-- mapping an __@FRList@__ to a regular list).+--+-- > instance Foldable FRList where+-- > foldr f z l = unFR l f z+-- > -- With older versions of @base@, also define sum, product, ...+-- > -- to ensure use of the strict `foldl'`.+-- > -- sum = foldl' (+) 0+-- > -- ...+--+-- We can convert a regular list to an __@FRList@__ with:+--+-- > fromList :: [a] -> FRList a+-- > fromList as = FRList $ \ f z -> foldr f z as+--+-- However, reuse of an __@FRList@__ obtained in this way will typically+-- memoise the underlying element sequence. Instead, we can define+-- __@FRList@__ terms directly:+--+-- > -- | Immediately return the initial accumulator+-- > nil :: FRList a+-- > nil = FRList $ \ _ z -> z+-- > {-# INLINE nil #-}+--+-- > -- | Fold the tail to use as an accumulator with the new initial element+-- > cons :: a -> FRList a -> FRList a+-- > cons a l = FRList $ \ f z -> f a (unFR l f z)+-- > {-# INLINE cons #-}+--+-- More crucially, we can also directly define the key building block for+-- generative recursion:+--+-- > -- | Generative recursion, dual to `foldr`.+-- > unfoldr :: (s -> Maybe (a, s)) -> s -> FRList a+-- > unfoldr g s0 = FR generate+-- > where generate f z = loop s0+-- > where loop s | Just (a, t) <- g s = f a (loop t)+-- > | otherwise = z+-- > {-# INLINE unfoldr #-}+--+-- Which can, for example, be specialised to number ranges:+--+-- > -- | Generate a range of consecutive integral values.+-- > range :: (Ord a, Integral a) => a -> a -> FRList a+-- > range lo hi =+-- > unfoldr (\s -> if s > hi then Nothing else Just (s, s+1)) lo+-- > {-# INLINE range #-}+--+-- The program below, when compiled with optimisation:+--+-- > main :: IO ()+-- > main = do+-- > let r :: FRList Int+-- > r = range 1 10000000+-- > in print (sum r, length r)+--+-- produces the expected output with no noticeable garbage-collection, despite+-- reuse of the __@FRList@__ term __@r@__.+--+-- > (50000005000000,10000000)+-- > 52,120 bytes allocated in the heap+-- > 3,320 bytes copied during GC+-- > 44,376 bytes maximum residency (1 sample(s))+-- > 25,256 bytes maximum slop+-- > 3 MiB total memory in use (0 MB lost due to fragmentation)+--+-- The Weak Head Normal Form of an __@FRList@__ is a lambda abstraction not a+-- data value, and reuse does not lead to memoisation. Reuse of the iterator+-- above is somewhat contrived, when computing multiple folds over a common+-- list, you should generally traverse a list only [once](#multipass). The+-- goal is to demonstrate that the separate computations of the 'sum' and+-- 'length' run efficiently in constant space, despite reuse. This would not+-- be the case with the list @[1..10000000]@.+--+-- This is, however, an artificially simple reduction. More typically, there+-- are likely to be some allocations in the inner loop, but the temporary+-- storage used will be garbage-collected as needed, and overall memory+-- utilisation will remain modest and will not scale with the size of the list.+--+-- If we go back to built-in lists (i.e. __@[]@__), but avoid reuse by+-- performing reduction in a single pass, as below:+--+-- > data PairS a b = P !a !b -- We define a strict pair datatype+-- >+-- > main :: IO ()+-- > main = do+-- > let l :: [Int]+-- > l = [1..10000000]+-- > in print $ average l+-- > where+-- > sumlen :: PairS Int Int -> Int -> PairS Int Int+-- > sumlen (P s l) a = P (s + a) (l + 1)+-- >+-- > average is =+-- > let (P s l) = foldl' sumlen (P 0 0) is+-- > in (fromIntegral s :: Double) / fromIntegral l+--+-- the result is again obtained in constant space:+--+-- > 5000000.5+-- > 102,176 bytes allocated in the heap+-- > 3,320 bytes copied during GC+-- > 44,376 bytes maximum residency (1 sample(s))+-- > 25,256 bytes maximum slop+-- > 3 MiB total memory in use (0 MB lost due to fragmentation)+--+-- (and, in fact, faster than with __@FRList@__ by a small factor).+--+-- The __@[]@__ list structure works as an efficient iterator when used+-- just once. When space-leaks via list reuse are not a concern, and/or+-- memoisation is actually desirable, the regular list implementation is+-- likely to be faster. This is not a suggestion to replace all your uses of+-- __@[]@__ with a generative alternative.+--+-- The __@FRList@__ type could be further extended with instances of 'Functor',+-- 'Applicative', 'Monad', 'Alternative', etc., and could then provide a+-- fully-featured list type, optimised for reuse without space-leaks. If,+-- however, all that's required is space-efficient, re-use friendly iteration,+-- less is perhaps more, and just @Foldable@ may be sufficient.++--------------++-- $multipass+--+-- #multipass#+-- In applications where you want to compute a composite function of a+-- structure, which requires more than one aggregate as an input, it is+-- generally best to compute all the aggregates in a single pass, rather+-- than to traverse the same structure repeatedly.+--+-- The [@foldl@](http://hackage.haskell.org/package/foldl) package implements a+-- robust general framework for dealing with this situation. If you choose to+-- to do it yourself, with a bit of care, the simplest cases are not difficult+-- to handle directly. You just need to accumulate the individual aggregates+-- as __strict__ components of a single data type, and then apply a final+-- transformation to it to extract the composite result. For example,+-- computing an average requires computing both the 'sum' and the 'length' of a+-- (non-empty) structure and dividing the sum by the length:+--+-- > import Data.Foldable (foldl')+-- >+-- > data PairS a b = P !a !b -- We define a strict pair datatype+-- >+-- > -- | Compute sum and length in a single pass, then reduce to the average.+-- > average :: (Foldable f, Fractional a) => f a -> a+-- > average xs =+-- > let sumlen (P s l) a = P (s + a) (l + 1 :: Int)+-- > (P s l) = foldl' sumlen (P 0 0) xs+-- > in s / fromIntegral l+--+-- The above example is somewhat contrived, some structures keep track of their+-- length internally, and can return it in \(\mathcal{O}(1)\) time, so this+-- particular recipe for averages is not always the most efficient. In+-- general, composite aggregate functions of large structures benefit from+-- single-pass reduction. This is especially the case when reuse of a list and+-- memoisation of its elements is thereby avoided,++--------------++-- $laws+--+-- @Foldable@ instances are expected to satisfy the following laws:+--+-- > foldr f z t = appEndo (foldMap (Endo . f) t ) z+--+-- > foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z+--+-- > fold = foldMap id+--+-- > length = getSum . foldMap (Sum . const 1)+--+-- @sum@, @product@, @maximum@, and @minimum@ should all be essentially+-- equivalent to @foldMap@ forms, such as+--+-- > sum = getSum . foldMap' Sum+-- > product = getProduct . foldMap' Product+--+-- but are generally more efficient when defined more directly as:+--+-- > sum = foldl' (+) 0+-- > sum = foldl' (*) 1+--+-- If the type is also a 'Functor' instance, it should satisfy+--+-- > foldMap f = fold . fmap f+--+-- which implies that+--+-- > foldMap f . fmap g = foldMap (f . g)+--++--------------++-- $notes+--+-- #notes#+-- The absence of a 'Functor' superclass allows+-- @Foldable@ structures to impose constraints on their element types. Thus,+-- Sets are @Foldable@, even though @Set@ imposes an 'Ord' constraint on its+-- elements (this precludes defining a @Functor@ instance for @Set@).+--+-- The @Foldable@ class makes it possible to use idioms familiar from the List+-- type with container structures that are better suited to the task at hand.+-- This allows a user to substitute more appropriate @Foldable@ data types+-- for Lists without requiring new idioms (see [[1\]](#uselistsnot) for when+-- not to use lists).+--+-- The more general methods of the @Foldable@ class are now exported by the+-- "Prelude" in place of the original List-specific methods (see the+-- [FTP Proposal](https://wiki.haskell.org/Foldable_Traversable_In_Prelude)).+-- The List-specific variants are for now still available in "GHC.OldList", but+-- that module is intended only as a transitional aid, and may be removed in+-- the future.+--+-- Surprises can arise from the @Foldable@ instance of the 2-tuple @(a,)@ which+-- now behaves as a 1-element @Foldable@ container in its second slot. In+-- contexts where a specific monomorphic type is expected, and you want to be+-- able to rely on type errors to guide refactoring, it may make sense to+-- define and use less-polymorphic variants of some of the @Foldable@ methods.+--+-- Below are two examples showing a definition of a reusable less-polymorphic+-- 'sum' and a one-off in-line specialisation of 'length':+--+-- > {-# LANGUAGE TypeApplications #-}+-- >+-- > mySum :: Num a => [a] -> a+-- > mySum = sum+-- >+-- > type SlowVector a = [a]+-- > slowLength :: SlowVector -> Int+-- > slowLength v = length @[] v+--+-- In both cases, if the data type to which the function is applied changes+-- to something other than a list, the call-site will no longer compile until+-- appropriate changes are made.++--------------++-- $also+--+-- * [1] #uselistsnot# \"When You Should Use Lists in Haskell (Mostly, You Should Not)\",+-- by Johannes Waldmann,+-- in arxiv.org, Programming Languages (cs.PL), at+-- <https://arxiv.org/abs/1808.08329>.+--+-- * [2] \"The Essence of the Iterator Pattern\",+-- by Jeremy Gibbons and Bruno Oliveira,+-- in /Mathematically-Structured Functional Programming/, 2006, online at+-- <http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/#iterator>.
Data/Functor.hs view
@@ -25,7 +25,7 @@ -- Nothing -- (Int -> String) -> Maybe Int -> Maybe String -- -- >>> fmap show [1,2,3] -- (a -> b) -> f a -> f b--- ["1", "2", "3"] -- (Int -> String) -> [Int] -> [String]+-- ["1","2","3"] -- (Int -> String) -> [Int] -> [String] -- -- >>> fmap show [] -- (a -> b) -> f a -> f b -- [] -- (Int -> String) -> [Int] -> [String]@@ -125,16 +125,6 @@ -- | Flipped version of '<$'. ----- Using @ApplicativeDo@: \'@as '$>' b@\' can be understood as the--- @do@ expression------ @--- do as--- pure b--- @------ with an inferred @Functor@ constraint.--- -- @since 4.7.0.0 -- -- ==== __Examples__@@ -171,17 +161,6 @@ -- | @'void' value@ discards or ignores the result of evaluation, such -- as the return value of an 'System.IO.IO' action.--------- Using @ApplicativeDo@: \'@'void' as@\' can be understood as the--- @do@ expression------ @--- do as--- pure ()--- @------ with an inferred @Functor@ constraint. -- -- ==== __Examples__ --
Data/Functor/Classes.hs view
@@ -71,6 +71,7 @@ import Data.List.NonEmpty (NonEmpty(..)) import Data.Ord (Down(Down)) +import GHC.Tuple (Solo (..)) import GHC.Read (expectP, list, paren) import Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec)@@ -499,20 +500,39 @@ liftShowsPrec2 sp1 _ sp2 _ _ (x, y) = showChar '(' . sp1 0 x . showChar ',' . sp2 0 y . showChar ')' +-- | @since 4.15+instance Eq1 Solo where+ liftEq eq (Solo a) (Solo b) = a `eq` b+ -- | @since 4.9.0.0 instance (Eq a) => Eq1 ((,) a) where liftEq = liftEq2 (==) +-- | @since 4.15+instance Ord1 Solo where+ liftCompare cmp (Solo a) (Solo b) = cmp a b+ -- | @since 4.9.0.0 instance (Ord a) => Ord1 ((,) a) where liftCompare = liftCompare2 compare +-- | @since 4.15+instance Read1 Solo where+ liftReadPrec rp _ = readData (readUnaryWith rp "Solo" Solo)++ liftReadListPrec = liftReadListPrecDefault+ liftReadList = liftReadListDefault+ -- | @since 4.9.0.0 instance (Read a) => Read1 ((,) a) where liftReadPrec = liftReadPrec2 readPrec readListPrec liftReadListPrec = liftReadListPrecDefault liftReadList = liftReadListDefault++-- | @since 4.15+instance Show1 Solo where+ liftShowsPrec sp _ d (Solo x) = showsUnaryWith sp "Solo" d x -- | @since 4.9.0.0 instance (Show a) => Show1 ((,) a) where
Data/Functor/Contravariant.hs view
@@ -1,5 +1,8 @@+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DerivingVia #-} {-# LANGUAGE EmptyCase #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeOperators #-}@@ -53,11 +56,11 @@ import Data.Functor.Sum import Data.Functor.Compose -import Data.Monoid (Alt(..))+import Data.Monoid (Alt(..), All(..)) import Data.Proxy import GHC.Generics -import Prelude hiding ((.),id)+import Prelude hiding ((.), id) -- | The class of contravariant functors. --@@ -76,6 +79,7 @@ -- newtype Predicate a = Predicate { getPredicate :: a -> Bool } -- -- instance Contravariant Predicate where+-- contramap :: (a' -> a) -> (Predicate a -> Predicate a') -- contramap f (Predicate p) = Predicate (p . f) -- | `- First, map the input... -- `----- then apply the predicate.@@ -86,7 +90,7 @@ -- -- Any instance should be subject to the following laws: ----- [Identity] @'contramap' 'id' = 'id'@+-- [Identity] @'contramap' 'id' = 'id'@ -- [Composition] @'contramap' (g . f) = 'contramap' f . 'contramap' g@ -- -- Note, that the second law follows from the free theorem of the type of@@ -94,7 +98,7 @@ -- condition holds. class Contravariant f where- contramap :: (a -> b) -> f b -> f a+ contramap :: (a' -> a) -> (f a -> f a') -- | Replace all locations in the output with the same value. -- The default definition is @'contramap' . 'const'@, but this may be@@ -110,7 +114,7 @@ -- lawful we have the following laws: -- -- @--- 'fmap' f ≡ 'phantom'+-- 'fmap' f ≡ 'phantom' -- 'contramap' f ≡ 'phantom' -- @ phantom :: (Functor f, Contravariant f) => f a -> f b@@ -123,79 +127,134 @@ ($<) = flip (>$) -- | This is an infix alias for 'contramap'.-(>$<) :: Contravariant f => (a -> b) -> f b -> f a+(>$<) :: Contravariant f => (a -> b) -> (f b -> f a) (>$<) = contramap -- | This is an infix version of 'contramap' with the arguments flipped. (>$$<) :: Contravariant f => f b -> (a -> b) -> f a (>$$<) = flip contramap -deriving instance Contravariant f => Contravariant (Alt f)-deriving instance Contravariant f => Contravariant (Rec1 f)-deriving instance Contravariant f => Contravariant (M1 i c f)+deriving newtype instance Contravariant f => Contravariant (Alt f)+deriving newtype instance Contravariant f => Contravariant (Rec1 f)+deriving newtype instance Contravariant f => Contravariant (M1 i c f) instance Contravariant V1 where+ contramap :: (a' -> a) -> (V1 a -> V1 a') contramap _ x = case x of instance Contravariant U1 where+ contramap :: (a' -> a) -> (U1 a -> U1 a') contramap _ _ = U1 instance Contravariant (K1 i c) where+ contramap :: (a' -> a) -> (K1 i c a -> K1 i c a') contramap _ (K1 c) = K1 c instance (Contravariant f, Contravariant g) => Contravariant (f :*: g) where+ contramap :: (a' -> a) -> ((f :*: g) a -> (f :*: g) a') contramap f (xs :*: ys) = contramap f xs :*: contramap f ys instance (Functor f, Contravariant g) => Contravariant (f :.: g) where+ contramap :: (a' -> a) -> ((f :.: g) a -> (f :.: g) a') contramap f (Comp1 fg) = Comp1 (fmap (contramap f) fg) instance (Contravariant f, Contravariant g) => Contravariant (f :+: g) where+ contramap :: (a' -> a) -> ((f :+: g) a -> (f :+: g) a') contramap f (L1 xs) = L1 (contramap f xs) contramap f (R1 ys) = R1 (contramap f ys) instance (Contravariant f, Contravariant g) => Contravariant (Sum f g) where+ contramap :: (a' -> a) -> (Sum f g a -> Sum f g a') contramap f (InL xs) = InL (contramap f xs) contramap f (InR ys) = InR (contramap f ys) instance (Contravariant f, Contravariant g)- => Contravariant (Product f g) where- contramap f (Pair a b) = Pair (contramap f a) (contramap f b)+ => Contravariant (Product f g) where+ contramap :: (a' -> a) -> (Product f g a -> Product f g a')+ contramap f (Pair a b) = Pair (contramap f a) (contramap f b) instance Contravariant (Const a) where+ contramap :: (b' -> b) -> (Const a b -> Const a b') contramap _ (Const a) = Const a instance (Functor f, Contravariant g) => Contravariant (Compose f g) where+ contramap :: (a' -> a) -> (Compose f g a -> Compose f g a') contramap f (Compose fga) = Compose (fmap (contramap f) fga) instance Contravariant Proxy where+ contramap :: (a' -> a) -> (Proxy a -> Proxy a') contramap _ _ = Proxy newtype Predicate a = Predicate { getPredicate :: a -> Bool }---- | A 'Predicate' is a 'Contravariant' 'Functor', because 'contramap' can--- apply its function argument to the input of the predicate.-instance Contravariant Predicate where- contramap f g = Predicate $ getPredicate g . f--instance Semigroup (Predicate a) where- Predicate p <> Predicate q = Predicate $ \a -> p a && q a+ deriving+ ( -- | @('<>')@ on predicates uses logical conjunction @('&&')@ on+ -- the results. Without newtypes this equals @'liftA2' (&&)@.+ --+ -- @+ -- (<>) :: Predicate a -> Predicate a -> Predicate a+ -- Predicate pred <> Predicate pred' = Predicate \a ->+ -- pred a && pred' a+ -- @+ Semigroup+ , -- | @'mempty'@ on predicates always returns @True@. Without+ -- newtypes this equals @'pure' True@.+ --+ -- @+ -- mempty :: Predicate a+ -- mempty = \_ -> True+ -- @+ Monoid+ )+ via a -> All -instance Monoid (Predicate a) where- mempty = Predicate $ const True+ deriving+ ( -- | A 'Predicate' is a 'Contravariant' 'Functor', because+ -- 'contramap' can apply its function argument to the input of+ -- the predicate.+ --+ -- Without newtypes @'contramap' f@ equals precomposing with @f@+ -- (= @(. f)@).+ --+ -- @+ -- contramap :: (a' -> a) -> (Predicate a -> Predicate a')+ -- contramap f (Predicate g) = Predicate (g . f)+ -- @+ Contravariant+ )+ via Op Bool -- | Defines a total ordering on a type as per 'compare'. -- -- This condition is not checked by the types. You must ensure that the -- supplied values are valid total orderings yourself. newtype Comparison a = Comparison { getComparison :: a -> a -> Ordering }--deriving instance Semigroup (Comparison a)-deriving instance Monoid (Comparison a)+ deriving+ newtype+ ( -- | @('<>')@ on comparisons combines results with @('<>')+ -- \@Ordering@. Without newtypes this equals @'liftA2' ('liftA2'+ -- ('<>'))@.+ --+ -- @+ -- (<>) :: Comparison a -> Comparison a -> Comparison a+ -- Comparison cmp <> Comparison cmp' = Comparison \a a' ->+ -- cmp a a' <> cmp a a'+ -- @+ Semigroup+ , -- | @'mempty'@ on comparisons always returns @EQ@. Without+ -- newtypes this equals @'pure' ('pure' EQ)@.+ --+ -- @+ -- mempty :: Comparison a+ -- mempty = Comparison \_ _ -> EQ+ -- @+ Monoid+ ) -- | A 'Comparison' is a 'Contravariant' 'Functor', because 'contramap' can -- apply its function argument to each input of the comparison function. instance Contravariant Comparison where- contramap f g = Comparison $ on (getComparison g) f+ contramap :: (a' -> a) -> (Comparison a -> Comparison a')+ contramap f (Comparison g) = Comparison (on g f) -- | Compare using 'compare'. defaultComparison :: Ord a => Comparison a@@ -214,18 +273,34 @@ -- The types alone do not enforce these laws, so you'll have to check them -- yourself. newtype Equivalence a = Equivalence { getEquivalence :: a -> a -> Bool }+ deriving+ ( -- | @('<>')@ on equivalences uses logical conjunction @('&&')@+ -- on the results. Without newtypes this equals @'liftA2'+ -- ('liftA2' (&&))@.+ --+ -- @+ -- (<>) :: Equivalence a -> Equivalence a -> Equivalence a+ -- Equivalence equiv <> Equivalence equiv' = Equivalence \a b ->+ -- equiv a b && equiv a b+ -- @+ Semigroup+ , -- | @'mempty'@ on equivalences always returns @True@. Without+ -- newtypes this equals @'pure' ('pure' True)@.+ --+ -- @+ -- mempty :: Equivalence a+ -- mempty = Equivalence \_ _ -> True+ -- @+ Monoid+ )+ via a -> a -> All -- | Equivalence relations are 'Contravariant', because you can -- apply the contramapped function to each input to the equivalence -- relation. instance Contravariant Equivalence where- contramap f g = Equivalence $ on (getEquivalence g) f--instance Semigroup (Equivalence a) where- Equivalence p <> Equivalence q = Equivalence $ \a b -> p a b && q a b--instance Monoid (Equivalence a) where- mempty = Equivalence (\_ _ -> True)+ contramap :: (a' -> a) -> (Equivalence a -> Equivalence a')+ contramap f (Equivalence g) = Equivalence (on g f) -- | Check for equivalence with '=='. --@@ -238,15 +313,36 @@ -- | Dual function arrows. newtype Op a b = Op { getOp :: b -> a }--deriving instance Semigroup a => Semigroup (Op a b)-deriving instance Monoid a => Monoid (Op a b)+ deriving+ newtype+ ( -- | @('<>') \@(Op a b)@ without newtypes is @('<>') \@(b->a)@ =+ -- @liftA2 ('<>')@. This lifts the 'Semigroup' operation+ -- @('<>')@ over the output of @a@.+ --+ -- @+ -- (<>) :: Op a b -> Op a b -> Op a b+ -- Op f <> Op g = Op \a -> f a <> g a+ -- @+ Semigroup+ , -- | @'mempty' \@(Op a b)@ without newtypes is @mempty \@(b->a)@+ -- = @\_ -> mempty@.+ --+ -- @+ -- mempty :: Op a b+ -- mempty = Op \_ -> mempty+ -- @+ Monoid+ ) instance Category Op where+ id :: Op a a id = Op id++ (.) :: Op b c -> Op a b -> Op a c Op f . Op g = Op (g . f) instance Contravariant (Op a) where+ contramap :: (b' -> b) -> (Op a b -> Op a b') contramap f g = Op (getOp g . f) instance Num a => Num (Op a b) where
Data/IORef.hs view
@@ -49,7 +49,7 @@ -- |Mutate the contents of an 'IORef'. -- -- Be warned that 'modifyIORef' does not apply the function strictly. This--- means if the program calls 'modifyIORef' many times, but seldomly uses the+-- means if the program calls 'modifyIORef' many times, but seldom uses the -- value, thunks will pile up in memory resulting in a space leak. This is a -- common mistake made when using an IORef as a counter. For example, the -- following will likely produce a stack overflow:
Data/Kind.hs view
@@ -14,6 +14,7 @@ -- @since 4.9.0.0 ----------------------------------------------------------------------------- -module Data.Kind ( Type, Constraint ) where+module Data.Kind ( Type, Constraint, FUN ) where +import GHC.Prim import GHC.Types
Data/List.hs view
@@ -25,6 +25,7 @@ , tail , init , uncons+ , singleton , null , length
Data/List/NonEmpty.hs view
@@ -42,6 +42,7 @@ , tail -- :: NonEmpty a -> [a] , last -- :: NonEmpty a -> a , init -- :: NonEmpty a -> [a]+ , singleton -- :: a -> NonEmpty a , (<|), cons -- :: a -> NonEmpty a -> NonEmpty a , uncons -- :: NonEmpty a -> (a, Maybe (NonEmpty a)) , unfoldr -- :: (a -> (b, Maybe a)) -> a -> NonEmpty b@@ -167,6 +168,12 @@ -- | Extract everything except the last element of the stream. init :: NonEmpty a -> [a] init ~(a :| as) = List.init (a : as)++-- | Construct a 'NonEmpty' list from a single element.+--+-- @since 4.15+singleton :: a -> NonEmpty a+singleton a = a :| [] -- | Prepend an element to the stream. (<|) :: a -> NonEmpty a -> NonEmpty a
Data/Maybe.hs view
@@ -148,8 +148,8 @@ fromJust Nothing = error "Maybe.fromJust: Nothing" -- yuck fromJust (Just x) = x --- | The 'fromMaybe' function takes a default value and and 'Maybe'--- value. If the 'Maybe' is 'Nothing', it returns the default values;+-- | The 'fromMaybe' function takes a default value and a 'Maybe'+-- value. If the 'Maybe' is 'Nothing', it returns the default value; -- otherwise, it returns the value contained in the 'Maybe'. -- -- ==== __Examples__
Data/Monoid.hs view
@@ -129,16 +129,6 @@ -- -- >>> getFirst (First (Just "hello") <> First Nothing <> First (Just "world")) -- Just "hello"------ Use of this type is discouraged. Note the following equivalence:------ > Data.Monoid.First x === Maybe (Data.Semigroup.First x)------ In addition to being equivalent in the structural sense, the two--- also have 'Monoid' instances that behave the same. This type will--- be marked deprecated in GHC 8.8, and removed in GHC 8.10.--- Users are advised to use the variant from "Data.Semigroup" and wrap--- it in 'Maybe'. newtype First a = First { getFirst :: Maybe a } deriving ( Eq -- ^ @since 2.01 , Ord -- ^ @since 2.01@@ -168,16 +158,6 @@ -- -- >>> getLast (Last (Just "hello") <> Last Nothing <> Last (Just "world")) -- Just "world"------ Use of this type is discouraged. Note the following equivalence:------ > Data.Monoid.Last x === Maybe (Data.Semigroup.Last x)------ In addition to being equivalent in the structural sense, the two--- also have 'Monoid' instances that behave the same. This type will--- be marked deprecated in GHC 8.8, and removed in GHC 8.10.--- Users are advised to use the variant from "Data.Semigroup" and wrap--- it in 'Maybe'. newtype Last a = Last { getLast :: Maybe a } deriving ( Eq -- ^ @since 2.01 , Ord -- ^ @since 2.01@@ -233,7 +213,33 @@ minBound = pure minBound maxBound = pure maxBound --- | @since 4.12.0.0+-- | Note that even if the underlying 'Num' and 'Applicative' instances are+-- lawful, for most 'Applicative's, this instance will not be lawful. If you use+-- this instance with the list 'Applicative', the following customary laws will+-- not hold:+--+-- Commutativity:+--+-- >>> Ap [10,20] + Ap [1,2]+-- Ap {getAp = [11,12,21,22]}+-- >>> Ap [1,2] + Ap [10,20]+-- Ap {getAp = [11,21,12,22]}+--+-- Additive inverse:+--+-- >>> Ap [] + negate (Ap [])+-- Ap {getAp = []}+-- >>> fromInteger 0 :: Ap [] Int+-- Ap {getAp = [0]}+--+-- Distributivity:+--+-- >>> Ap [1,2] * (3 + 4)+-- Ap {getAp = [7,14]}+-- >>> (Ap [1,2] * 3) + (Ap [1,2] * 4)+-- Ap {getAp = [7,11,10,14]}+--+-- @since 4.12.0.0 instance (Applicative f, Num a) => Num (Ap f a) where (+) = liftA2 (+) (*) = liftA2 (*)
Data/OldList.hs view
@@ -26,6 +26,7 @@ , tail , init , uncons+ , singleton , null , length @@ -1258,7 +1259,7 @@ -- input list. This is called the decorate-sort-undecorate paradigm, or -- Schwartzian transform. ----- Elements are arranged from from lowest to highest, keeping duplicates in+-- Elements are arranged from lowest to highest, keeping duplicates in -- the order they appeared in the input. -- -- >>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]@@ -1268,6 +1269,16 @@ sortOn :: Ord b => (a -> b) -> [a] -> [a] sortOn f = map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))++-- | Produce singleton list.+--+-- >>> singleton True+-- [True]+--+-- @since 4.14.0.0+--+singleton :: a -> [a]+singleton x = [x] -- | The 'unfoldr' function is a \`dual\' to 'foldr': while 'foldr' -- reduces a list to a summary value, 'unfoldr' builds a list from
Data/Ord.hs view
@@ -27,11 +27,11 @@ import Foreign.Storable (Storable) import GHC.Ix (Ix) import GHC.Base-import GHC.Enum (Bounded, Enum)+import GHC.Enum (Bounded(..)) import GHC.Float (Floating, RealFloat) import GHC.Num import GHC.Read-import GHC.Real (Fractional, Integral, Real, RealFrac)+import GHC.Real (Fractional, Real, RealFrac) import GHC.Show -- |@@ -46,11 +46,30 @@ -- | The 'Down' type allows you to reverse sort order conveniently. A value of type -- @'Down' a@ contains a value of type @a@ (represented as @'Down' a@).+-- -- If @a@ has an @'Ord'@ instance associated with it then comparing two -- values thus wrapped will give you the opposite of their normal sort order. -- This is particularly useful when sorting in generalised list comprehensions,--- as in: @then sortWith by 'Down' x@+-- as in: @then sortWith by 'Down' x@. --+-- >>> compare True False+-- GT+--+-- >>> compare (Down True) (Down False)+-- LT+--+-- If @a@ has a @'Bounded'@ instance then the wrapped instance also respects+-- the reversed ordering by exchanging the values of @'minBound'@ and+-- @'maxBound'@.+--+-- >>> minBound :: Int+-- -9223372036854775808+--+-- >>> minBound :: Down Int+-- Down 9223372036854775807+--+-- All other instances of @'Down' a@ behave as they do for @a@.+-- -- @since 4.6.0.0 newtype Down a = Down { getDown :: a -- ^ @since 4.14.0.0@@ -61,12 +80,9 @@ , Semigroup -- ^ @since 4.11.0.0 , Monoid -- ^ @since 4.11.0.0 , Bits -- ^ @since 4.14.0.0- , Bounded -- ^ @since 4.14.0.0- , Enum -- ^ @since 4.14.0.0 , FiniteBits -- ^ @since 4.14.0.0 , Floating -- ^ @since 4.14.0.0 , Fractional -- ^ @since 4.14.0.0- , Integral -- ^ @since 4.14.0.0 , Ix -- ^ @since 4.14.0.0 , Real -- ^ @since 4.14.0.0 , RealFrac -- ^ @since 4.14.0.0@@ -93,6 +109,13 @@ -- | @since 4.6.0.0 instance Ord a => Ord (Down a) where compare (Down x) (Down y) = y `compare` x++-- | Swaps @'minBound'@ and @'maxBound'@ of the underlying type.+--+-- @since 4.14.0.0+instance Bounded a => Bounded (Down a) where+ minBound = Down maxBound+ maxBound = Down minBound -- | @since 4.11.0.0 instance Functor Down where
Data/STRef.hs view
@@ -40,7 +40,7 @@ -- "Hello, world!" -- -- Be warned that 'modifySTRef' does not apply the function strictly. This--- means if the program calls 'modifySTRef' many times, but seldomly uses the+-- means if the program calls 'modifySTRef' many times, but seldom uses the -- value, thunks will pile up in memory resulting in a space leak. This is a -- common mistake made when using an 'STRef' as a counter. For example, the -- following will leak memory and may produce a stack overflow:
Data/Semigroup.hs view
@@ -125,6 +125,21 @@ cycle1 xs = xs' where xs' = xs <> xs' -- | This lets you use a difference list of a 'Semigroup' as a 'Monoid'.+--+-- === __Example:__+-- >>> let hello = diff "Hello, "+-- >>> appEndo hello "World!"+-- "Hello, World!"+-- >>> appEndo (hello <> mempty) "World!"+-- "Hello, World!"+-- >>> appEndo (mempty <> hello) "World!"+-- "Hello, World!"+-- >>> let world = diff "World"+-- >>> let excl = diff "!"+-- >>> appEndo (hello <> (world <> excl)) mempty+-- "Hello, World!"+-- >>> appEndo ((hello <> world) <> excl) mempty+-- "Hello, World!" diff :: Semigroup m => m -> Endo m diff = Endo . (<>) @@ -271,7 +286,15 @@ -- | 'Arg' isn't itself a 'Semigroup' in its own right, but it can be -- placed inside 'Min' and 'Max' to compute an arg min or arg max.-data Arg a b = Arg a b deriving+--+-- >>> minimum [ Arg (x * x) x | x <- [-10 .. 10] ]+-- Arg 0 0+data Arg a b = Arg+ a+ -- ^ The argument used for comparisons in 'Eq' and 'Ord'.+ b+ -- ^ The "value" exposed via the 'Functor', 'Foldable' etc. instances.+ deriving ( Show -- ^ @since 4.9.0.0 , Read -- ^ @since 4.9.0.0 , Data -- ^ @since 4.9.0.0@@ -279,7 +302,14 @@ , Generic1 -- ^ @since 4.9.0.0 ) +-- |+-- >>> Min (Arg 0 ()) <> Min (Arg 1 ())+-- Min {getMin = Arg 0 ()} type ArgMin a b = Min (Arg a b)++-- |+-- >>> Max (Arg 0 ()) <> Max (Arg 1 ())+-- Max {getMax = Arg 1 ()} type ArgMax a b = Max (Arg a b) -- | @since 4.9.0.0@@ -320,8 +350,6 @@ instance Bitraversable Arg where bitraverse f g (Arg a b) = Arg <$> f a <*> g b --- | Use @'Option' ('First' a)@ to get the behavior of--- 'Data.Monoid.First' from "Data.Monoid". newtype First a = First { getFirst :: a } deriving ( Bounded -- ^ @since 4.9.0.0 , Eq -- ^ @since 4.9.0.0@@ -378,8 +406,6 @@ instance MonadFix First where mfix f = fix (f . getFirst) --- | Use @'Option' ('Last' a)@ to get the behavior of--- 'Data.Monoid.Last' from "Data.Monoid" newtype Last a = Last { getLast :: a } deriving ( Bounded -- ^ @since 4.9.0.0 , Eq -- ^ @since 4.9.0.0@@ -484,6 +510,8 @@ | n == 0 = mempty | otherwise = unwrapMonoid (stimes n (WrapMonoid x)) +{-# DEPRECATED Option, option "will be removed in GHC 9.2; use 'Maybe' instead." #-}+ -- | 'Option' is effectively 'Maybe' with a better instance of -- 'Monoid', built off of an underlying 'Semigroup' instead of an -- underlying 'Monoid'.@@ -493,8 +521,7 @@ -- -- In GHC 8.4 and higher, the 'Monoid' instance for 'Maybe' has been -- corrected to lift a 'Semigroup' instance instead of a 'Monoid'--- instance. Consequently, this type is no longer useful. It will be--- marked deprecated in GHC 8.8 and removed in GHC 8.10.+-- instance. Consequently, this type is no longer useful. newtype Option a = Option { getOption :: Maybe a } deriving ( Eq -- ^ @since 4.9.0.0 , Ord -- ^ @since 4.9.0.0
Data/Semigroup/Internal.hs view
@@ -4,7 +4,7 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} --- | Auxilary definitions for 'Semigroup'+-- | Auxiliary definitions for 'Semigroup' -- -- This module provides some @newtype@ wrappers and helpers which are -- reexported from the "Data.Semigroup" module or imported directly
Data/Semigroup/Internal.hs-boot view
@@ -4,7 +4,7 @@ import {-# SOURCE #-} GHC.Real (Integral) import {-# SOURCE #-} GHC.Base (Semigroup,Monoid,Maybe)-import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
Data/Traversable.hs view
@@ -18,24 +18,6 @@ -- -- Class of data structures that can be traversed from left to right, -- performing an action on each element.------ See also------ * \"Applicative Programming with Effects\",--- by Conor McBride and Ross Paterson,--- /Journal of Functional Programming/ 18:1 (2008) 1-13, online at--- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.------ * \"The Essence of the Iterator Pattern\",--- by Jeremy Gibbons and Bruno Oliveira,--- in /Mathematically-Structured Functional Programming/, 2006, online at--- <http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/#iterator>.------ * \"An Investigation of the Laws of Traversals\",--- by Mauro Jaskelioff and Ondrej Rypacek,--- in /Mathematically-Structured Functional Programming/, 2012, online at--- <http://arxiv.org/pdf/1202.2919>.--- ----------------------------------------------------------------------------- module Data.Traversable (@@ -49,6 +31,32 @@ -- * General definitions for superclass methods fmapDefault, foldMapDefault,++ -- * Overview+ -- $overview++ -- ** The 'traverse' and 'mapM' methods+ -- $traverse++ -- ** Validation use-case+ -- $validation++ -- ** The 'sequenceA' and 'sequence' methods+ -- $sequence++ -- ** Sample instance+ -- $sample_instance++ -- ** Construction+ --+ -- $construction++ -- * Laws+ --+ -- $laws++ -- * See also+ -- $also ) where -- It is convenient to use 'Const' here but this means we must@@ -56,7 +64,7 @@ import Control.Applicative ( Const(..), ZipList(..) ) import Data.Coerce import Data.Either ( Either(..) )-import Data.Foldable ( Foldable )+import Data.Foldable import Data.Functor import Data.Functor.Identity ( Identity(..) ) import Data.Functor.Utils ( StateL(..), StateR(..) )@@ -70,89 +78,58 @@ ($), (.), id, flip ) import GHC.Generics import qualified GHC.List as List ( foldr )+import GHC.Tuple (Solo (..)) +-- $setup+-- >>> import Prelude+-- >>> import Data.Maybe (catMaybes, mapMaybe)+-- >>> import Data.Either (rights)+-- >>> import Data.Foldable (traverse_)++-- XXX: Missing haddock feature. Links to anchors in other modules+-- don't have a sensible way to name the link within the module itself.+-- Thus, the below "Data.Traversable#overview" works well when shown as+-- @Data.Traversable@ from other modules, but in the home module it should+-- be possible to specify alternative link text. :-(+ -- | Functors representing data structures that can be traversed from--- left to right.------ A definition of 'traverse' must satisfy the following laws:------ [Naturality]--- @t . 'traverse' f = 'traverse' (t . f)@--- for every applicative transformation @t@------ [Identity]--- @'traverse' 'Identity' = 'Identity'@------ [Composition]--- @'traverse' ('Data.Functor.Compose.Compose' . 'fmap' g . f)--- = 'Data.Functor.Compose.Compose' . 'fmap' ('traverse' g) . 'traverse' f@------ A definition of 'sequenceA' must satisfy the following laws:------ [Naturality]--- @t . 'sequenceA' = 'sequenceA' . 'fmap' t@--- for every applicative transformation @t@------ [Identity]--- @'sequenceA' . 'fmap' 'Identity' = 'Identity'@------ [Composition]--- @'sequenceA' . 'fmap' 'Data.Functor.Compose.Compose'--- = 'Data.Functor.Compose.Compose' . 'fmap' 'sequenceA' . 'sequenceA'@------ where an /applicative transformation/ is a function------ @t :: (Applicative f, Applicative g) => f a -> g a@------ preserving the 'Applicative' operations, i.e.------ @--- t ('pure' x) = 'pure' x--- t (f '<*>' x) = t f '<*>' t x--- @------ and the identity functor 'Identity' and composition functors--- 'Data.Functor.Compose.Compose' are from "Data.Functor.Identity" and--- "Data.Functor.Compose".------ A result of the naturality law is a purity law for 'traverse'------ @'traverse' 'pure' = 'pure'@------ (The naturality law is implied by parametricity and thus so is the--- purity law [1, p15].)------ Instances are similar to 'Functor', e.g. given a data type------ > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)------ a suitable instance would be------ > instance Traversable Tree where--- > traverse f Empty = pure Empty--- > traverse f (Leaf x) = Leaf <$> f x--- > traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r------ This is suitable even for abstract types, as the laws for '<*>'--- imply a form of associativity.------ The superclass instances should satisfy the following:------ * In the 'Functor' instance, 'fmap' should be equivalent to traversal--- with the identity applicative functor ('fmapDefault').+-- left to right, performing an action on each element. ----- * In the 'Foldable' instance, 'Data.Foldable.foldMap' should be--- equivalent to traversal with a constant applicative functor--- ('foldMapDefault').+-- A more detailed description can be found in the overview section of+-- "Data.Traversable#overview". ----- References:--- [1] The Essence of the Iterator Pattern, Jeremy Gibbons and Bruno C. d. S. Oliveira class (Functor t, Foldable t) => Traversable t where {-# MINIMAL traverse | sequenceA #-} -- | Map each element of a structure to an action, evaluate these actions -- from left to right, and collect the results. For a version that ignores -- the results see 'Data.Foldable.traverse_'.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- In the first two examples we show each evaluated action mapping to the+ -- output structure.+ --+ -- >>> traverse Just [1,2,3,4]+ -- Just [1,2,3,4]+ --+ -- >>> traverse id [Right 1, Right 2, Right 3, Right 4]+ -- Right [1,2,3,4]+ --+ -- In the next examples, we show that 'Nothing' and 'Left' values short+ -- circuit the created structure.+ --+ -- >>> traverse (const Nothing) [1,2,3,4]+ -- Nothing+ --+ -- >>> traverse (\x -> if odd x then Just x else Nothing) [1,2,3,4]+ -- Nothing+ --+ -- >>> traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]+ -- Left 0+ -- traverse :: Applicative f => (a -> f b) -> t a -> f (t b) {-# INLINE traverse #-} -- See Note [Inline default methods] traverse f = sequenceA . fmap f@@ -160,6 +137,30 @@ -- | Evaluate each action in the structure from left to right, and -- collect the results. For a version that ignores the results -- see 'Data.Foldable.sequenceA_'.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- For the first two examples we show sequenceA fully evaluating a+ -- a structure and collecting the results.+ --+ -- >>> sequenceA [Just 1, Just 2, Just 3]+ -- Just [1,2,3]+ --+ -- >>> sequenceA [Right 1, Right 2, Right 3]+ -- Right [1,2,3]+ --+ -- The next two example show 'Nothing' and 'Just' will short circuit+ -- the resulting structure if present in the input. For more context,+ -- check the 'Traversable' instances for 'Either' and 'Maybe'.+ --+ -- >>> sequenceA [Just 1, Just 2, Just 3, Nothing]+ -- Nothing+ --+ -- >>> sequenceA [Right 1, Right 2, Right 3, Left 4]+ -- Left 4+ -- sequenceA :: Applicative f => t (f a) -> f (t a) {-# INLINE sequenceA #-} -- See Note [Inline default methods] sequenceA = traverse id@@ -167,6 +168,13 @@ -- | Map each element of a structure to a monadic action, evaluate -- these actions from left to right, and collect the results. For -- a version that ignores the results see 'Data.Foldable.mapM_'.+ --+ -- ==== __Examples__+ --+ -- 'mapM' is literally a 'traverse' with a type signature restricted+ -- to 'Monad'. Its implementation may be more efficient due to additional+ -- power of 'Monad'.+ -- mapM :: Monad m => (a -> m b) -> t a -> m (t b) {-# INLINE mapM #-} -- See Note [Inline default methods] mapM = traverse@@ -174,6 +182,29 @@ -- | Evaluate each monadic action in the structure from left to -- right, and collect the results. For a version that ignores the -- results see 'Data.Foldable.sequence_'.+ --+ -- ==== __Examples__+ --+ -- Basic usage:+ --+ -- The first two examples are instances where the input and+ -- and output of 'sequence' are isomorphic.+ --+ -- >>> sequence $ Right [1,2,3,4]+ -- [Right 1,Right 2,Right 3,Right 4]+ --+ -- >>> sequence $ [Right 1,Right 2,Right 3,Right 4]+ -- Right [1,2,3,4]+ --+ -- The following examples demonstrate short circuit behavior+ -- for 'sequence'.+ --+ -- >>> sequence $ Left [1,2,3,4]+ -- Left [1,2,3,4]+ --+ -- >>> sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]+ -- Left 0+ -- sequence :: Monad m => t (m a) -> m (t a) {-# INLINE sequence #-} -- See Note [Inline default methods] sequence = sequenceA@@ -241,6 +272,9 @@ traverse _ (Left x) = pure (Left x) traverse f (Right y) = Right <$> f y +-- | @since 4.15+deriving instance Traversable Solo+ -- | @since 4.7.0.0 instance Traversable ((,) a) where traverse f (x, y) = (,) x <$> f y@@ -376,6 +410,17 @@ -- and 'Data.Foldable.foldl'; it applies a function to each element of a structure, -- passing an accumulating parameter from left to right, and returning -- a final value of this accumulator together with the new structure.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> mapAccumL (\a b -> (a + b, a)) 0 [1..10]+-- (55,[0,1,3,6,10,15,21,28,36,45])+--+-- >>> mapAccumL (\a b -> (a <> show b, a)) "0" [1..5]+-- ("012345",["0","01","012","0123","01234"])+-- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) mapAccumL f s t = runStateL (traverse (StateL . flip f) t) s @@ -383,6 +428,17 @@ -- and 'Data.Foldable.foldr'; it applies a function to each element of a structure, -- passing an accumulating parameter from right to left, and returning -- a final value of this accumulator together with the new structure.+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> mapAccumR (\a b -> (a + b, a)) 0 [1..10]+-- (55,[54,52,49,45,40,34,27,19,10,0])+--+-- >>> mapAccumR (\a b -> (a <> show b, a)) "0" [1..5]+-- ("054321",["05432","0543","054","05","0"])+-- mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) mapAccumR f s t = runStateR (traverse (StateR . flip f) t) s @@ -411,3 +467,410 @@ {-# INLINE foldMapDefault #-} -- See Note [Function coercion] in Data.Functor.Utils. foldMapDefault = coerce (traverse :: (a -> Const m ()) -> t a -> Const m (t ()))++------------------++-- $overview+--+-- #overview#+-- Traversable functors can be thought of as polymorphic containers that+-- support mapping of applicative (or monadic) effects over the container+-- (element-wise) to create a new container of __the same shape__, with the+-- effects sequenced in a natural order for the container type in question.+--+-- The 'Functor' base class means that the container cannot impose any+-- constraints on the element type, so containers that require elements to+-- be comparable, or hashable, etc., cannot be instances of the @Traversable@+-- class.++------------------++-- $traverse+-- For an 'Applicative' functor __@f@__ and a Traversable functor __@t@__, the+-- type signatures of 'traverse' and 'fmap' are rather similar:+--+-- > fmap :: (a -> f b) -> t a -> t (f b)+-- > traverse :: (a -> f b) -> t a -> f (t b)+--+-- with one crucial difference: 'fmap' produces a container of effects, while+-- traverse produces an aggregate container-valued effect. For example, when+-- __@f@__ is the __@IO@__ monad, and __@t@__ is the List functor, while 'fmap'+-- returns a list of pending IO actions 'traverse' returns an IO action that+-- evaluates to a list of the return values of the individual actions performed+-- left-to-right.+--+-- More concretely, if @nameAndLineCount@ counts the number of lines in a file,+-- returning a pair with input filename and the line count, then traversal+-- over a list of file names produces an IO action that evaluates to a list+-- of __@(fileName, lineCount)@__ pairs:+--+-- @+-- nameAndLineCount :: FilePath -> IO (FilePath, Int)+-- nameAndLineCount fn = ...+-- @+--+-- Then @traverse nameAndLineCount ["/etc/passwd","/etc/hosts"]@+-- could return+--+-- @+-- [("/etc/passwd",56),("/etc/hosts",32)]+-- @+--+-- The specialisation of 'traverse' to the case when __@f@__ is a monad is+-- called 'mapM'. The two are otherwise generally identical:+--+-- > traverse :: (Applicative f, Traversable t) => (a -> f b) -> t a -> f (t b)+-- > mapM :: (Monad m, Traversable t) => (a -> m b) -> t a -> m (t b)+--+-- The behaviour of 'traverse' and 'mapM' can be at first surprising when the+-- applicative functor __@f@__ is __@[]@__ (i.e. the List monad). The List+-- monad is said to be /non-deterministic/, by which is meant that applying a+-- list of __@n@__ functions __@[a -> b]@__ to a list of __@k@__ values+-- __@[a]@__ produces a list of __@n*k@__ values of each function applied to+-- each input value.+--+-- As a result, traversal with a function __@f :: a -> [b]@__, over an input+-- container __@t a@__, yields a list __@[t b]@__, whose length is the product+-- of the lengths of the lists that the function returns for each element of+-- the input container! The individual elements __@a@__ of the container are+-- replaced by each element of __@f a@__ in turn:+--+-- >>> mapM (\n -> [0..n]) $ Just 2+-- [Just 0,Just 1,Just 2]+-- >>> mapM (\n -> [0..n]) [0..2]+-- [[0,0,0],[0,0,1],[0,0,2],[0,1,0],[0,1,1],[0,1,2]]+--+-- If any element of the container is mapped to an empty list, then the+-- aggregate result is empty (no value is available to fill one of the+-- slots of the output container).+--+-- >>> traverse (const []) $ Just 0+-- []+--+-- When however the traversed container is empty, the result is always a+-- singleton of the empty container, the function is never evaluated+-- as there are no input values for it to be applied to.+--+-- >>> traverse (const []) Nothing+-- [Nothing]+--+-- The result of 'traverse' is all-or-nothing, either containers of exactly the+-- same shape as the input or a failure ('Nothing', 'Left', empty list, etc.).+-- The 'traverse' function does not perform selective filtering as with e.g.+-- 'Data.Maybe.mapMaybe':+--+-- >>> let incOdd n = if odd n then Just $ n + 1 else Nothing+-- >>> traverse incOdd [1, 2, 3]+-- Nothing+-- >>> mapMaybe incOdd [1, 2, 3]+-- [2,4]++------------------++-- $validation+--+-- #validation#+-- A hypothetical application of the above is to validate a structure:+--+-- >>> :{+-- validate :: Int -> Either (String, Int) Int+-- validate i = if odd i then Left ("That's odd", i) else Right i+-- :}+--+-- >>> traverse validate [2,4,6,8,10]+-- Right [2,4,6,8,10]+-- >>> traverse validate [2,4,6,8,9]+-- Left ("That's odd",9)+--+-- Since 'Nothing' is an empty structure, none of its elements are odd.+--+-- >>> traverse validate Nothing+-- Right Nothing+-- >>> traverse validate (Just 42)+-- Right (Just 42)+-- >>> traverse validate (Just 17)+-- Left ("That's odd",17)+--+-- However, this is not terribly efficient, because we pay the cost of+-- reconstructing the entire structure as a side effect of validation.+-- It is generally cheaper to just check all the elements and then use+-- the original structure if it is valid. This can be done via the+-- methods of the 'Foldable' superclass, which perform only the+-- side effects without generating a new structure:+--+-- >>> traverse_ validate [2,4,6,8,10]+-- Right ()+-- >>> traverse_ validate [2,4,6,8,9]+-- Left ("That's odd",9)+--+-- The 'Foldable' instance should be defined in a manner that avoids+-- construction of an unnecesary copy of the container.+--+-- The @Foldable@ method 'mapM_' and its flipped version 'forM_' can be used+-- to sequence IO actions over all the elements of a @Traversable@ container+-- (just for their side-effects, ignoring any results) . One special+-- case is a 'Maybe' container that optionally holds a value. Given:+--+-- > action :: a -> IO ()+-- > mvalue :: Maybe a+--+-- if you want to evaluate the __@action@__ in the @Just@ case, and do+-- nothing otherwise, you can write the more concise and more general:+--+-- > mapM_ action mvalue+--+-- rather than+--+-- > maybe (return ()) action mvalue+--+-- The 'mapM_' form works verbatim if the type of __@mvalue@__ is later+-- refactored from __@Maybe a@__ to __@Either e a@__ (assuming it remains+-- OK to silently do nothing in the error case).+--+-- There's even a generic way to handle empty values ('Nothing', 'Left', etc.):+--+-- > case traverse_ (const Nothing) mvalue of+-- > Nothing -> mapM_ action mvalue -- mvalue is non-empty+-- > Just () -> ... handle empty mvalue ...++------------------++-- $sequence+-- The 'sequenceA' and 'sequence' methods are useful when what you have is a+-- container of applicative or, respectively, monadic actions, and you want to+-- evaluate them left-to-right to obtain a container of the computed values.+--+-- > sequenceA :: (Applicative f, Traversable t) => t (f a) -> f (t a)+-- > sequence :: (Monad m, Traversable t) => t (m a) -> m (t a)+-- > sequenceA = traverse id+-- > sequence = mapM id+--+-- When the monad __@m@__ is 'System.IO.IO', applying 'sequence' to a list of+-- IO actions, performs each in turn, returning a list of the results:+--+-- > sequence [putStr "Hello ", putStrLn "World!"]+-- > = (\a b -> [a,b]) <$> putStr "Hello " <*> putStrLn "World!"+-- > = do u1 <- putStr "Hello "+-- > u2 <- putStrLn "World!"+-- > return (u1, u2)+--+-- For 'sequenceA', the /non-deterministic/ behaviour of @List@ is most easily+-- seen in the case of a list of lists (of elements of some common fixed type).+-- The result is a cross-product of all the sublists:+--+-- >>> sequenceA [[0, 1, 2], [30, 40], [500]]+-- [[0,30,500],[0,40,500],[1,30,500],[1,40,500],[2,30,500],[2,40,500]]+--+-- When the monad __@m@__ is 'Maybe' or 'Either', the effect in question is to+-- short-circuit the computation on encountering 'Nothing' or 'Left'.+--+-- >>> sequence [Just 1,Just 2,Just 3]+-- Just [1,2,3]+-- >>> sequence [Just 1,Nothing,Just 3]+-- Nothing+-- >>> sequence [Right 1,Right 2,Right 3]+-- Right [1,2,3]+-- >>> sequence [Right 1,Left "sorry",Right 3]+-- Left "sorry"+--+-- The result of 'sequence' is all-or-nothing, either containers of exactly the+-- same shape as the input or a failure ('Nothing', 'Left', empty list, etc.).+-- The 'sequence' function does not perform selective filtering as with e.g.+-- 'Data.Maybe.catMaybes' or 'Data.Either.rights':+--+-- >>> catMaybes [Just 1,Nothing,Just 3]+-- [1,3]+-- >>> rights [Right 1,Left "sorry",Right 3]+-- [1,3]++------------------++-- $sample_instance+--+-- Instances are similar to 'Functor', e.g. given a data type+--+-- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)+--+-- a suitable instance would be+--+-- > instance Traversable Tree where+-- > traverse f Empty = pure Empty+-- > traverse f (Leaf x) = Leaf <$> f x+-- > traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r+--+-- This definition works for any applicative functor in the co-domain of @f@,+-- as the laws for '<*>' imply a form of associativity.++------------------++-- $construction+--+-- How do @Traversable@ functors manage to construct a new container of the+-- same shape by sequencing effects over their elements? Well, left-to-right+-- traversal with sequencing of effects suggests induction from a base case, so+-- the first question is what is the base case? A @Traversable@ container with+-- elements of type __@a@__ generally has some minimal form that is either+-- "empty" or has just a single element (think "Data.List" vs.+-- "Data.List.Nonempty").+--+-- * If the base case is empty (no associated first value of __@a@__) then+-- traversal just reproduces the empty structure with no side effects,+-- so we have:+--+-- > traverse _ empty = pure empty+--+-- With the List monad, "empty" is __@[]@__, while with 'Maybe' it is+-- 'Nothing'. With __@Either e a@__ we have an /empty/ case for each+-- value of __@e@__.+--+-- * If the base case is a __@singleton a@__, then 'traverse' can take that+-- __@a@__, apply __@f :: a -> F b@__ getting an __@F b@__, then+-- __@fmap singleton@__ over that, getting __@F (singleton b)@__:+--+-- > traverse f (singleton a) = singleton <$> f a+--+-- Since 'Maybe' and 'Either' are either empty or singletons, we have+--+-- > traverse _ Nothing = pure Nothing+-- > traverse f (Just a) = Just <$> f a+--+-- > traverse _ (Left e) = pure (Left e)+-- > traverse f (Right a) = Right <$> f a+--+-- Similarly, for List, we have:+--+-- > traverse f [] = pure []+-- > traverse f [a] = fmap (:[]) (f a) = (:) <$> f a <*> pure []+--+-- What remains to be done is an inductive step beyond the empty and singleton+-- cases. For a concrete @Traversable@ functor @T@ we need to be able to+-- extend our structure incrementally by filling in holes. We can view a+-- partially built structure __@t0 :: T a@__ as a function+-- __@append :: a -> T a@__ that takes one more element __@a@__ to insert into+-- the container to the right of the existing elements to produce a larger+-- structure. Conversely, we can view an element @a@ as a function+-- __@prepend :: T a -> T a@__ of a partially built structure that inserts the+-- element to the left of the existing elements.+--+-- Assuming that 'traverse' has already been defined on the partially built+-- structure:+--+-- > f0 = traverse f t0 :: F (T b)+--+-- we aim to define __@traverse f (append t0 a)@__ and/or+-- __@traverse f (prepend a t0)@__.+--+-- We can lift @append@ and apply it to @f0@ to get:+--+-- > append <$> f0 :: F (b -> T b)+--+-- and from the /next/ element __@a@__ we can obtain __@f a :: F b@__, and+-- this is where we'll make use of the applicative instance of @F@. Adding+-- one more element on the right is then:+--+-- > traverse f (append t0 a) = append <$> traverse f t0 <*> f a+--+-- while prepending an element on the left is:+--+-- > traverse f (prepend a t0) = prepend <$> f a <*> traverse f t0+--+-- The (binary) @Tree@ instance example makes use of both, after defining the+-- @Empty@ base case and the singleton @Leaf@ node case, non-empty internal+-- nodes introduce both a prepended child node on the left and an appended+-- child node on the right:+--+-- > traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r+--+-- The above definitions sequence the 'Applicative' effects of __@F@__ in the+-- expected order while producing results of the expected shape __@T@__.+--+-- For lists we get the natural order of effects by using+-- __@(prepend \<$\> f a)@__ as the operator and __@(traverse f as)@__ as the+-- operand (the actual definition is written as an equivalent right fold+-- in order to enable /fusion/ rules):+--+-- > traverse f [] = pure []+-- > traverse f (a:as) = (:) <$> f a <*> traverse f as+--+-- The origin of the combinatorial product when __@F@__ is __@[]@__ should now+-- be apparent, the /non-deterministic/ definition of @\<*\>@ for @List@ makes+-- multiple independent choices for each element of the structure.++------------------++-- $laws+-- A definition of 'traverse' must satisfy the following laws:+--+-- [Naturality]+-- @t . 'traverse' f = 'traverse' (t . f)@+-- for every applicative transformation @t@+--+-- [Identity]+-- @'traverse' 'Identity' = 'Identity'@+--+-- [Composition]+-- @'traverse' ('Data.Functor.Compose.Compose' . 'fmap' g . f)+-- = 'Data.Functor.Compose.Compose' . 'fmap' ('traverse' g) . 'traverse' f@+--+-- A definition of 'sequenceA' must satisfy the following laws:+--+-- [Naturality]+-- @t . 'sequenceA' = 'sequenceA' . 'fmap' t@+-- for every applicative transformation @t@+--+-- [Identity]+-- @'sequenceA' . 'fmap' 'Identity' = 'Identity'@+--+-- [Composition]+-- @'sequenceA' . 'fmap' 'Data.Functor.Compose.Compose'+-- = 'Data.Functor.Compose.Compose' . 'fmap' 'sequenceA' . 'sequenceA'@+--+-- where an /applicative transformation/ is a function+--+-- @t :: (Applicative f, Applicative g) => f a -> g a@+--+-- preserving the 'Applicative' operations, i.e.+--+-- @+-- t ('pure' x) = 'pure' x+-- t (f '<*>' x) = t f '<*>' t x+-- @+--+-- and the identity functor 'Identity' and composition functors+-- 'Data.Functor.Compose.Compose' are from "Data.Functor.Identity" and+-- "Data.Functor.Compose".+--+-- A result of the naturality law is a purity law for 'traverse'+--+-- @'traverse' 'pure' = 'pure'@+--+-- (The naturality law is implied by parametricity and thus so is the+-- purity law [1, p15].)+--+-- The superclass instances should satisfy the following:+--+-- * In the 'Functor' instance, 'fmap' should be equivalent to traversal+-- with the identity applicative functor ('fmapDefault').+--+-- * In the 'Foldable' instance, 'Data.Foldable.foldMap' should be+-- equivalent to traversal with a constant applicative functor+-- ('foldMapDefault').++------------------++-- $also+--+-- * [1] \"The Essence of the Iterator Pattern\",+-- by Jeremy Gibbons and Bruno Oliveira,+-- in /Mathematically-Structured Functional Programming/, 2006, online at+-- <http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/#iterator>.+--+-- * \"Applicative Programming with Effects\",+-- by Conor McBride and Ross Paterson,+-- /Journal of Functional Programming/ 18:1 (2008) 1-13, online at+-- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.+--+-- * \"An Investigation of the Laws of Traversals\",+-- by Mauro Jaskelioff and Ondrej Rypacek,+-- in /Mathematically-Structured Functional Programming/, 2012, online at+-- <http://arxiv.org/pdf/1202.2919>.
Data/Type/Equality.hs view
@@ -62,7 +62,7 @@ -- in the body of the pattern-match, the compiler knows that @a ~ b@. -- -- @since 4.7.0.0-data a :~: b where -- See Note [The equality types story] in TysPrim+data a :~: b where -- See Note [The equality types story] in GHC.Builtin.Types.Prim Refl :: a :~: a -- with credit to Conal Elliott for 'ty', Erik Hesselink & Martijn van
Data/Typeable/Internal.hs view
@@ -19,6 +19,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE StandaloneKindSignatures #-}+{-# LANGUAGE LinearTypes #-} ----------------------------------------------------------------------------- -- |@@ -81,9 +82,10 @@ typeSymbolTypeRep, typeNatTypeRep, ) where +import GHC.Prim ( FUN ) import GHC.Base import qualified GHC.Arr as A-import GHC.Types ( TYPE )+import GHC.Types ( TYPE, Multiplicity (Many) ) import Data.Type.Equality import GHC.List ( splitAt, foldl', elem ) import GHC.Word@@ -209,18 +211,19 @@ , trAppKind :: !(TypeRep k2) } -- See Note [Kind caching] -> TypeRep (a b) - -- | @TrFun fpr a b@ represents a function type @a -> b@. We use this for+ -- | @TrFun fpr m a b@ represents a function type @a # m -> b@. We use this for -- the sake of efficiency as functions are quite ubiquitous.- TrFun :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)+ TrFun :: forall (m :: Multiplicity) (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). { -- See Note [TypeRep fingerprints] trFunFingerprint :: {-# UNPACK #-} !Fingerprint -- The TypeRep represents a function from trFunArg to -- trFunRes.+ , trFunMul :: !(TypeRep m) , trFunArg :: !(TypeRep a) , trFunRes :: !(TypeRep b) }- -> TypeRep (a -> b)+ -> TypeRep (FUN m a b) {- Note [TypeRep fingerprints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~@@ -308,7 +311,7 @@ -- | A non-indexed type representation. data SomeTypeRep where- SomeTypeRep :: forall k (a :: k). !(TypeRep a) -> SomeTypeRep+ SomeTypeRep :: forall k (a :: k). !(TypeRep a) %1 -> SomeTypeRep instance Eq SomeTypeRep where SomeTypeRep a == SomeTypeRep b =@@ -335,8 +338,8 @@ => TypeRep arg -> TypeRep res -> TypeRep fun-pattern Fun arg res <- TrFun {trFunArg = arg, trFunRes = res}- where Fun arg res = mkTrFun arg res+pattern Fun arg res <- TrFun {trFunArg = arg, trFunRes = res, trFunMul = (eqTypeRep trMany -> Just HRefl)}+ where Fun arg res = mkTrFun trMany arg res -- | Observe the 'Fingerprint' of a type representation --@@ -383,6 +386,9 @@ trLiftedRep :: TypeRep 'LiftedRep trLiftedRep = typeRep +trMany :: TypeRep 'Many+trMany = typeRep+ -- | Construct a representation for a type application that is -- NOT a saturated arrow type. This is not checked! @@ -426,7 +432,7 @@ , Just (IsTYPE (ry :: TypeRep ry)) <- isTYPE (typeRepKind y) , Just HRefl <- withTypeable x $ withTypeable rx $ withTypeable ry $ typeRep @((->) x :: TYPE ry -> Type) `eqTypeRep` rep- = mkTrFun x y+ = mkTrFun trMany x y mkTrAppChecked a b = mkTrApp a b -- | A type application.@@ -455,9 +461,9 @@ data AppOrCon (a :: k) where IsApp :: forall k k' (f :: k' -> k) (x :: k'). ()- => TypeRep f -> TypeRep x -> AppOrCon (f x)+ => TypeRep f %1 -> TypeRep x %1 -> AppOrCon (f x) -- See Note [Con evidence]- IsCon :: IsApplication a ~ "" => TyCon -> [SomeTypeRep] -> AppOrCon a+ IsCon :: IsApplication a ~ "" => TyCon %1 -> [SomeTypeRep] %1 -> AppOrCon a type family IsApplication (x :: k) :: Symbol where IsApplication (_ _) = "An error message about this unifying with \"\" "@@ -565,7 +571,7 @@ eqTypeRep :: forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) eqTypeRep a b- | sameTypeRep a b = Just (unsafeCoerce# HRefl)+ | sameTypeRep a b = Just (unsafeCoerce HRefl) | otherwise = Nothing -- We want GHC to inline eqTypeRep to get rid of the Maybe -- in the usual case that it is scrutinized immediately. We@@ -616,7 +622,7 @@ go (KindRepApp f a) = SomeTypeRep $ mkTrApp (unsafeCoerceRep $ go f) (unsafeCoerceRep $ go a) go (KindRepFun a b)- = SomeTypeRep $ mkTrFun (unsafeCoerceRep $ go a) (unsafeCoerceRep $ go b)+ = SomeTypeRep $ mkTrFun trMany (unsafeCoerceRep $ go a) (unsafeCoerceRep $ go b) go (KindRepTYPE LiftedRep) = SomeTypeRep TrType go (KindRepTYPE r) = unkindedTypeRep $ tYPE `kApp` runtimeRepTypeRep r go (KindRepTypeLitS sort s)@@ -634,7 +640,7 @@ data SomeKindedTypeRep k where SomeKindedTypeRep :: forall k (a :: k). TypeRep a- -> SomeKindedTypeRep k+ %1 -> SomeKindedTypeRep k kApp :: SomeKindedTypeRep (k -> k') -> SomeKindedTypeRep k@@ -712,19 +718,19 @@ rep :: forall (a :: VecElem). Typeable a => SomeKindedTypeRep VecElem rep = kindedTypeRep @VecElem @a -bareArrow :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)+bareArrow :: forall (m :: Multiplicity) (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). ()- => TypeRep (a -> b)- -> TypeRep ((->) :: TYPE r1 -> TYPE r2 -> Type)-bareArrow (TrFun _ a b) =- mkTrCon funTyCon [SomeTypeRep rep1, SomeTypeRep rep2]+ => TypeRep (FUN m a b)+ -> TypeRep (FUN m :: TYPE r1 -> TYPE r2 -> Type)+bareArrow (TrFun _ m a b) =+ mkTrCon funTyCon [SomeTypeRep m, SomeTypeRep rep1, SomeTypeRep rep2] where rep1 = getRuntimeRep $ typeRepKind a :: TypeRep r1 rep2 = getRuntimeRep $ typeRepKind b :: TypeRep r2 bareArrow _ = error "Data.Typeable.Internal.bareArrow: impossible" data IsTYPE (a :: Type) where- IsTYPE :: forall (r :: RuntimeRep). TypeRep r -> IsTYPE (TYPE r)+ IsTYPE :: forall (r :: RuntimeRep). TypeRep r %1 -> IsTYPE (TYPE r) -- | Is a type of the form @TYPE rep@? isTYPE :: TypeRep (a :: Type) -> Maybe (IsTYPE a)@@ -816,8 +822,9 @@ = (tc, xs) go xs (TrApp {trAppFun = f, trAppArg = x}) = go (SomeTypeRep x : xs) f- go [] (TrFun {trFunArg = a, trFunRes = b})- = (funTyCon, [SomeTypeRep a, SomeTypeRep b])+ go [] (TrFun {trFunArg = a, trFunRes = b, trFunMul = mul})+ | Just HRefl <- eqTypeRep trMany mul = (funTyCon, [SomeTypeRep a, SomeTypeRep b])+ | otherwise = errorWithoutStackTrace "Data.Typeable.Internal.splitApps: Only unrestricted functions are supported" go _ (TrFun {}) = errorWithoutStackTrace "Data.Typeable.Internal.splitApps: Impossible 1" go [] TrType = (tyConTYPE, [SomeTypeRep trLiftedRep])@@ -934,7 +941,7 @@ (unpackCStringUtf8# name) -- it is extremely important that this fingerprint computation--- remains in sync with that in TcTypeable to ensure that type+-- remains in sync with that in GHC.Tc.Instance.Typeable to ensure that type -- equality is correct. -- | Exquisitely unsafe.@@ -954,7 +961,7 @@ fingerprint :: Fingerprint fingerprint = mkTyConFingerprint pkg modl name --- This must match the computation done in TcTypeable.mkTyConRepTyConRHS.+-- This must match the computation done in GHC.Tc.Instance.Typeable.mkTyConRepTyConRHS. mkTyConFingerprint :: String -- ^ package name -> String -- ^ module name -> String -- ^ tycon name@@ -983,7 +990,7 @@ mkTypeLitFromString TypeLitSymbol s = SomeTypeRep $ (typeLitTypeRep s tcSymbol :: TypeRep Symbol) mkTypeLitFromString TypeLitNat s =- SomeTypeRep $ (typeLitTypeRep s tcSymbol :: TypeRep Nat)+ SomeTypeRep $ (typeLitTypeRep s tcNat :: TypeRep Nat) tcSymbol :: TyCon tcSymbol = typeRepTyCon (typeRep @Symbol)@@ -997,14 +1004,16 @@ typeLitTypeRep nm kind_tycon = mkTrCon (mkTypeLitTyCon nm kind_tycon) [] -- | For compiler use.-mkTrFun :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)+mkTrFun :: forall (m :: Multiplicity) (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2).- TypeRep a -> TypeRep b -> TypeRep ((a -> b) :: Type)-mkTrFun arg res = TrFun+ TypeRep m -> TypeRep a -> TypeRep b -> TypeRep ((FUN m a b) :: Type)+mkTrFun mul arg res = TrFun { trFunFingerprint = fpr+ , trFunMul = mul , trFunArg = arg , trFunRes = res }- where fpr = fingerprintFingerprints [ typeRepFingerprint arg+ where fpr = fingerprintFingerprints [ typeRepFingerprint mul+ , typeRepFingerprint arg , typeRepFingerprint res] {- $kind_instantiation
Data/Unique.hs view
@@ -24,7 +24,6 @@ import System.IO.Unsafe (unsafePerformIO) -import GHC.Base import GHC.Num import Data.IORef @@ -77,4 +76,4 @@ -- same value, although in practice this is unlikely. The 'Int' -- returned makes a good hash key. hashUnique :: Unique -> Int-hashUnique (Unique i) = I# (hashInteger i)+hashUnique (Unique i) = integerToInt i
+ Data/Version.hs-boot view
@@ -0,0 +1,12 @@+{-# LANGUAGE NoImplicitPrelude #-}++module Data.Version+ ( Version+ , makeVersion+ ) where++import GHC.Base++data Version++makeVersion :: [Int] -> Version
Data/Void.hs view
@@ -78,16 +78,7 @@ -- | If 'Void' is uninhabited then any 'Functor' that holds only -- values of type 'Void' is holding no values.------ Using @ApplicativeDo@: \'@'vacuous' theVoid@\' can be understood as the--- @do@ expression------ @--- do void <- theVoid--- pure (absurd void)--- @------ with an inferred @Functor@ constraint.+-- It is implemented in terms of @fmap absurd@. -- -- @since 4.8.0.0 vacuous :: Functor f => f Void -> f a
Foreign/ForeignPtr/Imp.hs view
@@ -66,31 +66,6 @@ addForeignPtrFinalizer finalizer fObj return fObj -withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b--- ^This is a way to look at the pointer living inside a--- foreign object. This function takes a function which is--- applied to that pointer. The resulting 'IO' action is then--- executed. The foreign object is kept alive at least during--- the whole action, even if it is not used directly--- inside. Note that it is not safe to return the pointer from--- the action and use it after the action completes. All uses--- of the pointer should be inside the--- 'withForeignPtr' bracket. The reason for--- this unsafeness is the same as for--- 'unsafeForeignPtrToPtr' below: the finalizer--- may run earlier than expected, because the compiler can only--- track usage of the 'ForeignPtr' object, not--- a 'Ptr' object made from it.------ This function is normally used for marshalling data to--- or from the object pointed to by the--- 'ForeignPtr', using the operations from the--- 'Storable' class.-withForeignPtr fo io- = do r <- io (unsafeForeignPtrToPtr fo)- touchForeignPtr fo- return r- -- | This variant of 'newForeignPtr' adds a finalizer that expects an -- environment in addition to the finalized pointer. The environment -- that will be passed to the finalizer is fixed by the second argument to
Foreign/Marshal/Alloc.hs view
@@ -116,19 +116,6 @@ alloca = allocaBytesAligned (sizeOf (undefined :: a)) (alignment (undefined :: a)) --- Note [NOINLINE for touch#]--- ~~~~~~~~~~~~~~~~~~~~~~~~~~--- Both allocaBytes and allocaBytesAligned use the touch#, which is notoriously--- fragile in the presence of simplification (see #14346). In particular, the--- simplifier may drop the continuation containing the touch# if it can prove--- that the action passed to allocaBytes will not return. The hack introduced to--- fix this for 8.2.2 is to mark allocaBytes as NOINLINE, ensuring that the--- simplifier can't see the divergence.------ These can be removed once #14375 is fixed, which suggests that we instead do--- away with touch# in favor of a primitive that will capture the scoping left--- implicit in the case of touch#.- -- |@'allocaBytes' n f@ executes the computation @f@, passing as argument -- a pointer to a temporarily allocated block of memory of @n@ bytes. -- The block of memory is sufficiently aligned for any of the basic@@ -143,12 +130,8 @@ case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) -> let addr = Ptr (byteArrayContents# barr#) in case action addr of { IO action' ->- case action' s2 of { (# s3, r #) ->- case touch# barr# s3 of { s4 ->- (# s4, r #)- }}}}}--- See Note [NOINLINE for touch#]-{-# NOINLINE allocaBytes #-}+ keepAlive# barr# s2 action'+ }}} allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b allocaBytesAligned (I# size) (I# align) action = IO $ \ s0 ->@@ -156,12 +139,8 @@ case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) -> let addr = Ptr (byteArrayContents# barr#) in case action addr of { IO action' ->- case action' s2 of { (# s3, r #) ->- case touch# barr# s3 of { s4 ->- (# s4, r #)- }}}}}--- See Note [NOINLINE for touch#]-{-# NOINLINE allocaBytesAligned #-}+ keepAlive# barr# s2 action'+ }}} -- |Resize a memory area that was allocated with 'malloc' or 'mallocBytes' -- to the size needed to store values of type @b@. The returned pointer
Foreign/Marshal/Utils.hs view
@@ -6,7 +6,7 @@ -- Module : Foreign.Marshal.Utils -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : ffi@haskell.org -- Stability : provisional -- Portability : portable@@ -72,8 +72,8 @@ -- 'Foreign.Marshal.Alloc.finalizerFree' when no longer required. -- new :: Storable a => a -> IO (Ptr a)-new val = - do +new val =+ do ptr <- malloc poke ptr val return ptr@@ -122,12 +122,12 @@ -- |Converts a @withXXX@ combinator into one marshalling a value wrapped -- into a 'Maybe', using 'nullPtr' to represent 'Nothing'. ---maybeWith :: ( a -> (Ptr b -> IO c) -> IO c) +maybeWith :: ( a -> (Ptr b -> IO c) -> IO c) -> (Maybe a -> (Ptr b -> IO c) -> IO c) maybeWith = maybe ($ nullPtr) -- |Convert a peek combinator into a one returning 'Nothing' if applied to a--- 'nullPtr' +-- 'nullPtr' -- maybePeek :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b) maybePeek peek ptr | ptr == nullPtr = return Nothing@@ -155,16 +155,26 @@ -- |Copies the given number of bytes from the second area (source) into the -- first (destination); the copied areas may /not/ overlap ---copyBytes :: Ptr a -> Ptr a -> Int -> IO ()-copyBytes dest src size = do _ <- memcpy dest src (fromIntegral size)- return ()+copyBytes+ :: Ptr a -- ^ Destination+ -> Ptr a -- ^ Source+ -> Int -- ^ Size in bytes+ -> IO ()+copyBytes dest src size = do+ _ <- memcpy dest src (fromIntegral size)+ return () -- |Copies the given number of bytes from the second area (source) into the -- first (destination); the copied areas /may/ overlap ---moveBytes :: Ptr a -> Ptr a -> Int -> IO ()-moveBytes dest src size = do _ <- memmove dest src (fromIntegral size)- return ()+moveBytes+ :: Ptr a -- ^ Destination+ -> Ptr a -- ^ Source+ -> Int -- ^ Size in bytes+ -> IO ()+moveBytes dest src size = do+ _ <- memmove dest src (fromIntegral size)+ return () -- Filling up memory area with required values -- -------------------------------------------
GHC/Base.hs view
@@ -1,17 +1,5 @@ {- -NOTA BENE: Do NOT use ($) anywhere in this module! The type of ($) is-slightly magical (it can return unlifted types), and it is wired in.-But, it is also *defined* in this module, with a non-magical type.-GHC gets terribly confused (and *hangs*) if you try to use ($) in this-module, because it has different types in different scenarios.--This is not a problem in general, because the type ($), being wired in, is not-written out to the interface file, so importing files don't get confused.-The problem is only if ($) is used here. So don't!------------------------------------------------ The overall structure of the GHC Prelude is a bit tricky. a) We want to avoid "orphan modules", i.e. ones with instance@@ -132,9 +120,8 @@ import GHC.Maybe import {-# SOURCE #-} GHC.IO (mkUserError, mplusIO) -import GHC.Tuple () -- Note [Depend on GHC.Tuple]-import GHC.Integer () -- Note [Depend on GHC.Integer]-import GHC.Natural () -- Note [Depend on GHC.Natural]+import GHC.Tuple (Solo (..)) -- Note [Depend on GHC.Tuple]+import GHC.Num.Integer () -- Note [Depend on GHC.Num.Integer] -- for 'class Semigroup' import {-# SOURCE #-} GHC.Real (Integral)@@ -144,6 +131,9 @@ , stimesIdempotentMonoid ) +-- $setup+-- >>> import GHC.Num+ infixr 9 . infixr 5 ++ infixl 4 <$@@ -156,30 +146,33 @@ default () -- Double isn't available yet {--Note [Depend on GHC.Integer]-~~~~~~~~~~~~~~~~~~~~~~~~~~~~-The Integer type is special because TidyPgm uses-GHC.Integer.Type.mkInteger to construct Integer literal values-Currently it reads the interface file whether or not the current-module *has* any Integer literals, so it's important that-GHC.Integer.Type (in package integer-gmp or integer-simple) is-compiled before any other module. (There's a hack in GHC to disable-this for packages ghc-prim, integer-gmp, integer-simple, which aren't-allowed to contain any Integer literals.)+Note [Depend on GHC.Num.Integer]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Likewise we implicitly need Integer when deriving things like Eq-instances.+The Integer type is special because GHC.Iface.Tidy uses constructors in+GHC.Num.Integer to construct Integer literal values. Currently it reads the+interface file whether or not the current module *has* any Integer literals, so+it's important that GHC.Num.Integer is compiled before any other module. +(There's a hack in GHC to disable this for packages ghc-prim and ghc-bignum+which aren't allowed to contain any Integer literals.)++Likewise we implicitly need Integer when deriving things like Eq instances.+ The danger is that if the build system doesn't know about the dependency-on Integer, it'll compile some base module before GHC.Integer.Type,+on Integer, it'll compile some base module before GHC.Num.Integer, resulting in:- Failed to load interface for ‘GHC.Integer.Type’- There are files missing in the ‘integer-gmp’ package,+ Failed to load interface for ‘GHC.Num.Integer’+ There are files missing in the ‘ghc-bignum’ package, -Bottom line: we make GHC.Base depend on GHC.Integer; and everything+Bottom line: we make GHC.Base depend on GHC.Num.Integer; and everything else either depends on GHC.Base, or does not have NoImplicitPrelude (and hence depends on Prelude). +Note: this is only a problem with the make-based build system. Hadrian doesn't+seem to interleave compilation of modules from separate packages and respects+the dependency between `base` and `ghc-bignum`.+ Note [Depend on GHC.Tuple] ~~~~~~~~~~~~~~~~~~~~~~~~~~ Similarly, tuple syntax (or ()) creates an implicit dependency on@@ -187,9 +180,6 @@ GHC.Integer] --- to explain this to the build system. We make GHC.Base depend on GHC.Tuple, and everything else depends on GHC.Base or Prelude. -Note [Depend on GHC.Natural]-~~~~~~~~~~~~~~~~~~~~~~~~~~-Similar to GHC.Integer. -} #if 0@@ -231,7 +221,7 @@ -- The default definition should be sufficient, but this can be -- overridden for efficiency. --- -- >>> import Data.List.NonEmpty+ -- >>> import Data.List.NonEmpty (NonEmpty (..)) -- >>> sconcat $ "Hello" :| [" ", "Haskell", "!"] -- "Hello Haskell!" sconcat :: NonEmpty a -> a@@ -300,8 +290,9 @@ -- >>> mconcat ["Hello", " ", "Haskell", "!"] -- "Hello Haskell!" mconcat :: [a] -> a- {-# INLINE mconcat #-} mconcat = foldr mappend mempty+ {-# INLINE mconcat #-}+ -- INLINE in the hope of fusion with mconcat's argument (see !4890) -- | @since 4.9.0.0 instance Semigroup [a] where@@ -332,7 +323,7 @@ We mark them INLINE because the inliner is not generally too keen to inline build forms such as the ones these desugar to without our insistence. Defining these using list comprehensions instead of foldr has an additional potential-benefit, as described in compiler/deSugar/DsListComp.hs: if optimizations+benefit, as described in compiler/GHC/HsToCore/ListComp.hs: if optimizations needed to make foldr/build forms efficient are turned off, we'll get reasonably efficient translations anyway. -}@@ -362,6 +353,15 @@ mempty = () mconcat _ = () +-- | @since 4.15+instance Semigroup a => Semigroup (Solo a) where+ Solo a <> Solo b = Solo (a <> b)+ stimes n (Solo a) = Solo (stimes n a)++-- | @since 4.15+instance Monoid a => Monoid (Solo a) where+ mempty = Solo mempty+ -- | @since 4.9.0.0 instance (Semigroup a, Semigroup b) => Semigroup (a, b) where (a,b) <> (a',b') = (a<>a',b<>b')@@ -436,6 +436,20 @@ instance Semigroup a => Monoid (Maybe a) where mempty = Nothing +-- | @since 4.15+instance Applicative Solo where+ pure = Solo++ -- Note: we really want to match strictly here. This lets us write,+ -- for example,+ --+ -- forceSpine :: Foldable f => f a -> ()+ -- forceSpine xs+ -- | Solo r <- traverse_ Solo xs+ -- = r+ Solo f <*> Solo x = Solo (f x)+ liftA2 f (Solo x) (Solo y) = Solo (f x y)+ -- | For tuples, the 'Monoid' constraint on @a@ determines -- how the first values merge. -- For example, 'String's concatenate:@@ -449,6 +463,10 @@ (u, f) <*> (v, x) = (u <> v, f x) liftA2 f (u, x) (v, y) = (u <> v, f x y) +-- | @since 4.15+instance Monad Solo where+ Solo x >>= f = f x+ -- | @since 4.9.0.0 instance Monoid a => Monad ((,) a) where (u, a) >>= k = case k a of (v, b) -> (u <> v, b)@@ -498,31 +516,61 @@ the first law, so you need only check that the former condition holds. -} -class Functor f where- -- | Using @ApplicativeDo@: \'@'fmap' f as@\' can be understood as- -- the @do@ expression+class Functor f where+ -- | 'fmap' is used to apply a function of type @(a -> b)@ to a value of type @f a@,+ -- where f is a functor, to produce a value of type @f b@.+ -- Note that for any type constructor with more than one parameter (e.g., `Either`),+ -- only the last type parameter can be modified with `fmap` (e.g., `b` in `Either a b`). --- -- @- -- do a <- as- -- pure (f a)- -- @+ -- Some type constructors with two parameters or more have a @'Data.Bifunctor'@ instance that allows+ -- both the last and the penultimate parameters to be mapped over.+ -- ==== __Examples__ --- -- with an inferred @Functor@ constraint.+ -- Convert from a @'Data.Maybe.Maybe' Int@ to a @Maybe String@+ -- using 'Prelude.show':+ --+ -- >>> fmap show Nothing+ -- Nothing+ -- >>> fmap show (Just 3)+ -- Just "3"+ --+ -- Convert from an @'Data.Either.Either' Int Int@ to an+ -- @Either Int String@ using 'Prelude.show':+ --+ -- >>> fmap show (Left 17)+ -- Left 17+ -- >>> fmap show (Right 17)+ -- Right "17"+ --+ -- Double each element of a list:+ --+ -- >>> fmap (*2) [1,2,3]+ -- [2,4,6]+ --+ -- Apply 'Prelude.even' to the second element of a pair:+ --+ -- >>> fmap even (2,2)+ -- (2,True)+ --+ -- It may seem surprising that the function is only applied to the last element of the tuple+ -- compared to the list example above which applies it to every element in the list.+ -- To understand, remember that tuples are type constructors with multiple type parameters:+ -- a tuple of 3 elements `(a,b,c)` can also be written `(,,) a b c` and its `Functor` instance+ -- is defined for `Functor ((,,) a b)` (i.e., only the third parameter is free to be mapped over+ -- with `fmap`).+ --+ -- It explains why `fmap` can be used with tuples containing values of different types as in the+ -- following example:+ --+ -- >>> fmap even ("hello", 1.0, 4)+ -- ("hello",1.0,True)+ fmap :: (a -> b) -> f a -> f b -- | Replace all locations in the input with the same value. -- The default definition is @'fmap' . 'const'@, but this may be -- overridden with a more efficient version. --- -- Using @ApplicativeDo@: \'@a '<$' bs@\' can be understood as the- -- @do@ expression- --- -- @- -- do bs- -- pure a- -- @- --- -- with an inferred @Functor@ constraint. (<$) :: a -> f b -> f a (<$) = fmap . const @@ -600,14 +648,18 @@ -- A few functors support an implementation of '<*>' that is more -- efficient than the default one. --- -- Using @ApplicativeDo@: \'@fs '<*>' as@\' can be understood as- -- the @do@ expression+ -- ==== __Example__+ -- Used in combination with @('<$>')@, @('<*>')@ can be used to build a record. --- -- @- -- do f <- fs- -- a <- as- -- pure (f a)- -- @+ -- >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}+ --+ -- >>> produceFoo :: Applicative f => f Foo+ --+ -- >>> produceBar :: Applicative f => f Bar+ -- >>> produceBaz :: Applicative f => f Baz+ --+ -- >>> mkState :: Applicative f => f MyState+ -- >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz (<*>) :: f (a -> b) -> f a -> f b (<*>) = liftA2 id @@ -621,38 +673,38 @@ -- This became a typeclass method in 4.10.0.0. Prior to that, it was -- a function defined in terms of '<*>' and 'fmap'. --- -- Using @ApplicativeDo@: \'@'liftA2' f as bs@\' can be understood- -- as the @do@ expression- --- -- @- -- do a <- as- -- b <- bs- -- pure (f a b)- -- @+ -- ==== __Example__+ -- >>> liftA2 (,) (Just 3) (Just 5)+ -- Just (3,5) liftA2 :: (a -> b -> c) -> f a -> f b -> f c liftA2 f x = (<*>) (fmap f x) -- | Sequence actions, discarding the value of the first argument. --- -- \'@as '*>' bs@\' can be understood as the @do@ expression+ -- ==== __Examples__+ -- If used in conjunction with the Applicative instance for 'Maybe',+ -- you can chain Maybe computations, with a possible "early return"+ -- in case of 'Nothing'. --- -- @- -- do as- -- bs- -- @+ -- >>> Just 2 *> Just 3+ -- Just 3 --- -- This is a tad complicated for our @ApplicativeDo@ extension- -- which will give it a @Monad@ constraint. For an @Applicative@- -- constraint we write it of the form+ -- >>> Nothing *> Just 3+ -- Nothing --- -- @- -- do _ <- as- -- b <- bs- -- pure b- -- @+ -- Of course a more interesting use case would be to have effectful+ -- computations instead of just returning pure values.+ --+ -- >>> import Data.Char+ -- >>> import Text.ParserCombinators.ReadP+ -- >>> let p = string "my name is " *> munch1 isAlpha <* eof+ -- >>> readP_to_S p "my name is Simon"+ -- [("Simon","")]+ (*>) :: f a -> f b -> f b a1 *> a2 = (id <$ a1) <*> a2+ -- This is essentially the same as liftA2 (flip const), but if the -- Functor instance has an optimized (<$), it may be better to use -- that instead. Before liftA2 became a method, this definition@@ -664,60 +716,40 @@ -- | Sequence actions, discarding the value of the second argument. --- -- Using @ApplicativeDo@: \'@as '<*' bs@\' can be understood as- -- the @do@ expression- --- -- @- -- do a <- as- -- bs- -- pure a- -- @ (<*) :: f a -> f b -> f a (<*) = liftA2 const -- | A variant of '<*>' with the arguments reversed. ----- Using @ApplicativeDo@: \'@as '<**>' fs@\' can be understood as the--- @do@ expression------ @--- do a <- as--- f <- fs--- pure (f a)--- @ (<**>) :: Applicative f => f a -> f (a -> b) -> f b (<**>) = liftA2 (\a f -> f a) -- Don't use $ here, see the note at the top of the page -- | Lift a function to actions.--- This function may be used as a value for `fmap` in a `Functor` instance.+-- Equivalent to Functor's `fmap` but implemented using only `Applicative`'s methods:+-- `liftA f a = pure f <*> a` ----- | Using @ApplicativeDo@: \'@'liftA' f as@\' can be understood as the--- @do@ expression+-- As such this function may be used to implement a `Functor` instance from an `Applicative` one.+ --+-- ==== __Examples__+-- Using the Applicative instance for Lists: ----- @--- do a <- as--- pure (f a)--- @+-- >>> liftA (+1) [1, 2]+-- [2,3] ----- with an inferred @Functor@ constraint, weaker than @Applicative@.+-- Or the Applicative instance for 'Maybe'+--+-- >>> liftA (+1) (Just 3)+-- Just 4+ liftA :: Applicative f => (a -> b) -> f a -> f b liftA f a = pure f <*> a -- Caution: since this may be used for `fmap`, we can't use the obvious -- definition of liftA = fmap. -- | Lift a ternary function to actions.------ Using @ApplicativeDo@: \'@'liftA3' f as bs cs@\' can be understood--- as the @do@ expression------ @--- do a <- as--- b <- bs--- c <- cs--- pure (f a b c)--- @+ liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d liftA3 f a b c = liftA2 f a b <*> c @@ -980,6 +1012,15 @@ instance Monad ((->) r) where f >>= k = \ r -> k (f r) r +-- | @since 4.15+instance Functor Solo where+ fmap f (Solo a) = Solo (f a)++ -- Being strict in the `Solo` argument here seems most consistent+ -- with the concept behind `Solo`: always strict in the wrapper and lazy+ -- in the contents.+ x <$ Solo _ = Solo x+ -- | @since 2.01 instance Functor ((,) a) where fmap f (x,y) = (x, f y)@@ -1252,8 +1293,7 @@ -- > map f [x1, x2, ...] == [f x1, f x2, ...] -- -- >>> map (+1) [1, 2, 3]---- [2,3,4]-+-- [2,3,4] map :: (a -> b) -> [a] -> [b] {-# NOINLINE [0] map #-} -- We want the RULEs "map" and "map/coerce" to fire first.@@ -1314,6 +1354,7 @@ -- http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/coercible.pdf {-# RULES "map/coerce" [1] map coerce = coerce #-}+-- See Note [Getting the map/coerce RULE to work] in CoreOpt ---------------------------------------------- -- append@@ -1371,7 +1412,7 @@ eqString _ _ = False {-# RULES "eqString" (==) = eqString #-}--- eqString also has a BuiltInRule in PrelRules.hs:+-- eqString also has a BuiltInRule in GHC.Core.Opt.ConstantFold: -- eqString (unpackCString# (Lit s1)) (unpackCString# (Lit s2)) = s1==s2 @@ -1637,7 +1678,13 @@ "unpack-list" [1] forall a . unpackFoldrCString# a (:) [] = unpackCString# a "unpack-append" forall a n . unpackFoldrCString# a (:) n = unpackAppendCString# a n --- There's a built-in rule (in PrelRules.hs) for+"unpack-utf8" [~1] forall a . unpackCStringUtf8# a = build (unpackFoldrCStringUtf8# a)+"unpack-list-utf8" [1] forall a . unpackFoldrCStringUtf8# a (:) [] = unpackCStringUtf8# a+"unpack-append-utf8" forall a n . unpackFoldrCStringUtf8# a (:) n = unpackAppendCStringUtf8# a n++-- There's a built-in rule (in GHC.Core.Op.ConstantFold) for -- unpackFoldr "foo" c (unpackFoldr "baz" c n) = unpackFoldr "foobaz" c n++-- See also the Note [String literals in GHC] in CString.hs #-}
GHC/ByteOrder.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- |@@ -20,6 +21,8 @@ -- Required for WORDS_BIGENDIAN #include <ghcautoconf.h> +import GHC.Generics (Generic)+ -- | Byte ordering. data ByteOrder = BigEndian -- ^ most-significant-byte occurs in lowest address.@@ -30,6 +33,7 @@ , Enum -- ^ @since 4.11.0.0 , Read -- ^ @since 4.11.0.0 , Show -- ^ @since 4.11.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | The byte ordering of the target machine.
GHC/Conc/IO.hs view
@@ -4,7 +4,6 @@ , MagicHash , UnboxedTuples #-}-{-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} -----------------------------------------------------------------------------@@ -29,6 +28,7 @@ module GHC.Conc.IO ( ensureIOManagerIsRunning , ioManagerCapabilitiesChanged+ , interruptIOManager -- * Waiting , threadDelay@@ -61,6 +61,7 @@ #if defined(mingw32_HOST_OS) import qualified GHC.Conc.Windows as Windows+import GHC.IO.SubSystem import GHC.Conc.Windows (asyncRead, asyncWrite, asyncDoProc, asyncReadBA, asyncWriteBA, ConsoleEvent(..), win32ConsoleHandler, toWin32ConsoleEvent)@@ -75,6 +76,17 @@ ensureIOManagerIsRunning = Windows.ensureIOManagerIsRunning #endif +-- | Interrupts the current wait of the I/O manager if it is currently blocked.+-- This instructs it to re-read how much it should wait and to process any+-- pending events.+-- @since 4.15+interruptIOManager :: IO ()+#if !defined(mingw32_HOST_OS)+interruptIOManager = return ()+#else+interruptIOManager = Windows.interruptIOManager+#endif+ ioManagerCapabilitiesChanged :: IO () #if !defined(mingw32_HOST_OS) ioManagerCapabilitiesChanged = Event.ioManagerCapabilitiesChanged@@ -179,11 +191,12 @@ threadDelay :: Int -> IO () threadDelay time #if defined(mingw32_HOST_OS)- | threaded = Windows.threadDelay time+ | isWindowsNativeIO = Windows.threadDelay time+ | threaded = Windows.threadDelay time #else- | threaded = Event.threadDelay time+ | threaded = Event.threadDelay time #endif- | otherwise = IO $ \s ->+ | otherwise = IO $ \s -> case time of { I# time# -> case delay# time# s of { s' -> (# s', () #) }}@@ -195,10 +208,11 @@ registerDelay :: Int -> IO (TVar Bool) registerDelay usecs #if defined(mingw32_HOST_OS)- | threaded = Windows.registerDelay usecs+ | isWindowsNativeIO = Windows.registerDelay usecs+ | threaded = Windows.registerDelay usecs #else- | threaded = Event.registerDelay usecs+ | threaded = Event.registerDelay usecs #endif- | otherwise = errorWithoutStackTrace "registerDelay: requires -threaded"+ | otherwise = errorWithoutStackTrace "registerDelay: requires -threaded" foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool
+ GHC/Conc/POSIX.hs view
@@ -0,0 +1,305 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}+{-# OPTIONS_HADDOCK not-home #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.Conc.POSIX+-- Copyright : (c) The University of Glasgow, 1994-2002+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- Windows I/O manager+--+-- This is the I/O manager based on posix FDs for windows.+-- When using the winio manager these functions may not+-- be used as they will behave in unexpected ways.+--+-- TODO: This manager is currently the default. But we will eventually+-- switch to use winio instead.+--+-----------------------------------------------------------------------------++-- #not-home+module GHC.Conc.POSIX+ ( ensureIOManagerIsRunning+ , interruptIOManager++ -- * Waiting+ , threadDelay+ , registerDelay++ -- * Miscellaneous+ , asyncRead+ , asyncWrite+ , asyncDoProc++ , asyncReadBA+ , asyncWriteBA++ , module GHC.Event.Windows.ConsoleEvent+ ) where+++#include "windows_cconv.h"++import Data.Bits (shiftR)+import GHC.Base+import GHC.Conc.Sync+import GHC.Conc.POSIX.Const+import GHC.Event.Windows.ConsoleEvent+import GHC.IO (unsafePerformIO)+import GHC.IORef+import GHC.MVar+import GHC.Num (Num(..))+import GHC.Ptr+import GHC.Real (div, fromIntegral)+import GHC.Word (Word32, Word64)+import GHC.Windows+import Unsafe.Coerce ( unsafeCoerceUnlifted )++-- ----------------------------------------------------------------------------+-- Thread waiting++-- Note: threadWaitRead and threadWaitWrite aren't really functional+-- on Win32, but left in there because lib code (still) uses them (the manner+-- in which they're used doesn't cause problems on a Win32 platform though.)++asyncRead :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncRead (I# fd) (I# isSock) (I# len) (Ptr buf) =+ IO $ \s -> case asyncRead# fd isSock len buf s of+ (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)++asyncWrite :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncWrite (I# fd) (I# isSock) (I# len) (Ptr buf) =+ IO $ \s -> case asyncWrite# fd isSock len buf s of+ (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)++asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+asyncDoProc (FunPtr proc) (Ptr param) =+ -- the 'length' value is ignored; simplifies implementation of+ -- the async*# primops to have them all return the same result.+ IO $ \s -> case asyncDoProc# proc param s of+ (# s', _len#, err# #) -> (# s', I# err# #)++-- to aid the use of these primops by the IO Handle implementation,+-- provide the following convenience funs:++-- this better be a pinned byte array!+asyncReadBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)+asyncReadBA fd isSock len off bufB =+ asyncRead fd isSock len ((Ptr (byteArrayContents# (unsafeCoerceUnlifted bufB))) `plusPtr` off)++asyncWriteBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)+asyncWriteBA fd isSock len off bufB =+ asyncWrite fd isSock len ((Ptr (byteArrayContents# (unsafeCoerceUnlifted bufB))) `plusPtr` off)++-- ----------------------------------------------------------------------------+-- Threaded RTS implementation of threadDelay++-- | Suspends the current thread for a given number of microseconds+-- (GHC only).+--+-- There is no guarantee that the thread will be rescheduled promptly+-- when the delay has expired, but the thread will never continue to+-- run /earlier/ than specified.+--+threadDelay :: Int -> IO ()+threadDelay time+ | threaded = waitForDelayEvent time+ | otherwise = IO $ \s ->+ case time of { I# time# ->+ case delay# time# s of { s' -> (# s', () #)+ }}++-- | Set the value of returned TVar to True after a given number of+-- microseconds. The caveats associated with threadDelay also apply.+--+registerDelay :: Int -> IO (TVar Bool)+registerDelay usecs+ | threaded = waitForDelayEventSTM usecs+ | otherwise = errorWithoutStackTrace "registerDelay: requires -threaded"++foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool++waitForDelayEvent :: Int -> IO ()+waitForDelayEvent usecs = do+ m <- newEmptyMVar+ target <- calculateTarget usecs+ _ <- atomicModifyIORef'_ pendingDelays (\xs -> Delay target m : xs)+ prodServiceThread+ takeMVar m++-- Delays for use in STM+waitForDelayEventSTM :: Int -> IO (TVar Bool)+waitForDelayEventSTM usecs = do+ t <- atomically $ newTVar False+ target <- calculateTarget usecs+ _ <- atomicModifyIORef'_ pendingDelays (\xs -> DelaySTM target t : xs)+ prodServiceThread+ return t++calculateTarget :: Int -> IO USecs+calculateTarget usecs = do+ now <- getMonotonicUSec+ return $ now + (fromIntegral usecs)++data DelayReq+ = Delay {-# UNPACK #-} !USecs {-# UNPACK #-} !(MVar ())+ | DelaySTM {-# UNPACK #-} !USecs {-# UNPACK #-} !(TVar Bool)++{-# NOINLINE pendingDelays #-}+pendingDelays :: IORef [DelayReq]+pendingDelays = unsafePerformIO $ do+ m <- newIORef []+ sharedCAF m getOrSetGHCConcWindowsPendingDelaysStore++foreign import ccall unsafe "getOrSetGHCConcWindowsPendingDelaysStore"+ getOrSetGHCConcWindowsPendingDelaysStore :: Ptr a -> IO (Ptr a)++{-# NOINLINE ioManagerThread #-}+ioManagerThread :: MVar (Maybe ThreadId)+ioManagerThread = unsafePerformIO $ do+ m <- newMVar Nothing+ sharedCAF m getOrSetGHCConcWindowsIOManagerThreadStore++foreign import ccall unsafe "getOrSetGHCConcWindowsIOManagerThreadStore"+ getOrSetGHCConcWindowsIOManagerThreadStore :: Ptr a -> IO (Ptr a)++ensureIOManagerIsRunning :: IO ()+ensureIOManagerIsRunning+ | threaded = startIOManagerThread+ | otherwise = return ()++interruptIOManager :: IO ()+interruptIOManager = return ()++startIOManagerThread :: IO ()+startIOManagerThread = do+ modifyMVar_ ioManagerThread $ \old -> do+ let create = do t <- forkIO ioManager;+ labelThread t "IOManagerThread";+ return (Just t)+ case old of+ Nothing -> create+ Just t -> do+ s <- threadStatus t+ case s of+ ThreadFinished -> create+ ThreadDied -> create+ _other -> return (Just t)++insertDelay :: DelayReq -> [DelayReq] -> [DelayReq]+insertDelay d [] = [d]+insertDelay d1 ds@(d2 : rest)+ | delayTime d1 <= delayTime d2 = d1 : ds+ | otherwise = d2 : insertDelay d1 rest++delayTime :: DelayReq -> USecs+delayTime (Delay t _) = t+delayTime (DelaySTM t _) = t++type USecs = Word64+type NSecs = Word64++foreign import ccall unsafe "getMonotonicNSec"+ getMonotonicNSec :: IO NSecs++getMonotonicUSec :: IO USecs+getMonotonicUSec = fmap (`div` 1000) getMonotonicNSec++{-# NOINLINE prodding #-}+prodding :: IORef Bool+prodding = unsafePerformIO $ do+ r <- newIORef False+ sharedCAF r getOrSetGHCConcWindowsProddingStore++foreign import ccall unsafe "getOrSetGHCConcWindowsProddingStore"+ getOrSetGHCConcWindowsProddingStore :: Ptr a -> IO (Ptr a)++prodServiceThread :: IO ()+prodServiceThread = do+ -- NB. use atomicSwapIORef here, otherwise there are race+ -- conditions in which prodding is left at True but the server is+ -- blocked in select().+ was_set <- atomicSwapIORef prodding True+ when (not was_set) wakeupIOManager++-- ----------------------------------------------------------------------------+-- Windows IO manager thread++ioManager :: IO ()+ioManager = do+ wakeup <- c_getIOManagerEvent+ service_loop wakeup []++service_loop :: HANDLE -- read end of pipe+ -> [DelayReq] -- current delay requests+ -> IO ()++service_loop wakeup old_delays = do+ -- pick up new delay requests+ new_delays <- atomicSwapIORef pendingDelays []+ let delays = foldr insertDelay old_delays new_delays++ now <- getMonotonicUSec+ (delays', timeout) <- getDelay now delays++ r <- c_WaitForSingleObject wakeup timeout+ case r of+ 0xffffffff -> do throwGetLastError "service_loop"+ 0 -> do+ r2 <- c_readIOManagerEvent+ exit <-+ case r2 of+ _ | r2 == io_MANAGER_WAKEUP -> return False+ _ | r2 == io_MANAGER_DIE -> return True+ 0 -> return False -- spurious wakeup+ _ -> do start_console_handler (r2 `shiftR` 1); return False+ when (not exit) $ service_cont wakeup delays'++ _other -> service_cont wakeup delays' -- probably timeout++service_cont :: HANDLE -> [DelayReq] -> IO ()+service_cont wakeup delays = do+ _ <- atomicSwapIORef prodding False+ service_loop wakeup delays++wakeupIOManager :: IO ()+wakeupIOManager = c_sendIOManagerEvent io_MANAGER_WAKEUP++-- Walk the queue of pending delays, waking up any that have passed+-- and return the smallest delay to wait for. The queue of pending+-- delays is kept ordered.+getDelay :: USecs -> [DelayReq] -> IO ([DelayReq], DWORD)+getDelay _ [] = return ([], iNFINITE)+getDelay now all@(d : rest)+ = case d of+ Delay time m | now >= time -> do+ putMVar m ()+ getDelay now rest+ DelaySTM time t | now >= time -> do+ atomically $ writeTVar t True+ getDelay now rest+ _otherwise ->+ -- delay is in millisecs for WaitForSingleObject+ let micro_seconds = delayTime d - now+ milli_seconds = (micro_seconds + 999) `div` 1000+ in return (all, fromIntegral milli_seconds)++foreign import ccall unsafe "getIOManagerEvent" -- in the RTS (ThrIOManager.c)+ c_getIOManagerEvent :: IO HANDLE++foreign import ccall unsafe "readIOManagerEvent" -- in the RTS (ThrIOManager.c)+ c_readIOManagerEvent :: IO Word32++foreign import ccall unsafe "sendIOManagerEvent" -- in the RTS (ThrIOManager.c)+ c_sendIOManagerEvent :: Word32 -> IO ()++foreign import WINDOWS_CCONV "WaitForSingleObject"+ c_WaitForSingleObject :: HANDLE -> DWORD -> IO DWORD+
+ GHC/Conc/POSIX/Const.hsc view
@@ -0,0 +1,29 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_HADDOCK not-home #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.Conc.POSIX.Const+-- Copyright : (c) The University of Glasgow, 2019+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- Constants shared with the rts, GHC.Conc.POSIX uses MagicHash which confuses+-- hsc2hs so these are moved to a new module.+--+-----------------------------------------------------------------------------++-- #not-home+module GHC.Conc.POSIX.Const where++import Data.Word++#include <Rts.h>++io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word32+io_MANAGER_WAKEUP = #{const IO_MANAGER_WAKEUP}+io_MANAGER_DIE = #{const IO_MANAGER_DIE}
GHC/Conc/Sync.hs view
@@ -8,7 +8,6 @@ , StandaloneDeriving , RankNTypes #-}-{-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} -----------------------------------------------------------------------------@@ -33,6 +32,7 @@ -- #not-home module GHC.Conc.Sync ( ThreadId(..)+ , showThreadId -- * Forking and suchlike , forkIO@@ -102,7 +102,7 @@ import GHC.Base import {-# SOURCE #-} GHC.IO.Handle ( hFlush )-import {-# SOURCE #-} GHC.IO.Handle.FD ( stdout )+import {-# SOURCE #-} GHC.IO.StdHandles ( stdout ) import GHC.Int import GHC.IO import GHC.IO.Encoding.UTF8@@ -117,6 +117,8 @@ import GHC.Stable ( StablePtr(..) ) import GHC.Weak +import Unsafe.Coerce ( unsafeCoerce# )+ infixr 0 `par`, `pseq` -----------------------------------------------------------------------------@@ -149,31 +151,29 @@ showString "ThreadId " . showsPrec d (getThreadId (id2TSO t)) +showThreadId :: ThreadId -> String+showThreadId = show+ foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CInt id2TSO :: ThreadId -> ThreadId# id2TSO (ThreadId t) = t +foreign import ccall unsafe "eq_thread" eq_thread :: ThreadId# -> ThreadId# -> CBool+ foreign import ccall unsafe "cmp_thread" cmp_thread :: ThreadId# -> ThreadId# -> CInt -- Returns -1, 0, 1 -cmpThread :: ThreadId -> ThreadId -> Ordering-cmpThread t1 t2 =- case cmp_thread (id2TSO t1) (id2TSO t2) of- -1 -> LT- 0 -> EQ- _ -> GT -- must be 1- -- | @since 4.2.0.0 instance Eq ThreadId where- t1 == t2 =- case t1 `cmpThread` t2 of- EQ -> True- _ -> False+ ThreadId t1 == ThreadId t2 = eq_thread t1 t2 /= 0 -- | @since 4.2.0.0 instance Ord ThreadId where- compare = cmpThread+ compare (ThreadId t1) (ThreadId t2) = case cmp_thread t1 t2 of+ -1 -> LT+ 0 -> EQ+ _ -> GT -- | Every thread has an allocation counter that tracks how much -- memory has been allocated by the thread. The counter is@@ -541,6 +541,8 @@ -- ^blocked in 'retry' in an STM transaction | BlockedOnForeignCall -- ^currently in a foreign call+ | BlockedOnIOCompletion+ -- ^currently blocked on an I/O Completion port | BlockedOnOther -- ^blocked on some other resource. Without @-threaded@, -- I\/O and 'Control.Concurrent.threadDelay' show up as@@ -579,6 +581,7 @@ mk_stat 11 = ThreadBlocked BlockedOnForeignCall mk_stat 12 = ThreadBlocked BlockedOnException mk_stat 14 = ThreadBlocked BlockedOnMVar -- possibly: BlockedOnMVarRead+ mk_stat 15 = ThreadBlocked BlockedOnIOCompletion -- NB. these are hardcoded in rts/PrimOps.cmm mk_stat 16 = ThreadFinished mk_stat 17 = ThreadDied@@ -626,6 +629,9 @@ newStablePtrPrimMVar :: MVar () -> IO (StablePtr PrimMVar) newStablePtrPrimMVar (MVar m) = IO $ \s0 -> case makeStablePtr# (unsafeCoerce# m :: PrimMVar) s0 of+ -- Coerce unlifted m :: MVar# RealWorld ()+ -- to lifted PrimMVar+ -- apparently because mkStablePtr is not levity-polymorphic (# s1, sp #) -> (# s1, StablePtr sp #) -----------------------------------------------------------------------------
+ GHC/Conc/Sync.hs-boot view
@@ -0,0 +1,72 @@+{-# LANGUAGE MagicHash, NoImplicitPrelude #-}+{-# OPTIONS_HADDOCK not-home #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.Conc.Sync [boot]+-- Copyright : (c) The University of Glasgow, 1994-2002+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- Basic concurrency stuff.+--+-----------------------------------------------------------------------------++module GHC.Conc.Sync+ ( forkIO,+ TVar(..),+ ThreadId(..),+ myThreadId,+ showThreadId,+ ThreadStatus(..),+ threadStatus,+ sharedCAF+ ) where++import GHC.Base+import GHC.Ptr++forkIO :: IO () -> IO ThreadId++data ThreadId = ThreadId ThreadId#+data TVar a = TVar (TVar# RealWorld a)++data BlockReason+ = BlockedOnMVar+ -- ^blocked on 'MVar'+ {- possibly (see 'threadstatus' below):+ | BlockedOnMVarRead+ -- ^blocked on reading an empty 'MVar'+ -}+ | BlockedOnBlackHole+ -- ^blocked on a computation in progress by another thread+ | BlockedOnException+ -- ^blocked in 'throwTo'+ | BlockedOnSTM+ -- ^blocked in 'retry' in an STM transaction+ | BlockedOnForeignCall+ -- ^currently in a foreign call+ | BlockedOnIOCompletion+ -- ^currently blocked on an I/O Completion port+ | BlockedOnOther+ -- ^blocked on some other resource. Without @-threaded@,+ -- I\/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@+ -- they show up as 'BlockedOnMVar'.++data ThreadStatus+ = ThreadRunning+ -- ^the thread is currently runnable or running+ | ThreadFinished+ -- ^the thread has finished+ | ThreadBlocked BlockReason+ -- ^the thread is blocked on some resource+ | ThreadDied+ -- ^the thread received an uncaught exception++myThreadId :: IO ThreadId+showThreadId :: ThreadId -> String+threadStatus :: ThreadId -> IO ThreadStatus+sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a
+ GHC/Conc/WinIO.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}+{-# OPTIONS_HADDOCK not-home #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.Conc.WinIO+-- Copyright : (c) The University of Glasgow, 1994-2002+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- Windows I/O Completion Port interface to the one defined in+-- GHC.Event.Windows.+--+-- This module is an indirection to keep things in the same structure as before+-- but also to keep the new code where the actual I/O manager is. As such it+-- just re-exports GHC.Event.Windows.Thread+--+-----------------------------------------------------------------------------++-- #not-home+module GHC.Conc.WinIO+ ( module GHC.Event.Windows.Thread ) where++import GHC.Event.Windows.Thread
GHC/Conc/Windows.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}-{-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} -----------------------------------------------------------------------------@@ -13,13 +12,15 @@ -- Stability : internal -- Portability : non-portable (GHC extensions) ----- Windows I/O manager+-- Windows I/O manager interfaces. Depending on which I/O Subsystem is used+-- requests will be routed to different places. -- ----------------------------------------------------------------------------- -- #not-home module GHC.Conc.Windows ( ensureIOManagerIsRunning+ , interruptIOManager -- * Waiting , threadDelay@@ -33,35 +34,21 @@ , asyncReadBA , asyncWriteBA - , ConsoleEvent(..)- , win32ConsoleHandler- , toWin32ConsoleEvent+ -- * Console event handler+ , module GHC.Event.Windows.ConsoleEvent ) where -import Data.Bits (shiftR)++#include "windows_cconv.h"+ import GHC.Base import GHC.Conc.Sync-import GHC.Enum (Enum)-import GHC.IO (unsafePerformIO)-import GHC.IORef-import GHC.MVar-import GHC.Num (Num(..))+import qualified GHC.Conc.POSIX as POSIX+import qualified GHC.Conc.WinIO as WINIO+import GHC.Event.Windows.ConsoleEvent+import GHC.IO.SubSystem ((<!>)) import GHC.Ptr-import GHC.Read (Read)-import GHC.Real (div, fromIntegral)-import GHC.Show (Show)-import GHC.Word (Word32, Word64)-import GHC.Windows--#if defined(mingw32_HOST_OS)-# if defined(i386_HOST_ARCH)-# define WINDOWS_CCONV stdcall-# elif defined(x86_64_HOST_ARCH)-# define WINDOWS_CCONV ccall-# else-# error Unknown mingw32 arch-# endif-#endif+import Unsafe.Coerce ( unsafeCoerceUnlifted ) -- ---------------------------------------------------------------------------- -- Thread waiting@@ -93,11 +80,11 @@ -- this better be a pinned byte array! asyncReadBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int) asyncReadBA fd isSock len off bufB =- asyncRead fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)+ asyncRead fd isSock len ((Ptr (byteArrayContents# (unsafeCoerceUnlifted bufB))) `plusPtr` off) asyncWriteBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int) asyncWriteBA fd isSock len off bufB =- asyncWrite fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)+ asyncWrite fd isSock len ((Ptr (byteArrayContents# (unsafeCoerceUnlifted bufB))) `plusPtr` off) -- ---------------------------------------------------------------------------- -- Threaded RTS implementation of threadDelay@@ -110,232 +97,19 @@ -- run /earlier/ than specified. -- threadDelay :: Int -> IO ()-threadDelay time- | threaded = waitForDelayEvent time- | otherwise = IO $ \s ->- case time of { I# time# ->- case delay# time# s of { s' -> (# s', () #)- }}+threadDelay = POSIX.threadDelay <!> WINIO.threadDelay -- | Set the value of returned TVar to True after a given number of -- microseconds. The caveats associated with threadDelay also apply. -- registerDelay :: Int -> IO (TVar Bool)-registerDelay usecs- | threaded = waitForDelayEventSTM usecs- | otherwise = errorWithoutStackTrace "registerDelay: requires -threaded"--foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool--waitForDelayEvent :: Int -> IO ()-waitForDelayEvent usecs = do- m <- newEmptyMVar- target <- calculateTarget usecs- _ <- atomicModifyIORef'_ pendingDelays (\xs -> Delay target m : xs)- prodServiceThread- takeMVar m---- Delays for use in STM-waitForDelayEventSTM :: Int -> IO (TVar Bool)-waitForDelayEventSTM usecs = do- t <- atomically $ newTVar False- target <- calculateTarget usecs- _ <- atomicModifyIORef'_ pendingDelays (\xs -> DelaySTM target t : xs)- prodServiceThread- return t--calculateTarget :: Int -> IO USecs-calculateTarget usecs = do- now <- getMonotonicUSec- return $ now + (fromIntegral usecs)--data DelayReq- = Delay {-# UNPACK #-} !USecs {-# UNPACK #-} !(MVar ())- | DelaySTM {-# UNPACK #-} !USecs {-# UNPACK #-} !(TVar Bool)--{-# NOINLINE pendingDelays #-}-pendingDelays :: IORef [DelayReq]-pendingDelays = unsafePerformIO $ do- m <- newIORef []- sharedCAF m getOrSetGHCConcWindowsPendingDelaysStore--foreign import ccall unsafe "getOrSetGHCConcWindowsPendingDelaysStore"- getOrSetGHCConcWindowsPendingDelaysStore :: Ptr a -> IO (Ptr a)--{-# NOINLINE ioManagerThread #-}-ioManagerThread :: MVar (Maybe ThreadId)-ioManagerThread = unsafePerformIO $ do- m <- newMVar Nothing- sharedCAF m getOrSetGHCConcWindowsIOManagerThreadStore--foreign import ccall unsafe "getOrSetGHCConcWindowsIOManagerThreadStore"- getOrSetGHCConcWindowsIOManagerThreadStore :: Ptr a -> IO (Ptr a)+registerDelay = POSIX.registerDelay <!> WINIO.registerDelay ensureIOManagerIsRunning :: IO ()-ensureIOManagerIsRunning- | threaded = startIOManagerThread- | otherwise = return ()--startIOManagerThread :: IO ()-startIOManagerThread = do- modifyMVar_ ioManagerThread $ \old -> do- let create = do t <- forkIO ioManager; return (Just t)- case old of- Nothing -> create- Just t -> do- s <- threadStatus t- case s of- ThreadFinished -> create- ThreadDied -> create- _other -> return (Just t)--insertDelay :: DelayReq -> [DelayReq] -> [DelayReq]-insertDelay d [] = [d]-insertDelay d1 ds@(d2 : rest)- | delayTime d1 <= delayTime d2 = d1 : ds- | otherwise = d2 : insertDelay d1 rest--delayTime :: DelayReq -> USecs-delayTime (Delay t _) = t-delayTime (DelaySTM t _) = t--type USecs = Word64-type NSecs = Word64--foreign import ccall unsafe "getMonotonicNSec"- getMonotonicNSec :: IO NSecs--getMonotonicUSec :: IO USecs-getMonotonicUSec = fmap (`div` 1000) getMonotonicNSec--{-# NOINLINE prodding #-}-prodding :: IORef Bool-prodding = unsafePerformIO $ do- r <- newIORef False- sharedCAF r getOrSetGHCConcWindowsProddingStore--foreign import ccall unsafe "getOrSetGHCConcWindowsProddingStore"- getOrSetGHCConcWindowsProddingStore :: Ptr a -> IO (Ptr a)--prodServiceThread :: IO ()-prodServiceThread = do- -- NB. use atomicSwapIORef here, otherwise there are race- -- conditions in which prodding is left at True but the server is- -- blocked in select().- was_set <- atomicSwapIORef prodding True- when (not was_set) wakeupIOManager---- ------------------------------------------------------------------------------- Windows IO manager thread--ioManager :: IO ()-ioManager = do- wakeup <- c_getIOManagerEvent- service_loop wakeup []--service_loop :: HANDLE -- read end of pipe- -> [DelayReq] -- current delay requests- -> IO ()--service_loop wakeup old_delays = do- -- pick up new delay requests- new_delays <- atomicSwapIORef pendingDelays []- let delays = foldr insertDelay old_delays new_delays-- now <- getMonotonicUSec- (delays', timeout) <- getDelay now delays-- r <- c_WaitForSingleObject wakeup timeout- case r of- 0xffffffff -> do throwGetLastError "service_loop"- 0 -> do- r2 <- c_readIOManagerEvent- exit <-- case r2 of- _ | r2 == io_MANAGER_WAKEUP -> return False- _ | r2 == io_MANAGER_DIE -> return True- 0 -> return False -- spurious wakeup- _ -> do start_console_handler (r2 `shiftR` 1); return False- when (not exit) $ service_cont wakeup delays'-- _other -> service_cont wakeup delays' -- probably timeout--service_cont :: HANDLE -> [DelayReq] -> IO ()-service_cont wakeup delays = do- _ <- atomicSwapIORef prodding False- service_loop wakeup delays---- must agree with rts/win32/ThrIOManager.c-io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word32-io_MANAGER_WAKEUP = 0xffffffff-io_MANAGER_DIE = 0xfffffffe--data ConsoleEvent- = ControlC- | Break- | Close- -- these are sent to Services only.- | Logoff- | Shutdown- deriving ( Eq -- ^ @since 4.3.0.0- , Ord -- ^ @since 4.3.0.0- , Enum -- ^ @since 4.3.0.0- , Show -- ^ @since 4.3.0.0- , Read -- ^ @since 4.3.0.0- )--start_console_handler :: Word32 -> IO ()-start_console_handler r =- case toWin32ConsoleEvent r of- Just x -> withMVar win32ConsoleHandler $ \handler -> do- _ <- forkIO (handler x)- return ()- Nothing -> return ()--toWin32ConsoleEvent :: (Eq a, Num a) => a -> Maybe ConsoleEvent-toWin32ConsoleEvent ev =- case ev of- 0 {- CTRL_C_EVENT-} -> Just ControlC- 1 {- CTRL_BREAK_EVENT-} -> Just Break- 2 {- CTRL_CLOSE_EVENT-} -> Just Close- 5 {- CTRL_LOGOFF_EVENT-} -> Just Logoff- 6 {- CTRL_SHUTDOWN_EVENT-} -> Just Shutdown- _ -> Nothing--win32ConsoleHandler :: MVar (ConsoleEvent -> IO ())-win32ConsoleHandler = unsafePerformIO (newMVar (errorWithoutStackTrace "win32ConsoleHandler"))--wakeupIOManager :: IO ()-wakeupIOManager = c_sendIOManagerEvent io_MANAGER_WAKEUP---- Walk the queue of pending delays, waking up any that have passed--- and return the smallest delay to wait for. The queue of pending--- delays is kept ordered.-getDelay :: USecs -> [DelayReq] -> IO ([DelayReq], DWORD)-getDelay _ [] = return ([], iNFINITE)-getDelay now all@(d : rest)- = case d of- Delay time m | now >= time -> do- putMVar m ()- getDelay now rest- DelaySTM time t | now >= time -> do- atomically $ writeTVar t True- getDelay now rest- _otherwise ->- -- delay is in millisecs for WaitForSingleObject- let micro_seconds = delayTime d - now- milli_seconds = (micro_seconds + 999) `div` 1000- in return (all, fromIntegral milli_seconds)--foreign import ccall unsafe "getIOManagerEvent" -- in the RTS (ThrIOManager.c)- c_getIOManagerEvent :: IO HANDLE--foreign import ccall unsafe "readIOManagerEvent" -- in the RTS (ThrIOManager.c)- c_readIOManagerEvent :: IO Word32+ensureIOManagerIsRunning = POSIX.ensureIOManagerIsRunning+ <!> WINIO.ensureIOManagerIsRunning -foreign import ccall unsafe "sendIOManagerEvent" -- in the RTS (ThrIOManager.c)- c_sendIOManagerEvent :: Word32 -> IO ()+interruptIOManager :: IO ()+interruptIOManager = POSIX.interruptIOManager <!> WINIO.interruptIOManager -foreign import WINDOWS_CCONV "WaitForSingleObject"- c_WaitForSingleObject :: HANDLE -> DWORD -> IO DWORD
− GHC/ConsoleHandler.hs
@@ -1,162 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE CPP #-}---------------------------------------------------------------------------------- |--- Module : GHC.ConsoleHandler--- Copyright : (c) The University of Glasgow--- License : see libraries/base/LICENSE------ Maintainer : cvs-ghc@haskell.org--- Stability : internal--- Portability : non-portable (GHC extensions)------ NB. the contents of this module are only available on Windows.------ Installing Win32 console handlers.-----------------------------------------------------------------------------------module GHC.ConsoleHandler-#if !defined(mingw32_HOST_OS)- where--import GHC.Base () -- dummy dependency-#else /* whole file */- ( Handler(..)- , installHandler- , ConsoleEvent(..)- , flushConsole- ) where--{--#include "rts/Signals.h"--Note: this #include is inside a Haskell comment- but it brings into scope some #defines- that are used by CPP below (eg STG_SIG_DFL).- Having it in a comment means that there's no- danger that C-like crap will be misunderstood- by GHC--}--import GHC.Base-import Foreign-import Foreign.C-import GHC.IO.FD-import GHC.IO.Exception-import GHC.IO.Handle.Types-import GHC.IO.Handle.Internals-import GHC.Conc-import Control.Concurrent.MVar-import Data.Typeable--data Handler- = Default- | Ignore- | Catch (ConsoleEvent -> IO ())---- | Allows Windows console events to be caught and handled. To--- handle a console event, call 'installHandler' passing the--- appropriate 'Handler' value. When the event is received, if the--- 'Handler' value is @Catch f@, then a new thread will be spawned by--- the system to execute @f e@, where @e@ is the 'ConsoleEvent' that--- was received.------ Note that console events can only be received by an application--- running in a Windows console. Certain environments that look like consoles--- do not support console events, these include:------ * Cygwin shells with @CYGWIN=tty@ set (if you don't set @CYGWIN=tty@,--- then a Cygwin shell behaves like a Windows console).--- * Cygwin xterm and rxvt windows--- * MSYS rxvt windows------ In order for your application to receive console events, avoid running--- it in one of these environments.----installHandler :: Handler -> IO Handler-installHandler handler- | threaded =- modifyMVar win32ConsoleHandler $ \old_h -> do- (new_h,rc) <-- case handler of- Default -> do- r <- rts_installHandler STG_SIG_DFL nullPtr- return (no_handler, r)- Ignore -> do- r <- rts_installHandler STG_SIG_IGN nullPtr- return (no_handler, r)- Catch h -> do- r <- rts_installHandler STG_SIG_HAN nullPtr- return (h, r)- prev_handler <-- case rc of- STG_SIG_DFL -> return Default- STG_SIG_IGN -> return Ignore- STG_SIG_HAN -> return (Catch old_h)- _ -> errorWithoutStackTrace "installHandler: Bad threaded rc value"- return (new_h, prev_handler)-- | otherwise =- alloca $ \ p_sp -> do- rc <-- case handler of- Default -> rts_installHandler STG_SIG_DFL p_sp- Ignore -> rts_installHandler STG_SIG_IGN p_sp- Catch h -> do- v <- newStablePtr (toHandler h)- poke p_sp v- rts_installHandler STG_SIG_HAN p_sp- case rc of- STG_SIG_DFL -> return Default- STG_SIG_IGN -> return Ignore- STG_SIG_HAN -> do- osptr <- peek p_sp- oldh <- deRefStablePtr osptr- -- stable pointer is no longer in use, free it.- freeStablePtr osptr- return (Catch (\ ev -> oldh (fromConsoleEvent ev)))- _ -> errorWithoutStackTrace "installHandler: Bad non-threaded rc value"- where- fromConsoleEvent ev =- case ev of- ControlC -> 0 {- CTRL_C_EVENT-}- Break -> 1 {- CTRL_BREAK_EVENT-}- Close -> 2 {- CTRL_CLOSE_EVENT-}- Logoff -> 5 {- CTRL_LOGOFF_EVENT-}- Shutdown -> 6 {- CTRL_SHUTDOWN_EVENT-}-- toHandler hdlr ev = do- case toWin32ConsoleEvent ev of- -- see rts/win32/ConsoleHandler.c for comments as to why- -- rts_ConsoleHandlerDone is called here.- Just x -> hdlr x >> rts_ConsoleHandlerDone ev- Nothing -> return () -- silently ignore..-- no_handler = errorWithoutStackTrace "win32ConsoleHandler"--foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool--foreign import ccall unsafe "RtsExternal.h rts_InstallConsoleEvent"- rts_installHandler :: CInt -> Ptr (StablePtr (CInt -> IO ())) -> IO CInt-foreign import ccall unsafe "RtsExternal.h rts_ConsoleHandlerDone"- rts_ConsoleHandlerDone :: CInt -> IO ()---flushConsole :: Handle -> IO ()-flushConsole h =- wantReadableHandle_ "flushConsole" h $ \ Handle__{haDevice=dev} ->- case cast dev of- Nothing -> ioException $- IOError (Just h) IllegalOperation "flushConsole"- "handle is not a file descriptor" Nothing Nothing- Just fd -> do- throwErrnoIfMinus1Retry_ "flushConsole" $- flush_console_fd (fdFD fd)--foreign import ccall unsafe "consUtils.h flush_input_console__"- flush_console_fd :: CInt -> IO CInt--#endif /* mingw32_HOST_OS */
+ GHC/ConsoleHandler.hsc view
@@ -0,0 +1,142 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.ConsoleHandler+-- Copyright : (c) The University of Glasgow+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- NB. the contents of this module are only available on Windows.+--+-- Installing Win32 console handlers.+--+-----------------------------------------------------------------------------++module GHC.ConsoleHandler+#if !defined(mingw32_HOST_OS)+ where++import GHC.Base () -- dummy dependency+#else /* whole file */+ ( Handler(..)+ , installHandler+ , ConsoleEvent(..)+ ) where++#include <windows.h>+{-+#include "rts/Signals.h"++Note: this #include is inside a Haskell comment+ but it brings into scope some #defines+ that are used by CPP below (eg STG_SIG_DFL).+ Having it in a comment means that there's no+ danger that C-like crap will be misunderstood+ by GHC+-}++import GHC.Base+import Foreign+import Foreign.C+import GHC.Conc+import Control.Concurrent.MVar++data Handler+ = Default+ | Ignore+ | Catch (ConsoleEvent -> IO ())++-- | Allows Windows console events to be caught and handled. To+-- handle a console event, call 'installHandler' passing the+-- appropriate 'Handler' value. When the event is received, if the+-- 'Handler' value is @Catch f@, then a new thread will be spawned by+-- the system to execute @f e@, where @e@ is the 'ConsoleEvent' that+-- was received.+--+-- Note that console events can only be received by an application+-- running in a Windows console. Certain environments that look like consoles+-- do not support console events, these include:+--+-- * Cygwin shells with @CYGWIN=tty@ set (if you don't set @CYGWIN=tty@,+-- then a Cygwin shell behaves like a Windows console).+-- * Cygwin xterm and rxvt windows+-- * MSYS rxvt windows+--+-- In order for your application to receive console events, avoid running+-- it in one of these environments.+--+installHandler :: Handler -> IO Handler+installHandler handler+ | threaded =+ modifyMVar win32ConsoleHandler $ \old_h -> do+ (new_h,rc) <-+ case handler of+ Default -> do+ r <- rts_installHandler STG_SIG_DFL nullPtr+ return (no_handler, r)+ Ignore -> do+ r <- rts_installHandler STG_SIG_IGN nullPtr+ return (no_handler, r)+ Catch h -> do+ r <- rts_installHandler STG_SIG_HAN nullPtr+ return (h, r)+ prev_handler <-+ case rc of+ STG_SIG_DFL -> return Default+ STG_SIG_IGN -> return Ignore+ STG_SIG_HAN -> return (Catch old_h)+ _ -> errorWithoutStackTrace "installHandler: Bad threaded rc value"+ return (new_h, prev_handler)++ | otherwise =+ alloca $ \ p_sp -> do+ rc <-+ case handler of+ Default -> rts_installHandler STG_SIG_DFL p_sp+ Ignore -> rts_installHandler STG_SIG_IGN p_sp+ Catch h -> do+ v <- newStablePtr (toHandler h)+ poke p_sp v+ rts_installHandler STG_SIG_HAN p_sp+ case rc of+ STG_SIG_DFL -> return Default+ STG_SIG_IGN -> return Ignore+ STG_SIG_HAN -> do+ osptr <- peek p_sp+ oldh <- deRefStablePtr osptr+ -- stable pointer is no longer in use, free it.+ freeStablePtr osptr+ return (Catch (\ ev -> oldh (fromConsoleEvent ev)))+ _ -> errorWithoutStackTrace "installHandler: Bad non-threaded rc value"+ where+ fromConsoleEvent ev =+ case ev of+ ControlC -> #{const CTRL_C_EVENT }+ Break -> #{const CTRL_BREAK_EVENT }+ Close -> #{const CTRL_CLOSE_EVENT }+ Logoff -> #{const CTRL_LOGOFF_EVENT }+ Shutdown -> #{const CTRL_SHUTDOWN_EVENT}++ toHandler hdlr ev = do+ case toWin32ConsoleEvent ev of+ -- see rts/win32/ConsoleHandler.c for comments as to why+ -- rts_ConsoleHandlerDone is called here.+ Just x -> hdlr x >> rts_ConsoleHandlerDone ev+ Nothing -> return () -- silently ignore..++ no_handler = errorWithoutStackTrace "win32ConsoleHandler"++foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool++foreign import ccall unsafe "RtsExternal.h rts_InstallConsoleEvent"+ rts_installHandler :: CInt -> Ptr (StablePtr (CInt -> IO ())) -> IO CInt+foreign import ccall unsafe "RtsExternal.h rts_ConsoleHandlerDone"+ rts_ConsoleHandlerDone :: CInt -> IO ()++#endif /* mingw32_HOST_OS */
GHC/Desugar.hs view
@@ -10,13 +10,13 @@ -- Module : GHC.Desugar -- Copyright : (c) The University of Glasgow, 2007 -- License : see libraries/base/LICENSE--- +-- -- Maintainer : cvs-ghc@haskell.org -- Stability : internal -- Portability : non-portable (GHC extensions) -- -- Support code for desugaring in GHC--- +-- ----------------------------------------------------------------------------- module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where@@ -28,14 +28,14 @@ -- A version of Control.Category.>>> overloaded on Arrow (>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c -- NB: the type of this function is the "shape" that GHC expects--- in tcInstClassOp. So don't put all the foralls at the front! +-- in tcInstClassOp. So don't put all the foralls at the front! -- Yes, this is a bit grotesque, but heck it works and the whole -- arrows stuff needs reworking anyway! f >>> g = g . f+{-# INLINE (>>>) #-} -- see Note [INLINE on >>>] in Control.Category -- A wrapper data type that lets the typechecker get at the appropriate dictionaries for an annotation data AnnotationWrapper = forall a. (Data a) => AnnotationWrapper a toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper toAnnotationWrapper what = AnnotationWrapper what-
GHC/Enum.hs view
@@ -33,7 +33,7 @@ import GHC.Base hiding ( many ) import GHC.Char-import GHC.Integer+import GHC.Num.Integer import GHC.Num import GHC.Show default () -- Double isn't available yet@@ -139,17 +139,34 @@ -- * @enumFromThenTo 6 8 2 :: [Int] = []@ enumFromThenTo :: a -> a -> a -> [a] - succ = toEnum . (+ 1) . fromEnum- pred = toEnum . (subtract 1) . fromEnum- enumFrom x = map toEnum [fromEnum x ..]- enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]- enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]+ succ = toEnum . (+ 1) . fromEnum++ pred = toEnum . (subtract 1) . fromEnum++ -- See Note [Stable Unfolding for list producers]+ {-# INLINABLE enumFrom #-}+ enumFrom x = map toEnum [fromEnum x ..]++ -- See Note [Stable Unfolding for list producers]+ {-# INLINABLE enumFromThen #-}+ enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]++ -- See Note [Stable Unfolding for list producers]+ {-# INLINABLE enumFromTo #-}+ enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]++ -- See Note [Stable Unfolding for list producers]+ {-# INLINABLE enumFromThenTo #-} enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y] +-- See Note [Stable Unfolding for list producers]+{-# INLINABLE boundedEnumFrom #-} -- Default methods for bounded enumerations boundedEnumFrom :: (Enum a, Bounded a) => a -> [a] boundedEnumFrom n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)] +-- See Note [Stable Unfolding for list producers]+{-# INLINABLE boundedEnumFromThen #-} boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a] boundedEnumFromThen n1 n2 | i_n2 >= i_n1 = map toEnum [i_n1, i_n2 .. fromEnum (maxBound `asTypeOf` n1)]@@ -158,6 +175,14 @@ i_n1 = fromEnum n1 i_n2 = fromEnum n2 +{-+Note [Stable Unfolding for list producers]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++The INLINABLE/INLINE pragmas ensure that we export stable (unoptimised)+unfoldings in the interface file so we can do list fusion at usage sites.+-}+ ------------------------------------------------------------------------ -- Helper functions ------------------------------------------------------------------------@@ -343,16 +368,20 @@ toEnum = chr fromEnum = ord + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFrom #-} enumFrom (C# x) = eftChar (ord# x) 0x10FFFF# -- Blarg: technically I guess enumFrom isn't strict! + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromTo #-} enumFromTo (C# x) (C# y) = eftChar (ord# x) (ord# y) + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThen #-} enumFromThen (C# x1) (C# x2) = efdChar (ord# x1) (ord# x2) + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThenTo #-} enumFromThenTo (C# x1) (C# x2) (C# y) = efdtChar (ord# x1) (ord# x2) (ord# y) @@ -472,17 +501,21 @@ toEnum x = x fromEnum x = x + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFrom #-} enumFrom (I# x) = eftInt x maxInt# where !(I# maxInt#) = maxInt -- Blarg: technically I guess enumFrom isn't strict! + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromTo #-} enumFromTo (I# x) (I# y) = eftInt x y + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThen #-} enumFromThen (I# x1) (I# x2) = efdInt x1 x2 + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThenTo #-} enumFromThenTo (I# x1) (I# x2) (I# y) = efdtInt x1 x2 y @@ -809,16 +842,23 @@ instance Enum Integer where succ x = x + 1 pred x = x - 1- toEnum (I# n) = smallInteger n- fromEnum n = I# (integerToInt n)+ toEnum (I# n) = IS n+ fromEnum n = integerToInt n + -- See Note [Stable Unfolding for list producers] {-# INLINE enumFrom #-}+ enumFrom x = enumDeltaInteger x 1++ -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThen #-}+ enumFromThen x y = enumDeltaInteger x (y-x)++ -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromTo #-}+ enumFromTo x lim = enumDeltaToInteger x 1 lim++ -- See Note [Stable Unfolding for list producers] {-# INLINE enumFromThenTo #-}- enumFrom x = enumDeltaInteger x 1- enumFromThen x y = enumDeltaInteger x (y-x)- enumFromTo x lim = enumDeltaToInteger x 1 lim enumFromThenTo x y lim = enumDeltaToInteger x (y-x) lim -- See Note [How the Enum rules work]@@ -921,26 +961,25 @@ -- | @since 4.8.0.0 instance Enum Natural where- succ n = n `plusNatural` wordToNaturalBase 1##- pred n = n `minusNatural` wordToNaturalBase 1##-- toEnum = intToNatural+ succ n = n + 1+ pred n = n - 1+ toEnum i@(I# i#)+ | i >= 0 = naturalFromWord# (int2Word# i#)+ | otherwise = errorWithoutStackTrace "toEnum: unexpected negative Int" -#if defined(MIN_VERSION_integer_gmp)- fromEnum (NatS# w)+ fromEnum (NS w) | i >= 0 = i | otherwise = errorWithoutStackTrace "fromEnum: out of Int range" where i = I# (word2Int# w)-#endif- fromEnum n = fromEnum (naturalToInteger n)+ fromEnum n = fromEnum (integerFromNatural n) - enumFrom x = enumDeltaNatural x (wordToNaturalBase 1##)+ enumFrom x = enumDeltaNatural x 1 enumFromThen x y | x <= y = enumDeltaNatural x (y-x)- | otherwise = enumNegDeltaToNatural x (x-y) (wordToNaturalBase 0##)+ | otherwise = enumNegDeltaToNatural x (x-y) 0 - enumFromTo x lim = enumDeltaToNatural x (wordToNaturalBase 1##) lim+ enumFromTo x lim = enumDeltaToNatural x 1 lim enumFromThenTo x y lim | x <= y = enumDeltaToNatural x (y-x) lim | otherwise = enumNegDeltaToNatural x (x-y) lim
GHC/Err.hs view
@@ -26,11 +26,7 @@ import GHC.Types (Char, RuntimeRep) import GHC.Stack.Types import GHC.Prim-import GHC.Integer () -- Make sure Integer and Natural are compiled first-import GHC.Natural () -- because GHC depends on it in a wired-in way- -- so the build system doesn't see the dependency.- -- See Note [Depend on GHC.Integer] and- -- Note [Depend on GHC.Natural] in GHC.Base.+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base import {-# SOURCE #-} GHC.Exception ( errorCallWithCallStackException , errorCallException )
GHC/Event/Array.hs view
@@ -19,6 +19,7 @@ , removeAt , snoc , unsafeLoad+ , unsafeCopyFromBuffer , unsafeRead , unsafeWrite , useAsPtr@@ -32,7 +33,7 @@ import Foreign.Ptr (Ptr, nullPtr, plusPtr) import Foreign.Storable (Storable(..)) import GHC.Base hiding (empty)-import GHC.ForeignPtr (mallocPlainForeignPtrBytes, newForeignPtr_)+import GHC.ForeignPtr (mallocPlainForeignPtrBytes, newForeignPtr_, unsafeWithForeignPtr) import GHC.Num (Num(..)) import GHC.Real (fromIntegral) import GHC.Show (show)@@ -77,9 +78,9 @@ reallocHack dummy src = do let size = sizeOf dummy dst <- mallocPlainForeignPtrBytes (newSize * size)- withForeignPtr src $ \s ->+ unsafeWithForeignPtr src $ \s -> when (s /= nullPtr && oldSize > 0) .- withForeignPtr dst $ \d -> do+ unsafeWithForeignPtr dst $ \d -> do _ <- memcpy d s (fromIntegral (oldSize * size)) return () return dst@@ -98,8 +99,8 @@ dupHack dummy (Array ref) = do AC es len cap <- readIORef ref ary <- allocArray cap- withForeignPtr ary $ \dest ->- withForeignPtr es $ \src -> do+ unsafeWithForeignPtr ary $ \dest ->+ unsafeWithForeignPtr es $ \src -> do _ <- memcpy dest src (fromIntegral (len * sizeOf dummy)) return () Array `fmap` newIORef (AC ary len cap)@@ -118,8 +119,8 @@ unsafeRead (Array ref) ix = do AC es _ cap <- readIORef ref CHECK_BOUNDS("unsafeRead",cap,ix)- withForeignPtr es $ \p ->- peekElemOff p ix+ unsafeWithForeignPtr es $ \ptr -> peekElemOff ptr ix+ -- this is safe WRT #17760 as we assume that peekElemOff doesn't diverge unsafeWrite :: Storable a => Array a -> Int -> a -> IO () unsafeWrite (Array ref) ix a = do@@ -129,16 +130,32 @@ unsafeWrite' :: Storable a => AC a -> Int -> a -> IO () unsafeWrite' (AC es _ cap) ix a = do CHECK_BOUNDS("unsafeWrite'",cap,ix)- withForeignPtr es $ \p ->- pokeElemOff p ix a+ unsafeWithForeignPtr es $ \ptr -> pokeElemOff ptr ix a+ -- this is safe WRT #17760 as we assume that peekElemOff doesn't diverge +-- | Precondition: continuation must not diverge due to use of+-- 'unsafeWithForeignPtr'. unsafeLoad :: Array a -> (Ptr a -> Int -> IO Int) -> IO Int unsafeLoad (Array ref) load = do AC es _ cap <- readIORef ref- len' <- withForeignPtr es $ \p -> load p cap+ len' <- unsafeWithForeignPtr es $ \p -> load p cap writeIORef ref (AC es len' cap) return len' +-- | Reads n elements from the pointer and copies them+-- into the array.+unsafeCopyFromBuffer :: Storable a => Array a -> Ptr a -> Int -> IO ()+unsafeCopyFromBuffer (Array ref) sptr n =+ readIORef ref >>= \(AC es _ cap) ->+ CHECK_BOUNDS("unsafeCopyFromBuffer", cap, n)+ unsafeWithForeignPtr es $ \pdest -> do+ let size = sizeOfPtr sptr undefined+ _ <- memcpy pdest sptr (fromIntegral $ n * size)+ writeIORef ref (AC es n cap)+ where+ sizeOfPtr :: Storable a => Ptr a -> a -> Int+ sizeOfPtr _ a = sizeOf a+ ensureCapacity :: Storable a => Array a -> Int -> IO () ensureCapacity (Array ref) c = do ac@(AC _ _ cap) <- readIORef ref@@ -183,7 +200,7 @@ AC es len _ <- readIORef ref let size = sizeOf dummy offset = len * size- withForeignPtr es $ \p -> do+ unsafeWithForeignPtr es $ \p -> do let go n | n >= offset = return () | otherwise = do f =<< peek (p `plusPtr` n)@@ -254,8 +271,8 @@ then return dac else do AC dst dlen dcap <- ensureCapacity' dac (dstart + count)- withForeignPtr dst $ \dptr ->- withForeignPtr src $ \sptr -> do+ unsafeWithForeignPtr dst $ \dptr ->+ unsafeWithForeignPtr src $ \sptr -> do _ <- memcpy (dptr `plusPtr` (dstart * size)) (sptr `plusPtr` (sstart * size)) (fromIntegral (count * size))@@ -271,7 +288,7 @@ let size = sizeOf dummy newLen = oldLen - 1 when (newLen > 0 && i < newLen) .- withForeignPtr fp $ \ptr -> do+ unsafeWithForeignPtr fp $ \ptr -> do _ <- memmove (ptr `plusPtr` (size * i)) (ptr `plusPtr` (size * (i+1))) (fromIntegral (size * (newLen-i)))
GHC/Event/IntTable.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE BangPatterns, NoImplicitPrelude, RecordWildCards #-} {-# OPTIONS_GHC -Wno-name-shadowing #-}+{-# OPTIONS_GHC -Wno-incomplete-record-updates #-} module GHC.Event.IntTable (@@ -16,7 +17,8 @@ import Data.Bits ((.&.), shiftL, shiftR) import Data.IORef (IORef, newIORef, readIORef, writeIORef) import Data.Maybe (Maybe(..), isJust)-import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr, withForeignPtr)+import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr)+import GHC.ForeignPtr (unsafeWithForeignPtr) import Foreign.Storable (peek, poke) import GHC.Base (Monad(..), (=<<), ($), ($!), const, liftM, otherwise, when) import GHC.Classes (Eq(..), Ord(..))@@ -61,7 +63,7 @@ new_ capacity = do arr <- Arr.new Empty capacity size <- mallocForeignPtr- withForeignPtr size $ \ptr -> poke ptr 0+ unsafeWithForeignPtr size $ \ptr -> poke ptr 0 return IT { tabArr = arr , tabSize = size }@@ -80,7 +82,7 @@ copyBucket (m+1) bucketNext copyBucket n =<< Arr.read (tabArr oldit) i copySlot 0 0- withForeignPtr (tabSize newit) $ \ptr -> poke ptr size+ unsafeWithForeignPtr (tabSize newit) $ \ptr -> poke ptr size writeIORef ref newit -- | @insertWith f k v table@ inserts @k@ into @table@ with value @v@.@@ -99,7 +101,7 @@ Arr.write tabArr idx (Bucket k v' next) return (Just bucketValue) | otherwise = go bkt { bucketNext = seen } bucketNext- go seen _ = withForeignPtr tabSize $ \ptr -> do+ go seen _ = unsafeWithForeignPtr tabSize $ \ptr -> do size <- peek ptr if size + 1 >= Arr.size tabArr - (Arr.size tabArr `shiftR` 2) then grow it ref size >> insertWith f k v inttable@@ -138,7 +140,8 @@ when (isJust oldVal) $ do Arr.write tabArr idx newBucket when del $- withForeignPtr tabSize $ \ptr -> do+ unsafeWithForeignPtr tabSize $ \ptr -> do size <- peek ptr poke ptr (size - 1) return oldVal+
GHC/Event/Internal.hs view
@@ -1,5 +1,7 @@ {-# LANGUAGE Unsafe #-} {-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-}+{-# LANGUAGE MagicHash #-}+{-# LANGUAGE UnboxedTuples #-} module GHC.Event.Internal (@@ -10,150 +12,21 @@ , poll , modifyFd , modifyFdOnce- -- * Event type- , Event- , evtRead- , evtWrite- , evtClose- , eventIs- -- * Lifetimes- , Lifetime(..)- , EventLifetime- , eventLifetime- , elLifetime- , elEvent- -- * Timeout type- , Timeout(..)+ , module GHC.Event.Internal.Types -- * Helpers , throwErrnoIfMinus1NoRetry++ -- Atomic ptr exchange for WinIO+ , exchangePtr ) where -import Data.Bits ((.|.), (.&.))-import Data.OldList (foldl', filter, intercalate, null) import Foreign.C.Error (eINTR, getErrno, throwErrno) import System.Posix.Types (Fd) import GHC.Base-import GHC.Word (Word64) import GHC.Num (Num(..))-import GHC.Show (Show(..))-import Data.Semigroup.Internal (stimesMonoid)---- | An I\/O event.-newtype Event = Event Int- deriving Eq -- ^ @since 4.4.0.0--evtNothing :: Event-evtNothing = Event 0-{-# INLINE evtNothing #-}---- | Data is available to be read.-evtRead :: Event-evtRead = Event 1-{-# INLINE evtRead #-}---- | The file descriptor is ready to accept a write.-evtWrite :: Event-evtWrite = Event 2-{-# INLINE evtWrite #-}---- | Another thread closed the file descriptor.-evtClose :: Event-evtClose = Event 4-{-# INLINE evtClose #-}--eventIs :: Event -> Event -> Bool-eventIs (Event a) (Event b) = a .&. b /= 0---- | @since 4.4.0.0-instance Show Event where- show e = '[' : (intercalate "," . filter (not . null) $- [evtRead `so` "evtRead",- evtWrite `so` "evtWrite",- evtClose `so` "evtClose"]) ++ "]"- where ev `so` disp | e `eventIs` ev = disp- | otherwise = ""---- | @since 4.10.0.0-instance Semigroup Event where- (<>) = evtCombine- stimes = stimesMonoid---- | @since 4.4.0.0-instance Monoid Event where- mempty = evtNothing- mconcat = evtConcat--evtCombine :: Event -> Event -> Event-evtCombine (Event a) (Event b) = Event (a .|. b)-{-# INLINE evtCombine #-}--evtConcat :: [Event] -> Event-evtConcat = foldl' evtCombine evtNothing-{-# INLINE evtConcat #-}---- | The lifetime of an event registration.------ @since 4.8.1.0-data Lifetime = OneShot -- ^ the registration will be active for only one- -- event- | MultiShot -- ^ the registration will trigger multiple times- deriving ( Show -- ^ @since 4.8.1.0- , Eq -- ^ @since 4.8.1.0- )---- | The longer of two lifetimes.-elSupremum :: Lifetime -> Lifetime -> Lifetime-elSupremum OneShot OneShot = OneShot-elSupremum _ _ = MultiShot-{-# INLINE elSupremum #-}---- | @since 4.10.0.0-instance Semigroup Lifetime where- (<>) = elSupremum- stimes = stimesMonoid---- | @mappend@ takes the longer of two lifetimes.------ @since 4.8.0.0-instance Monoid Lifetime where- mempty = OneShot---- | A pair of an event and lifetime------ Here we encode the event in the bottom three bits and the lifetime--- in the fourth bit.-newtype EventLifetime = EL Int- deriving ( Show -- ^ @since 4.8.0.0- , Eq -- ^ @since 4.8.0.0- )---- | @since 4.11.0.0-instance Semigroup EventLifetime where- EL a <> EL b = EL (a .|. b)---- | @since 4.8.0.0-instance Monoid EventLifetime where- mempty = EL 0--eventLifetime :: Event -> Lifetime -> EventLifetime-eventLifetime (Event e) l = EL (e .|. lifetimeBit l)- where- lifetimeBit OneShot = 0- lifetimeBit MultiShot = 8-{-# INLINE eventLifetime #-}--elLifetime :: EventLifetime -> Lifetime-elLifetime (EL x) = if x .&. 8 == 0 then OneShot else MultiShot-{-# INLINE elLifetime #-}--elEvent :: EventLifetime -> Event-elEvent (EL x) = Event (x .&. 0x7)-{-# INLINE elEvent #-}+import GHC.Event.Internal.Types --- | A type alias for timeouts, specified in nanoseconds.-data Timeout = Timeout {-# UNPACK #-} !Word64- | Forever- deriving Show -- ^ @since 4.4.0.0+import GHC.Ptr (Ptr(..)) -- | Event notification backend. data Backend = forall a. Backend {@@ -229,3 +102,12 @@ err <- getErrno if err == eINTR then return 0 else throwErrno loc else return res++{-# INLINE exchangePtr #-}+-- | @exchangePtr pptr x@ swaps the pointer pointed to by @pptr@ with the value+-- @x@, returning the old value.+exchangePtr :: Ptr (Ptr a) -> Ptr a -> IO (Ptr a)+exchangePtr (Ptr dst) (Ptr val) =+ IO $ \s ->+ case (atomicExchangeAddrAddr# dst val s) of+ (# s2, old_val #) -> (# s2, Ptr old_val #)
+ GHC/Event/Internal/Types.hs view
@@ -0,0 +1,160 @@+{-# LANGUAGE NoImplicitPrelude #-}+-------------------------------------------------------------------------------+-- |+-- Module : GHC.IO.Types+-- Copyright : (c) Tamar Christina 2018+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable+--+-- Abstraction over C Handle types for GHC, Unix wants FD (CInt) while Windows+-- Wants Handle (CIntPtr), so we abstract over them here.+--+-------------------------------------------------------------------------------++module GHC.Event.Internal.Types+ (+ -- * Event type+ Event+ , evtRead+ , evtWrite+ , evtClose+ , evtNothing+ , eventIs+ -- * Lifetimes+ , Lifetime(..)+ , EventLifetime+ , eventLifetime+ , elLifetime+ , elEvent+ -- * Timeout type+ , Timeout(..)+ ) where++import Data.OldList (foldl', filter, intercalate, null)++import Data.Bits ((.|.), (.&.))+import Data.Semigroup.Internal (stimesMonoid)++import GHC.Base+import GHC.Show (Show(..))+import GHC.Word (Word64)++-- | An I\/O event.+newtype Event = Event Int+ deriving Eq -- ^ @since 4.4.0.0++evtNothing :: Event+evtNothing = Event 0+{-# INLINE evtNothing #-}++-- | Data is available to be read.+evtRead :: Event+evtRead = Event 1+{-# INLINE evtRead #-}++-- | The file descriptor is ready to accept a write.+evtWrite :: Event+evtWrite = Event 2+{-# INLINE evtWrite #-}++-- | Another thread closed the file descriptor.+evtClose :: Event+evtClose = Event 4+{-# INLINE evtClose #-}++eventIs :: Event -> Event -> Bool+eventIs (Event a) (Event b) = a .&. b /= 0++-- | @since 4.4.0.0+instance Show Event where+ show e = '[' : (intercalate "," . filter (not . null) $+ [evtRead `so` "evtRead",+ evtWrite `so` "evtWrite",+ evtClose `so` "evtClose"]) ++ "]"+ where ev `so` disp | e `eventIs` ev = disp+ | otherwise = ""++-- | @since 4.10.0.0+instance Semigroup Event where+ (<>) = evtCombine+ stimes = stimesMonoid++-- | @since 4.4.0.0+instance Monoid Event where+ mempty = evtNothing+ mconcat = evtConcat++evtCombine :: Event -> Event -> Event+evtCombine (Event a) (Event b) = Event (a .|. b)+{-# INLINE evtCombine #-}++evtConcat :: [Event] -> Event+evtConcat = foldl' evtCombine evtNothing+{-# INLINE evtConcat #-}++-- | The lifetime of an event registration.+--+-- @since 4.8.1.0+data Lifetime = OneShot -- ^ the registration will be active for only one+ -- event+ | MultiShot -- ^ the registration will trigger multiple times+ deriving ( Show -- ^ @since 4.8.1.0+ , Eq -- ^ @since 4.8.1.0+ )++-- | The longer of two lifetimes.+elSupremum :: Lifetime -> Lifetime -> Lifetime+elSupremum OneShot OneShot = OneShot+elSupremum _ _ = MultiShot+{-# INLINE elSupremum #-}++-- | @since 4.10.0.0+instance Semigroup Lifetime where+ (<>) = elSupremum+ stimes = stimesMonoid++-- | @mappend@ takes the longer of two lifetimes.+--+-- @since 4.8.0.0+instance Monoid Lifetime where+ mempty = OneShot++-- | A pair of an event and lifetime+--+-- Here we encode the event in the bottom three bits and the lifetime+-- in the fourth bit.+newtype EventLifetime = EL Int+ deriving ( Show -- ^ @since 4.8.0.0+ , Eq -- ^ @since 4.8.0.0+ )++-- | @since 4.11.0.0+instance Semigroup EventLifetime where+ EL a <> EL b = EL (a .|. b)++-- | @since 4.8.0.0+instance Monoid EventLifetime where+ mempty = EL 0++eventLifetime :: Event -> Lifetime -> EventLifetime+eventLifetime (Event e) l = EL (e .|. lifetimeBit l)+ where+ lifetimeBit OneShot = 0+ lifetimeBit MultiShot = 8+{-# INLINE eventLifetime #-}++elLifetime :: EventLifetime -> Lifetime+elLifetime (EL x) = if x .&. 8 == 0 then OneShot else MultiShot+{-# INLINE elLifetime #-}++elEvent :: EventLifetime -> Event+elEvent (EL x) = Event (x .&. 0x7)+{-# INLINE elEvent #-}++-- | A type alias for timeouts, specified in nanoseconds.+data Timeout = Timeout {-# UNPACK #-} !Word64+ | Forever+ deriving Show -- ^ @since 4.4.0.0
GHC/Event/Manager.hs view
@@ -150,9 +150,7 @@ haveOneShot :: Bool {-# INLINE haveOneShot #-}-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)-haveOneShot = False-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) haveOneShot = True #else haveOneShot = False@@ -365,20 +363,9 @@ return r {-# INLINE registerFd #-} -{-- Building GHC with parallel IO manager on Mac freezes when- compiling the dph libraries in the phase 2. As workaround, we- don't use oneshot and we wake up an IO manager on Mac every time- when we register an event.-- For more information, please read:- https://gitlab.haskell.org/ghc/ghc/issues/7651--} -- | Wake up the event manager. wakeManager :: EventManager -> IO ()-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)-wakeManager mgr = sendWakeup (emControl mgr)-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) wakeManager _ = return () #else wakeManager mgr = sendWakeup (emControl mgr)
GHC/Event/Thread.hs view
@@ -15,7 +15,7 @@ , registerDelay , blockedOnBadFD -- used by RTS ) where-+-- TODO: Use new Windows I/O manager import Control.Exception (finally, SomeException, toException) import Data.Foldable (forM_, mapM_, sequence_) import Data.IORef (IORef, newIORef, readIORef, writeIORef)@@ -281,7 +281,7 @@ ThreadFinished -> create ThreadDied -> do -- Sanity check: if the thread has died, there is a chance- -- that event manager is still alive. This could happend during+ -- that event manager is still alive. This could happened during -- the fork, for example. In this case we should clean up -- open pipes and everything else related to the event manager. -- See #4449@@ -308,7 +308,7 @@ ThreadFinished -> create ThreadDied -> do -- Sanity check: if the thread has died, there is a chance- -- that event manager is still alive. This could happend during+ -- that event manager is still alive. This could happened during -- the fork, for example. In this case we should clean up -- open pipes and everything else related to the event manager. -- See #4449
+ GHC/Event/TimeOut.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE NoImplicitPrelude #-}+-------------------------------------------------------------------------------+-- |+-- Module : GHC.Event.TimeOut+-- Copyright : (c) Tamar Christina 2018+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable+--+-- Common Timer definitions shared between WinIO and RIO.+--+-------------------------------------------------------------------------------++module GHC.Event.TimeOut where++import GHC.IO+import GHC.Base++import qualified GHC.Event.PSQ as Q+import GHC.Event.Unique (Unique)++-- | A priority search queue, with timeouts as priorities.+type TimeoutQueue = Q.PSQ TimeoutCallback++-- |+-- Warning: since the 'TimeoutCallback' is called from the I/O manager, it must+-- not throw an exception or block for a long period of time. In particular,+-- be wary of 'Control.Exception.throwTo' and 'Control.Concurrent.killThread':+-- if the target thread is making a foreign call, these functions will block+-- until the call completes.+type TimeoutCallback = IO ()++-- | An edit to apply to a 'TimeoutQueue'.+type TimeoutEdit = TimeoutQueue -> TimeoutQueue++-- | A timeout registration cookie.+newtype TimeoutKey = TK Unique+ deriving (Eq, Ord)
GHC/Event/TimerManager.hs view
@@ -6,7 +6,7 @@ , TypeSynonymInstances , FlexibleInstances #-}-+-- TODO: use the new Windows IO manager module GHC.Event.TimerManager ( -- * Types TimerManager@@ -51,7 +51,8 @@ import GHC.Show (Show(..)) import GHC.Event.Control import GHC.Event.Internal (Backend, Event, evtRead, Timeout(..))-import GHC.Event.Unique (Unique, UniqueSource, newSource, newUnique)+import GHC.Event.Unique (UniqueSource, newSource, newUnique)+import GHC.Event.TimeOut import System.Posix.Types (Fd) import qualified GHC.Event.Internal as I@@ -66,13 +67,6 @@ ------------------------------------------------------------------------ -- Types --- | A timeout registration cookie.-newtype TimeoutKey = TK Unique- deriving Eq -- ^ @since 4.7.0.0---- | Callback invoked on timeout events.-type TimeoutCallback = IO ()- data State = Created | Running | Dying@@ -80,12 +74,6 @@ deriving ( Eq -- ^ @since 4.7.0.0 , Show -- ^ @since 4.7.0.0 )---- | A priority search queue, with timeouts as priorities.-type TimeoutQueue = Q.PSQ TimeoutCallback---- | An edit to apply to a 'TimeoutQueue'.-type TimeoutEdit = TimeoutQueue -> TimeoutQueue -- | The event manager state. data TimerManager = TimerManager
+ GHC/Event/Windows.hsc view
@@ -0,0 +1,1291 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE ScopedTypeVariables #-}++-------------------------------------------------------------------------------+-- |+-- Module : GHC.Event.Windows+-- Copyright : (c) Tamar Christina 2018+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable+--+-- WinIO Windows event manager.+--+-------------------------------------------------------------------------------++module GHC.Event.Windows (+ -- * Manager+ Manager,+ getSystemManager,+ interruptSystemManager,+ wakeupIOManager,+ processRemoteCompletion,++ -- * Overlapped I/O+ associateHandle,+ associateHandle',+ withOverlapped,+ withOverlappedEx,+ StartCallback,+ StartIOCallback,+ CbResult(..),+ CompletionCallback,+ LPOVERLAPPED,++ -- * Timeouts+ TimeoutCallback,+ TimeoutKey,+ Seconds,+ registerTimeout,+ updateTimeout,+ unregisterTimeout,++ -- * Utilities+ withException,+ ioSuccess,+ ioFailed,+ ioFailedAny,+ getLastError,++ -- * I/O Result type+ IOResult(..),++ -- * I/O Event notifications+ HandleData (..), -- seal for release+ HandleKey (handleValue),+ registerHandle,+ unregisterHandle,++ -- * Console events+ module GHC.Event.Windows.ConsoleEvent+) where++-- define DEBUG 1++-- #define DEBUG_TRACE 1++##include "windows_cconv.h"+#include <windows.h>+#include <ntstatus.h>+#include <Rts.h>+#include "winio_structs.h"++-- There doesn't seem to be GHC.* import for these+import Control.Concurrent.MVar (modifyMVar)+import {-# SOURCE #-} Control.Concurrent (forkOS)+import Data.Semigroup.Internal (stimesMonoid)+import Data.Foldable (mapM_, length, forM_)+import Data.Maybe (isJust, maybe)++import GHC.Event.Windows.Clock (Clock, Seconds, getClock, getTime)+import GHC.Event.Windows.FFI (LPOVERLAPPED, OVERLAPPED_ENTRY(..),+ CompletionData(..), CompletionCallback,+ withRequest)+import GHC.Event.Windows.ManagedThreadPool+import GHC.Event.Internal.Types+import GHC.Event.Unique+import GHC.Event.TimeOut+import GHC.Event.Windows.ConsoleEvent+import qualified GHC.Event.Windows.FFI as FFI+import qualified GHC.Event.PSQ as Q+import qualified GHC.Event.IntTable as IT+import qualified GHC.Event.Internal as I++import GHC.MVar+import GHC.Exception as E+import GHC.IORef+import GHC.Maybe+import GHC.Word+import GHC.OldList (deleteBy)+import Foreign+import qualified GHC.Event.Array as A+import GHC.Base+import GHC.Conc.Sync+import GHC.IO+import GHC.IOPort+import GHC.Num+import GHC.Real+import GHC.Enum (maxBound)+import GHC.Windows+import GHC.List (null)+import Text.Show++#if defined(DEBUG)+import Foreign.C+import System.Posix.Internals (c_write)+import GHC.Conc.Sync (myThreadId)+#endif++import qualified GHC.Windows as Win32++#if defined(DEBUG_TRACE)+import {-# SOURCE #-} Debug.Trace (traceEventIO)+#endif++-- Note [WINIO Manager design]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~+-- This file contains the Windows I//O manager. Windows's IO subsystem is by+-- design fully asynchronous, however there are multiple ways and interfaces+-- to the async methods.+--+-- The chosen Async interface for this implementation is using Completion Ports+-- See also Note [Completion Ports]. The I/O manager uses a new interface added+-- in Windows Vista called `GetQueuedCompletionStatusEx` which allows us to+-- service multiple requests in one go.+--+-- See https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/overview-of-the-windows-i-o-model+-- and https://www.microsoftpressstore.com/articles/article.aspx?p=2201309&seqNum=3+--+-- In order to understand this file, here is what you should know:+-- We're using relatively new APIs that allow us to service multiple requests at+-- the same time using one OS thread. This happens using so called Completion+-- ports. All I/O actions get associated with one and the same completion port.+--+-- The I/O manager itself has two mode of operation:+-- 1) Threaded: We have N dedicated OS threads in the Haskell world that service+-- completion requests. Everything is Handled 100% in view of the runtime.+-- Whenever the OS has completions that need to be serviced it wakes up one+-- one of the OS threads that are blocked in GetQueuedCompletionStatusEx and+-- lets it proceed with the list of completions that are finished. If more+-- completions finish before the first list is done being processed then+-- another thread is woken up. These threads are associated with the I/O+-- manager through the completion port. If a thread blocks for any reason the+-- OS I/O manager will wake up another thread blocked in GetQueuedCompletionStatusEx+-- from the pool to finish processing the remaining entries. This worker thread+-- must be able to handle the+-- fact that something else has finished the remainder of their queue or must+-- have a guarantee to never block. In this implementation we strive to+-- never block. This is achieved by not having the worker threads call out+-- to any user code, and to have the IOPort synchronization primitive never+-- block. This means if the port is full the message is lost, however we+-- have an invariant that the port can never be full and have a waiting+-- receiver. As such, dropping the message does not change anything as there+-- will never be anyone to receive it. e.g. it is an impossible situation to+-- land in.+-- Note that it is valid (and perhaps expected) that at times two workers+-- will receive the same requests to handle. We deal with this by using+-- atomic operations to prevent race conditions. See processCompletion+-- for details.+-- 2) Non-threaded: We don't have any dedicated Haskell threads servicing+-- I/O Requests. Instead we have an OS thread inside the RTS that gets+-- notified of new requests and does the servicing. When a request completes+-- a Haskell thread is scheduled to run to finish off the processing of any+-- completed requests. See Note [Non-Threaded WINIO design].+--+-- These two modes of operations share the majority of the code and so they both+-- support the same operations and fixing one will fix the other.+-- Unlike MIO, we don't threat network I/O any differently than file I/O. Hence+-- any network specific code is now only in the network package.+--+-- See also Note [Completion Ports] which has some of the details which+-- informed this design.+--+-- Note [Threaded WINIO design]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~+-- The threaded WiNIO is designed around a simple blocking call that's called in+-- a service loop in a dedicated thread: `GetQueuedCompletionStatusEx`.+-- as such the loop is reasonably simple. We're either servicing finished+-- requests or blocking in `getQueuedCompletionStatusEx` waiting for new+-- requests to arrive.+--+-- Each time a Handle is made three important things happen that affect the I/O+-- manager design:+-- 1) Files are opened with the `FILE_FLAG_OVERLAPPED` flag, which instructs the+-- OS that we will be doing purely asynchronous requests. See+-- `GHC.IO.Windows.Handle.openFile`. They are also opened with+-- `FILE_FLAG_SEQUENTIAL_SCAN` to indicate to the OS that we want to optimize+-- the access of the file for sequential access. (e.g. equivalent to MADVISE)+-- 2) The created handle is associated with the I/O manager's completion port.+-- This allows the I/O manager to be able to service I/O events from this+-- handle. See `associateHandle`.+-- 3) File handles are additionally modified with two optimization flags:+--+-- FILE_SKIP_COMPLETION_PORT_ON_SUCCESS: If the request can be serviced+-- immediately, then do not queue the IRP (IO Request Packet) into the I/O+-- manager waiting for us to service it later. Instead service it+-- immediately in the same call. This is beneficial for two reasons:+-- 1) We don't have to block in the Haskell RTS.+-- 2) We save a bunch of work in the OS's I/O subsystem.+-- The downside is though that we have to do a bunch of work to handle these+-- cases. This is abstracted away from the user by the `withOverlapped`+-- function.+-- This together with the buffering strategy mentioned above means we+-- actually skip the I/O manager on quite a lot of I/O requests due to the+-- value being in the cache. Because of the Lazy I/O in Haskell, the time+-- to read and decode the buffer of bytes is usually longer than the OS needs+-- to read the next chunk, so we hit the FAST_IO IRP quite often.+--+-- FILE_SKIP_SET_EVENT_ON_HANDLE: Since we will not be using an event object+-- to monitor asynchronous completions, don't bother updating or checking for+-- one. This saves some precious cycles, especially on operations with very+-- high number of I/O operations (e.g. servers.)+--+-- So what does servicing a request actually mean. As mentioned before the+-- I/O manager will be blocked or servicing a request. In reality it doesn't+-- always block till an I/O request has completed. In cases where we have event+-- timers, we block till the next timer's timeout. This allows us to also+-- service timers in the same loop. The side effect of this is that we will+-- exit the I/O wait sometimes without any completions. Not really a problem+-- but it's an important design decision.+--+-- Every time we wait, we give a pre-allocated buffer of `n`+-- `OVERLAPPED_ENTRIES` to the OS. This means that in a single call we can+-- service up to `n` I/O requests at a time. The size of `n` is not fixed,+-- anytime we dequeue `n` I/O requests in a single operation we double the+-- buffer size, allowing the I/O manager to be able to scale up depending+-- on the workload. This buffer is kept alive throughout the lifetime of the+-- program and is never freed until the I/O manager is shutting down.+--+-- One very important property of the I/O subsystem is that each I/O request+-- now requires an `OVERLAPPED` structure be given to the I/O manager. See+-- `withOverlappedEx`. This buffer is used by the OS to fill in various state+-- information. Throughout the duration of I/O call, this buffer MUST+-- remain live. The address is pinned by the kernel, which means that the+-- pointer must remain accessible until `GetQueuedCompletionStatusEx` returns+-- the completion associated with the handle and not just until the call to what+-- ever I/O operation was used to initialize the I/O request returns.+-- The only exception to this is when the request has hit the FAST_IO path, in+-- which case it has skipped the I/O queue and so can be freed immediately after+-- reading the results from it.+--+-- To prevent having to lookup the Haskell payload in a shared state after the+-- request completes we attach it as part of the I/O request by extending the+-- `OVERLAPPED` structure. Instead of passing an `OVERLAPPED` structure to the+-- Windows API calls we instead pass a `HASKELL_OVERLAPPED` struct which has+-- as the first element an `OVERLAPPED structure. This means when a request is+-- done all we need to do is cast the pointer back to `HASKELL_OVERLAPPED` and+-- read the accompanying data. This also means we don't have a global lock and+-- so can scale much easier.+--++-- ---------------------------------------------------------------------------+-- I/O manager global thread++-- When running GHCi we still want to ensure we still only have one+-- io manager thread, even if base is loaded twice. See the docs for+-- sharedCAF for how this is done.++{-# NOINLINE ioManagerThread #-}+ioManagerThread :: MVar (Maybe ThreadId)+ioManagerThread = unsafePerformIO $ do+ m <- newMVar Nothing+ sharedCAF m getOrSetGHCConcWindowsIOManagerThreadStore++foreign import ccall unsafe "getOrSetGHCConcWindowsIOManagerThreadStore"+ getOrSetGHCConcWindowsIOManagerThreadStore :: Ptr a -> IO (Ptr a)++-- ---------------------------------------------------------------------------+-- Non-threaded I/O manager callback hooks. See `ASyncWinIO.c`++foreign import ccall safe "registerIOCPHandle"+ registerIOCPHandle :: FFI.IOCP -> IO ()++foreign import ccall safe "registerAlertableWait"+-- (bool has_timeout, DWORD mssec);+ c_registerAlertableWait :: Bool -> DWORD -> IO ()++foreign import ccall safe "getOverlappedEntries"+ getOverlappedEntries :: Ptr DWORD -> IO (Ptr OVERLAPPED_ENTRY)++foreign import ccall safe "completeSynchronousRequest"+ completeSynchronousRequest :: IO ()++------------------------------------------------------------------------+-- Manager structures++-- | Pointer offset in bytes to the location of hoData in HASKELL_OVERLAPPPED+cdOffset :: Int+cdOffset = #{const __builtin_offsetof (HASKELL_OVERLAPPED, hoData)}++-- | Terminator symbol for IOCP request+nullReq :: Ptr CompletionData+nullReq = castPtr $ unsafePerformIO $ new (0 :: Int)+{-# NOINLINE nullReq #-}++-- I don't expect a lot of events, so a simple linked lists should be enough.+type EventElements = [(Event, HandleData)]+data EventData = EventData { evtTopLevel :: !Event, evtElems :: !EventElements }++instance Monoid EventData where+ mempty = EventData evtNothing []+ mappend = (<>)++instance Semigroup EventData where+ (<>) = \a b -> EventData (evtTopLevel a <> evtTopLevel b)+ (evtElems a ++ evtElems b)+ stimes = stimesMonoid++data IOResult a+ = IOSuccess { ioValue :: a }+ | IOFailed { ioErrCode :: Maybe Int }++-- | The state object for the I/O manager. This structure is available for both+-- the threaded and the non-threaded RTS.+data Manager = Manager+ { mgrIOCP :: {-# UNPACK #-} !FFI.IOCP+ , mgrClock :: !Clock+ , mgrUniqueSource :: {-# UNPACK #-} !UniqueSource+ , mgrTimeouts :: {-# UNPACK #-} !(IORef TimeoutQueue)+ , mgrEvntHandlers :: {-# UNPACK #-}+ !(MVar (IT.IntTable EventData))+ , mgrOverlappedEntries+ :: {-#UNPACK #-} !(A.Array OVERLAPPED_ENTRY)+ , mgrThreadPool :: Maybe ThreadPool+ }++{-# INLINE startIOManagerThread #-}+-- | Starts a new I/O manager thread.+-- For the threaded runtime it creates a pool of OS threads which stays alive+-- until they are instructed to die.+-- For the non-threaded runtime we have a single worker thread in+-- the C runtime which we force to wake up instead.+--+-- TODO: Threadpools are not yet implemented.+startIOManagerThread :: IO () -> IO ()+startIOManagerThread loop+ | not threadedIOMgr+ = debugIO "startIOManagerThread:NonThreaded" >>+ interruptSystemManager+ | otherwise = do+ modifyMVar_ ioManagerThread $ \old -> do+ let create = do debugIO "spawning worker threads.."+ t <- forkOS loop+ debugIO $ "created io-manager threads."+ labelThread t "IOManagerThread"+ return (Just t)+ debugIO $ "startIOManagerThread old=" ++ show old+ case old of+ Nothing -> create+ Just t -> do+ s <- threadStatus t+ case s of+ ThreadFinished -> create+ ThreadDied -> create+ _other -> do interruptSystemManager+ return (Just t)++requests :: MVar Word64+requests = unsafePerformIO $ newMVar 0++addRequest :: IO Word64+addRequest = modifyMVar requests (\x -> return (x + 1, x + 1))++removeRequest :: IO Word64+removeRequest = modifyMVar requests (\x -> return (x - 1, x - 1))++outstandingRequests :: IO Word64+outstandingRequests = withMVar requests return++getSystemManager :: IO Manager+getSystemManager = readMVar managerRef++-- | Mutable reference to the IO manager+managerRef :: MVar Manager+managerRef = unsafePerformIO $ createManager >>= newMVar+ where+ -- | Create the I/O manager. In the Threaded I/O manager this call doesn't+ -- have any side effects, but in the Non-Threaded I/O manager the newly+ -- created IOCP handle will be registered with the RTS. Users should never+ -- call this.+ -- It's only used to create the single global manager which is stored+ -- in an MVar.+ --+ -- NOTE: This needs to finish without making any calls to anything requiring the+ -- I/O manager otherwise we'll get into some weird synchronization issues.+ -- Essentially this means avoid using long running operations here.+ createManager :: IO Manager+ createManager = do+ debugIO "Starting io-manager..."+ mgrIOCP <- FFI.newIOCP+ when (not threadedIOMgr) $+ registerIOCPHandle mgrIOCP+ debugIO $ "iocp: " ++ show mgrIOCP+ mgrClock <- getClock+ mgrUniqueSource <- newSource+ mgrTimeouts <- newIORef Q.empty+ mgrOverlappedEntries <- A.new 64+ mgrEvntHandlers <- newMVar =<< IT.new callbackArraySize+ let mgrThreadPool = Nothing++ let !mgr = Manager{..}+ return mgr+{-# NOINLINE managerRef #-}++-- | Interrupts an I/O manager Wait. This will force the I/O manager to process+-- any outstanding events and timers. Also called when console events such as+-- ctrl+c are used to break abort an I/O request.+interruptSystemManager :: IO ()+interruptSystemManager = do+ mgr <- getSystemManager+ debugIO "interrupt received.."+ FFI.postQueuedCompletionStatus (mgrIOCP mgr) 0 0 nullPtr++-- | The initial number of I/O requests we can service at the same time.+-- Must be power of 2. This number is used as the starting point to scale+-- the number of concurrent requests. It will be doubled every time we are+-- saturated.+callbackArraySize :: Int+callbackArraySize = 32++-----------------------------------------------------------------------+-- Time utilities++secondsToNanoSeconds :: Seconds -> Q.Prio+secondsToNanoSeconds s = ceiling $ s * 1000000000++secondsToMilliSeconds :: Seconds -> Word32+secondsToMilliSeconds s = ceiling $ s * 1000++nanoSecondsToSeconds :: Q.Prio -> Seconds+nanoSecondsToSeconds n = fromIntegral n / 1000000000.0++------------------------------------------------------------------------+-- Overlapped I/O++-- | Callback that starts the overlapped I/O operation.+-- It must return successfully if and only if an I/O completion has been+-- queued. Otherwise, it must throw an exception, which 'withOverlapped'+-- will rethrow.+type StartCallback a = LPOVERLAPPED -> IO a++-- | Specialized callback type for I/O Completion Ports calls using+-- withOverlapped.+type StartIOCallback a = StartCallback (CbResult a)++-- | CallBack result type to disambiguate between the different states+-- an I/O Completion call could be in.+data CbResult a+ = CbDone (Maybe DWORD) -- ^ Request was handled immediately, no queue.+ | CbPending -- ^ Queued and to be handled by I/O manager+ | CbIncomplete -- ^ I/O request is incomplete but not enqueued, handle+ -- it synchronously.+ | CbError a -- ^ I/O request abort, return failure immediately+ | CbNone Bool -- ^ The caller did not do any checking, the I/O+ -- manager will perform additional checks.+ deriving Show++-- | Associate a 'HANDLE' with the current I/O manager's completion port.+-- This must be done before using the handle with 'withOverlapped'.+associateHandle' :: HANDLE -> IO ()+associateHandle' hwnd+ = do mngr <- getSystemManager+ associateHandle mngr hwnd++-- | A handle value representing an invalid handle.+invalidHandle :: HANDLE+invalidHandle = intPtrToPtr (#{const INVALID_HANDLE_VALUE})++-- | Associate a 'HANDLE' with the I/O manager's completion port. This must be+-- done before using the handle with 'withOverlapped'.+associateHandle :: Manager -> HANDLE -> IO ()+associateHandle Manager{..} h =+ -- Don't try to if the handle is invalid. This can happen with i.e a closed+ -- std handle.+ when (h /= invalidHandle) $+ -- Use as completion key the file handle itself, so we can track+ -- completion+ FFI.associateHandleWithIOCP mgrIOCP h (fromIntegral $ ptrToWordPtr h)+++{- Note [Why use non-waiting getOverlappedResult requests.]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++ When waiting for a request that is bound to be done soon+ we spin inside waitForCompletion. There are multiple reasons+ for this.++ In the non-threaded RTS we can't perform blocking calls to+ C functions without blocking the whole RTS so immediately+ a blocking call is not an option there.++ In the threaded RTS we don't use a blocking wait for different+ reasons. In particular performing a waiting request using+ getOverlappedResult uses the hEvent object embedded in the+ OVERLAPPED structure to wait for a signal.+ However we do not provide such an object as their creation+ would incur to much overhead. Making a waiting request a+ less useful operation as it doesn't guarantee that the+ operation we were waiting one finished. Only that some+ operation on the handle did.++-}++-- | Start an overlapped I/O operation, and wait for its completion. If+-- 'withOverlapped' is interrupted by an asynchronous exception, the operation+-- will be canceled using @CancelIoEx@.+--+-- 'withOverlapped' waits for a completion to arrive before returning or+-- throwing an exception. This means you can use functions like+-- 'Foreign.Marshal.Alloc.alloca' to allocate buffers for the operation.+withOverlappedEx :: forall a.+ Manager+ -> String -- ^ Handle name+ -> HANDLE -- ^ Windows handle associated with the operation.+ -> Word64 -- ^ Value to use for the @OVERLAPPED@+ -- structure's Offset/OffsetHigh members.+ -> StartIOCallback Int+ -> CompletionCallback (IOResult a)+ -> IO (IOResult a)+withOverlappedEx mgr fname h offset startCB completionCB = do+ signal <- newEmptyIOPort :: IO (IOPort (IOResult a))+ let signalReturn a = failIfFalse_ (dbgMsg "signalReturn") $+ writeIOPort signal (IOSuccess a)+ signalThrow ex = failIfFalse_ (dbgMsg "signalThrow") $+ writeIOPort signal (IOFailed ex)+ mask_ $ do+ let completionCB' e b = completionCB e b >>= \result ->+ case result of+ IOSuccess val -> signalReturn val+ IOFailed err -> signalThrow err+ let callbackData = CompletionData h completionCB'+ -- Note [Memory Management]+ -- These callback data and especially the overlapped structs have to keep+ -- alive throughout the entire lifetime of the requests. Since this+ -- function will block until done so it can call completionCB at the end+ -- we can safely use dynamic memory management here and so reduce the+ -- possibility of memory errors.+ withRequest offset callbackData $ \hs_lpol cdData -> do+ let ptr_lpol = hs_lpol `plusPtr` cdOffset+ let lpol = castPtr hs_lpol+ -- We need to add the payload before calling startCBResult, the reason being+ -- that the I/O routine begins immediately then. If we don't then the request+ -- may end up lost as processCompletion will get called with a null payload.+ poke ptr_lpol cdData++ -- Since FILE_SKIP_COMPLETION_PORT_ON_SUCCESS can't be+ -- relied on for non-file handles we need a way to prevent+ -- us from handling a request inline and handle a completion+ -- event handled without a queued I/O operation. Which means we+ -- can't solely rely on the number of oustanding requests but most+ -- also check intermediate status.+ reqs <- addRequest+ debugIO $ "+1.. " ++ show reqs ++ " requests queued. | " ++ show lpol+ cdDataCheck <- peek ptr_lpol :: IO (Ptr CompletionData)+ debugIO $ "hs_lpol:" ++ show hs_lpol+ ++ " cdData:" ++ show cdData+ ++ " ptr_lpol:" ++ show ptr_lpol+ ++ " *ptr_lpol:" ++ show cdDataCheck++ startCBResult <- startCB lpol `onException`+ (CbError `fmap` Win32.getLastError) >>= \result -> do+ -- Check to see if the operation was completed on a+ -- non-overlapping handle or was completed immediately.+ -- e.g. stdio redirection or data in cache, FAST I/O.+ success <- FFI.overlappedIOStatus lpol+ err <- getLastError+ -- Determine if the caller has done any checking. If not then check+ -- to see if the request was completed synchronously. We have to+ -- in order to prevent deadlocks since if it has completed+ -- synchronously we've requested to not have the completion queued.+ let result' =+ case result of+ CbNone ret -- Start by checking some flags which indicates we+ -- are done.+ | success == #{const STATUS_SUCCESS} -> CbDone Nothing+ | success == #{const STATUS_END_OF_FILE} -> CbDone Nothing+ -- Buffer was too small.. not sure what to do, so I'll just+ -- complete the read request+ | err == #{const ERROR_MORE_DATA} -> CbDone Nothing+ | err == #{const ERROR_SUCCESS} -> CbDone Nothing+ | err == #{const ERROR_IO_PENDING} -> CbPending+ | err == #{const ERROR_IO_INCOMPLETE} -> CbIncomplete+ | err == #{const ERROR_HANDLE_EOF} -> CbDone Nothing+ | err == #{const ERROR_BROKEN_PIPE} -> CbDone Nothing+ | err == #{const ERROR_NO_MORE_ITEMS} -> CbDone Nothing+ | err == #{const ERROR_OPERATION_ABORTED} -> CbDone Nothing+ -- This is currently mapping all non-complete requests we don't know+ -- about as an error. I wonder if this isn't too strict..+ | not ret -> CbError $ fromIntegral err+ -- We check success codes after checking error as+ -- errors are much more indicative+ | success == #{const STATUS_PENDING} -> CbPending+ -- If not just assume we can complete. If we can't this will+ -- hang because we don't know how to properly deal with it.+ -- I don't know what the best default here is...+ | otherwise -> CbPending+ _ -> result+ case result' of+ CbNone _ -> error "withOverlappedEx: CbNone shouldn't happen."+ CbIncomplete -> do+ debugIO $ "handling incomplete request synchronously " ++ show (h, lpol)+ res <- waitForCompletion h lpol+ debugIO $ "done blocking request 2: " ++ show (h, lpol) ++ " - " ++ show res+ return res+ CbPending -> do+ -- Before we enqueue check see if operation finished in the+ -- mean time, since caller may not have done this.+ -- Normally we'd have to clear lpol with 0 before this call,+ -- however the statuses we're interested in would not get to here+ -- so we can save the memset call.+ finished <- FFI.getOverlappedResult h lpol False+ debugIO $ "== " ++ show (finished)+ status <- FFI.overlappedIOStatus lpol+ debugIO $ "== >< " ++ show (status)+ lasterr <- getLastError+ -- This status indicated that we have finished early and so we+ -- won't have a request enqueued. Handle it inline.+ let done_early = status == #{const STATUS_SUCCESS}+ || status == #{const STATUS_END_OF_FILE}+ || errorIsCompleted lasterr+ -- This status indicates that the request hasn't finished early,+ -- but it will finish shortly. The I/O manager will not be+ -- enqueuing this either. Also needs to be handled inline.+ -- Sadly named pipes will always return this error, so in practice+ -- we end up always handling them synchronously. There is no good+ -- documentation on this.+ let will_finish_sync = lasterr == #{const ERROR_IO_INCOMPLETE}++ debugIO $ "== >*< " ++ show (finished, done_early, will_finish_sync, h, lpol, lasterr)+ case (finished, done_early, will_finish_sync) of+ (Just _, _, _) -> do+ debugIO "request handled immediately (o/b), not queued."+ return $ CbDone finished+ -- Still pending+ (Nothing, _, _) -> do+ -- If we should add back support to suspend the IO Manager thread+ -- then we will need to make sure it's running at this point.+ return result'+ CbError err' -> signalThrow (Just err') >> return result'+ CbDone _ -> do+ debugIO "request handled immediately (o), not queued." >> return result'++ -- If an exception was received while waiting for IO to complete+ -- we try to cancel the request here.+ let cancel e = do+ nerr <- getLastError+ debugIO $ "## Exception occurred. Cancelling request... "+ debugIO $ show (e :: SomeException) ++ " : " ++ show nerr+ _ <- uninterruptibleMask_ $ FFI.cancelIoEx' h lpol+ -- we need to wait for the cancellation before removing+ -- the pointer.+ debugIO $ "## Waiting for cancellation record... "+ _ <- FFI.getOverlappedResult h lpol True+ oldDataPtr <- I.exchangePtr ptr_lpol nullReq+ when (oldDataPtr == cdData) $+ do reqs1 <- removeRequest+ debugIO $ "-1.. " ++ show reqs1 ++ " requests queued after error."+ completionCB' (fromIntegral nerr) 0+ when (not threadedIOMgr) $+ do -- Run timeouts. This way if we canceled the last+ -- IO Request and have no timer events waiting we+ -- can go into an unbounded alertable wait.+ delay <- runExpiredTimeouts mgr+ registerAlertableWait delay+ return $ IOFailed Nothing+ let runner = do debugIO $ (dbgMsg ":: waiting ") ++ " | " ++ show lpol+ res <- readIOPort signal `catch` cancel+ debugIO $ dbgMsg ":: signaled "+ case res of+ IOFailed err -> FFI.throwWinErr fname (maybe 0 fromIntegral err)+ _ -> return res++ -- Sometimes we shouldn't bother with the I/O manager as the call has+ -- failed or is done.+ case startCBResult of+ CbPending -> runner+ CbDone rdata -> do+ oldDataPtr <- I.exchangePtr ptr_lpol nullReq+ if (oldDataPtr == cdData)+ then+ do reqs2 <- removeRequest+ debugIO $ "-1.. " ++ show reqs2 ++ " requests queued."+ debugIO $ dbgMsg $ ":: done " ++ show lpol ++ " - " ++ show rdata+ bytes <- if isJust rdata+ then return rdata+ -- Make sure it's safe to free the OVERLAPPED buffer+ else FFI.getOverlappedResult h lpol False+ cdDataCheck2 <- peek ptr_lpol :: IO (Ptr CompletionData)+ debugIO $ dbgMsg $ ":: exit *ptr_lpol: " ++ show cdDataCheck2+ debugIO $ dbgMsg $ ":: done bytes: " ++ show bytes+ case bytes of+ Just res -> completionCB 0 res+ Nothing -> do err <- FFI.overlappedIOStatus lpol+ numBytes <- FFI.overlappedIONumBytes lpol+ -- TODO: Remap between STATUS_ and ERROR_ instead+ -- of re-interpret here. But for now, don't care.+ let err' = fromIntegral err+ debugIO $ dbgMsg $ ":: done callback: " ++ show err' ++ " - " ++ show numBytes+ completionCB err' (fromIntegral numBytes)+ else readIOPort signal+ CbError err -> do+ reqs3 <- removeRequest+ debugIO $ "-1.. " ++ show reqs3 ++ " requests queued."+ let err' = fromIntegral err+ completionCB err' 0+ _ -> do+ error "unexpected case in `startCBResult'"+ where dbgMsg s = s ++ " (" ++ show h ++ ":" ++ show offset ++ ")"+ -- Wait for .25ms (threaded) and 1ms (non-threaded)+ -- Yields in the threaded case allowing other work.+ -- Blocks all haskell execution in the non-threaded case.+ -- We might want to reconsider the non-threaded handling+ -- at some point.+ doShortWait :: IO ()+ doShortWait+ | threadedIOMgr = do+ -- Uses an inline definition of threadDelay to prevent an import+ -- cycle.+ let usecs = 250 -- 0.25ms+ m <- newEmptyIOPort+ reg <- registerTimeout mgr usecs $+ writeIOPort m () >> return ()+ readIOPort m `onException` unregisterTimeout mgr reg+ | otherwise = sleepBlock 1 -- 1 ms+ waitForCompletion :: HANDLE -> Ptr FFI.OVERLAPPED -> IO (CbResult Int)+ waitForCompletion fhndl lpol = do+ -- Wait for the request to finish as it was running before and+ -- The I/O manager won't enqueue it due to our optimizations to+ -- prevent context switches in such cases.+ -- In the non-threaded case we must use a non-waiting query here+ -- otherwise the RTS will lock up until we get a result back.+ -- In the threaded case it can be beneficial to spin on the haskell+ -- side versus+ -- See also Note [Why use non-waiting getOverlappedResult requests.]+ res <- FFI.getOverlappedResult fhndl lpol False+ status <- FFI.overlappedIOStatus lpol+ case res of+ Nothing | status == #{const STATUS_END_OF_FILE}+ -> do+ when (not threadedIOMgr) completeSynchronousRequest+ return $ CbDone res+ | otherwise ->+ do lasterr <- getLastError+ let done = errorIsCompleted lasterr+ -- debugIO $ ":: loop - " ++ show lasterr ++ " :" ++ show done+ -- We will complete quite soon, in the threaded RTS we+ -- probably don't really want to wait for it while we could+ -- have done something else. In particular this is because+ -- of sockets which make take slightly longer.+ -- There's a trade-off. Using the timer would allow it do+ -- to continue running other Haskell threads, but also+ -- means it may take longer to complete the wait.+ unless done doShortWait+ if done+ then do when (not threadedIOMgr)+ completeSynchronousRequest+ return $ CbDone Nothing+ else waitForCompletion fhndl lpol+ Just _ -> do+ when (not threadedIOMgr) completeSynchronousRequest+ return $ CbDone res+ unless :: Bool -> IO () -> IO ()+ unless p a = if p then a else return ()++-- Safe version of function+withOverlapped :: String+ -> HANDLE+ -> Word64 -- ^ Value to use for the @OVERLAPPED@+ -- structure's Offset/OffsetHigh members.+ -> StartIOCallback Int+ -> CompletionCallback (IOResult a)+ -> IO (IOResult a)+withOverlapped fname h offset startCB completionCB = do+ mngr <- getSystemManager+ withOverlappedEx mngr fname h offset startCB completionCB++------------------------------------------------------------------------+-- Helper to check if an error code implies an operation has completed.++errorIsCompleted :: ErrCode -> Bool+errorIsCompleted lasterr =+ lasterr == #{const ERROR_HANDLE_EOF}+ || lasterr == #{const ERROR_SUCCESS}+ || lasterr == #{const ERROR_BROKEN_PIPE}+ || lasterr == #{const ERROR_NO_MORE_ITEMS}+ || lasterr == #{const ERROR_OPERATION_ABORTED}++------------------------------------------------------------------------+-- I/O Utilities++-- | Process an IOResult and throw an exception back to the user if the action+-- has failed, or return the result.+withException :: String -> IO (IOResult a) -> IO a+withException name fn+ = do res <- fn+ case res of+ IOSuccess a -> return a+ IOFailed (Just err) -> FFI.throwWinErr name $ fromIntegral err+ IOFailed Nothing -> FFI.throwWinErr name 0++-- | Signal that the I/O action was successful.+ioSuccess :: a -> IO (IOResult a)+ioSuccess = return . IOSuccess++-- | Signal that the I/O action has failed with the given reason.+ioFailed :: Integral a => a -> IO (IOResult a)+ioFailed = return . IOFailed . Just . fromIntegral++-- | Signal that the I/O action has failed with the given reason.+-- Polymorphic in successful result type.+ioFailedAny :: Integral a => a -> IO (IOResult b)+ioFailedAny = return . IOFailed . Just . fromIntegral++------------------------------------------------------------------------+-- Timeouts++-- | Convert uS(Int) to nS(Word64/Q.Prio) capping at maxBound+expirationTime :: Clock -> Int -> IO Q.Prio+expirationTime mgr us = do+ now <- getTime mgr :: IO Seconds -- Double+ let now_ns = ceiling $ now * 1000 * 1000 * 1000 :: Word64+ let expTime+ -- Currently we treat overflows by clamping to maxBound. If humanity+ -- still exists in 2500 CE we will ned to be a bit more careful here.+ -- See #15158.+ | (maxBound - now_ns) `quot` 1000 < fromIntegral us = maxBound :: Q.Prio+ | otherwise = now_ns + ns+ where ns = 1000 * fromIntegral us+ return expTime++-- | Register an action to be performed in the given number of seconds. The+-- returned 'TimeoutKey' can be used to later un-register or update the timeout.+-- The timeout is automatically unregistered when it fires.+--+-- The 'TimeoutCallback' will not be called more than once.+{-# NOINLINE registerTimeout #-}+registerTimeout :: Manager -> Int -> TimeoutCallback -> IO TimeoutKey+registerTimeout mgr@Manager{..} uSrelTime cb = do+ key <- newUnique mgrUniqueSource+ if uSrelTime <= 0 then cb+ else do+ !expTime <- expirationTime mgrClock uSrelTime :: IO Q.Prio+ editTimeouts mgr (Q.unsafeInsertNew key expTime cb)+ return $ TK key++-- | Update an active timeout to fire in the given number of seconds (from the+-- time 'updateTimeout' is called), instead of when it was going to fire.+-- This has no effect if the timeout has already fired.+updateTimeout :: Manager -> TimeoutKey -> Seconds -> IO ()+updateTimeout mgr (TK key) relTime = do+ now <- getTime (mgrClock mgr)+ let !expTime = secondsToNanoSeconds $ now + relTime+ -- Note: editTimeouts unconditionally wakes the IO Manager+ -- but that is not required if the new time is after+ -- the current time.+ editTimeouts mgr (Q.adjust (const expTime) key)++-- | Unregister an active timeout. This is a harmless no-op if the timeout is+-- already unregistered or has already fired.+--+-- Warning: the timeout callback may fire even after+-- 'unregisterTimeout' completes.+unregisterTimeout :: Manager -> TimeoutKey -> IO ()+unregisterTimeout mgr (TK key) = do+ editTimeouts mgr (Q.delete key)++-- | Modify an existing timeout. This isn't thread safe and so if the time to+-- elapse the timer was close it may fire anyway.+editTimeouts :: Manager -> TimeoutEdit -> IO ()+editTimeouts mgr g = do+ atomicModifyIORef' (mgrTimeouts mgr) $ \tq -> (g tq, ())+ interruptSystemManager++------------------------------------------------------------------------+-- I/O manager loop++-- | Call all expired timeouts, and return how much time until the next+-- | expiration.+runExpiredTimeouts :: Manager -> IO (Maybe Seconds)+runExpiredTimeouts Manager{..} = do+ now <- getTime mgrClock+ (expired, delay) <- atomicModifyIORef' mgrTimeouts (mkTimeout now)+ -- Execute timeout callbacks.+ mapM_ Q.value expired+ when (not threadedIOMgr && not (null expired))+ completeSynchronousRequest+ debugIO $ "expired calls: " ++ show (length expired)+ return delay+ where+ mkTimeout :: Seconds -> TimeoutQueue ->+ (TimeoutQueue, ([Q.Elem TimeoutCallback], Maybe Seconds))+ mkTimeout now tq =+ let (tq', (expired, sec)) = mkTimeout' (secondsToNanoSeconds now) tq+ in (tq', (expired, fmap nanoSecondsToSeconds sec))+ mkTimeout' :: Q.Prio -> TimeoutQueue ->+ (TimeoutQueue, ([Q.Elem TimeoutCallback], Maybe Q.Prio))+ mkTimeout' now tq =+ -- Remove timeouts with expiration <= now.+ let (expired, tq') = Q.atMost now tq in+ -- See how soon the next timeout expires.+ case Q.prio `fmap` Q.findMin tq' of+ Nothing ->+ (tq', (expired, Nothing))+ Just t ->+ -- This value will always be positive since the call+ -- to 'atMost' above removed any timeouts <= 'now'+ let !t' = t - now+ in (tq', (expired, Just t'))++-- | Return the delay argument to pass to GetQueuedCompletionStatus.+-- Return value is in ms+fromTimeout :: Maybe Seconds -> Word32+fromTimeout Nothing = 120000+fromTimeout (Just sec) | sec > 120 = 120000+ | sec > 0 = ceiling (sec * 1000)+ | otherwise = 0++-- | Perform one full evaluation step of the I/O manager's service loop.+-- This means process timeouts and completed completions and calculate the time+-- for the next timeout.+--+-- The I/O manager is then notified of how long it should block again based on+-- the queued I/O requests and timers. If the I/O manager was given a command+-- to block, shutdown or suspend than that request is honored at the end of the+-- loop.+--+-- This function can be safely executed multiple times in parallel and is only+-- used by the threaded manager.+step :: Bool -> Manager -> IO (Bool, Maybe Seconds)+step maxDelay mgr@Manager{..} = do+ -- Determine how long to wait the next time we block in an alertable state.+ delay <- runExpiredTimeouts mgr+ let !timer = if maxDelay && delay == Nothing+ then #{const INFINITE}+ else fromTimeout delay+ debugIO $ "next timer: " ++ show timer -- todo: print as hex+ if isJust delay+ then debugIO $ "I/O manager waiting: delay=" ++ show delay+ else debugIO $ "I/O manager pausing: maxDelay=" ++ show maxDelay++ -- Inform the threadpool that a thread is now+ -- entering a kernel mode wait and thus is ready for new work.+ notifyWaiting mgrThreadPool++ -- To quote Matt Godbolts:+ -- There are some unusual edge cases you need to deal with. The+ -- GetQueuedCompletionStatus function blocks a thread until there's+ -- work for it to do. Based on the return value, the number of bytes+ -- and the overlapped structure, there’s a lot of possible "reasons"+ -- for the function to have returned. Deciphering all the possible+ -- cases:+ --+ -- ------------------------------------------------------------------------+ -- Ret value | OVERLAPPED | # of bytes | Description+ -- ------------------------------------------------------------------------+ -- zero | NULL | n/a | Call to GetQueuedCompletionStatus+ -- failed, and no data was dequeued from the IO port. This usually+ -- indicates an error in the parameters to GetQueuedCompletionStatus.+ --+ -- zero | non-NULL | n/a | Call to GetQueuedCompletionStatus+ -- failed, but data was read or written. The thread must deal with the+ -- data (possibly freeing any associated buffers), but there is an error+ -- condition on the underlying HANDLE. Usually seen when the other end of+ -- a network connection has been forcibly closed but there's still data in+ -- the send or receive queue.+ --+ -- non-zero | NULL | n/a | This condition doesn't happen due+ -- to IO requests, but is useful to use in combination with+ -- PostQueuedCompletionStatus as a way of indicating to threads that they+ -- should terminate.+ --+ -- non-zero | non-NULL | zero | End of file for a file HANDLE, or+ -- the connection has been gracefully closed (for network connections).+ -- The OVERLAPPED buffer has still been used; and must be deallocated if+ -- necessary.+ --+ -- non-zero | non-NULL | non-zero | "num bytes" of data have been+ -- transferred into the block pointed by the OVERLAPPED structure. The+ -- direction of the transfer is dependant on the call made to the IO+ -- port, it's up to the user to remember if it was a read or a write+ -- (usually by stashing extra data in the OVERLAPPED structure). The+ -- thread must deallocate the structure as necessary.+ --+ -- The getQueuedCompletionStatusEx call will remove entries queued by the OS+ -- and returns the finished ones in mgrOverlappedEntries and the number of+ -- entries removed.+ n <- FFI.getQueuedCompletionStatusEx mgrIOCP mgrOverlappedEntries timer+ debugIO "WinIORunning"+ -- If threaded this call informs the threadpool manager that a thread is+ -- busy. If all threads are busy and we have not reached the maximum amount+ -- of allowed threads then the threadpool manager will spawn a new thread to+ -- allow us to scale under load.+ notifyRunning mgrThreadPool+ processCompletion mgr n delay++-- | Process the results at the end of an evaluation loop. This function will+-- read all the completions, unblock up all the Haskell threads, clean up the book+-- keeping of the I/O manager.+-- It returns whether there is outstanding work (request or timer) to be+-- done and how long it expects to have to wait till it can take action again.+--+-- Note that this method can do less work than there are entries in the+-- completion table. This is because some completion entries may have been+-- created due to calls to interruptIOManager which will enqueue a faux+-- completion.+--+-- NOTE: In Threaded mode things get a bit complicated the operation may have+-- been completed even before we even got around to put the request in the+-- waiting callback table. These events are handled by having a separate queue+-- for orphaned callback instances that the calling thread is supposed to check+-- before adding something to the work queue.+--+-- Thread safety: This function atomically replaces outstanding events with+-- a pointer to nullReq. This means it's safe (but potentially wastefull) to+-- have two concurrent or parallel invocations on the same array.+processCompletion :: Manager -> Int -> Maybe Seconds -> IO (Bool, Maybe Seconds)+processCompletion Manager{..} n delay = do+ -- If some completions are done, we need to process them and call their+ -- callbacks. We then remove the callbacks from the bookkeeping and resize+ -- the array if required.+ when (n > 0) $ do+ forM_ [0..(n-1)] $ \idx -> do+ oe <- A.unsafeRead mgrOverlappedEntries idx :: IO OVERLAPPED_ENTRY+ let lpol = lpOverlapped oe+ when (lpol /= nullPtr) $ do+ let hs_lpol = castPtr lpol :: Ptr FFI.HASKELL_OVERLAPPED+ let ptr_lpol = castPtr (hs_lpol `plusPtr` cdOffset) :: Ptr (Ptr CompletionData)+ cdDataCheck <- peek ptr_lpol+ oldDataPtr <- I.exchangePtr ptr_lpol nullReq :: IO (Ptr CompletionData)+ debugIO $ " $ checking " ++ show lpol+ ++ " -en ptr_lpol: " ++ show ptr_lpol+ ++ " offset: " ++ show cdOffset+ ++ " cdData: " ++ show cdDataCheck+ ++ " at idx " ++ show idx+ ptrd <- peek ptr_lpol+ debugIO $ ":: nullReq " ++ show nullReq+ debugIO $ ":: oldDataPtr " ++ show oldDataPtr+ debugIO $ ":: oldDataPtr (ptr)" ++ show ptrd+ -- A nullPtr indicates that we received a request which we shouldn't+ -- have. Essentially the field is 0 initialized and a nullPtr means+ -- it wasn't given a payload.+ -- A nullReq means that something else already handled the request,+ -- this can happen if for instance the request was cancelled.+ -- The former is an error while the latter is OK. For now we treat+ -- them both as the same, but external tools such as API monitor are+ -- used to distinguish between the two when doing API tracing.+ when (oldDataPtr /= nullPtr && oldDataPtr /= castPtr nullReq) $+ do debugIO $ "exchanged: " ++ show oldDataPtr+ payload <- peek oldDataPtr :: IO CompletionData+ let !cb = cdCallback payload+ reqs <- removeRequest+ debugIO $ "-1.. " ++ show reqs ++ " requests queued."+ status <- FFI.overlappedIOStatus (lpOverlapped oe)+ -- TODO: Remap between STATUS_ and ERROR_ instead+ -- of re-interpret here. But for now, don't care.+ let status' = fromIntegral status+ -- We no longer explicitly free the memory, this is because we+ -- now require the callback to free the memory since the+ -- callback allocated it. This allows us to simplify memory+ -- management and reduce bugs. See Note [Memory Management].+ let bytes = dwNumberOfBytesTransferred oe+ debugIO $ "?: status " ++ show status' ++ " - " ++ show bytes ++ " bytes return."+ cb status' bytes++ -- clear the array so we don't erroneously interpret the output, in+ -- certain circumstances like lockFileEx the code could return 1 entry+ -- removed but the file data not been filled in.+ -- TODO: Maybe not needed..+ A.clear mgrOverlappedEntries++ -- Check to see if we received the maximum amount of entries we could+ -- this likely indicates a high number of I/O requests have been queued.+ -- In which case we should process more at a time.+ cap <- A.capacity mgrOverlappedEntries+ when (cap == n) $ A.ensureCapacity mgrOverlappedEntries (2*cap)++ -- Keep running if we still have some work queued or+ -- if we have a pending delay.+ reqs <- outstandingRequests+ debugIO $ "outstanding requests: " ++ show reqs+ let more = reqs > 0+ debugIO $ "has more: " ++ show more ++ " - removed: " ++ show n+ return (more || (isJust delay && threadedIOMgr), delay)++-- | Entry point for the non-threaded I/O manager to be able to process+-- completed completions. It is mostly a wrapper around processCompletion+-- and invoked by the C thread via the scheduler.+processRemoteCompletion :: IO ()+processRemoteCompletion = do+#if defined(DEBUG) || defined(DEBUG_TRACE)+ tid <- myThreadId+ labelThread tid $ "IOManagerThread-PRC" ++ show tid+#endif+ alloca $ \ptr_n -> do+ debugIO "processRemoteCompletion :: start ()"+ -- First figure out how much work we have to do.+ entries <- getOverlappedEntries ptr_n+ n <- fromIntegral `fmap` peek ptr_n+ -- This call will unmarshal data from the C buffer but pointers inside of+ -- this have not been read yet.+ _ <- peekArray n entries+ mngr <- getSystemManager+ let arr = mgrOverlappedEntries mngr+ A.unsafeCopyFromBuffer arr entries n++ -- Process timeouts+ delay <- runExpiredTimeouts mngr :: IO (Maybe Seconds)++ -- Process available completions+ _ <- processCompletion mngr n delay++ -- Update and potentially wake up IO Manager+ -- This call will unblock the non-threaded I/O manager. After this it is no+ -- longer safe to use `entries` nor `completed` as they can now be modified+ -- by the C thread.+ registerAlertableWait delay++ debugIO "processRemoteCompletion :: done ()"+ return ()++registerAlertableWait :: Maybe Seconds -> IO ()+registerAlertableWait Nothing =+ c_registerAlertableWait False 0+registerAlertableWait (Just delay) =+ c_registerAlertableWait True (secondsToMilliSeconds delay)++-- | Event loop for the Threaded I/O manager. The one for the non-threaded+-- I/O manager is in AsyncWinIO.c in the rts.+io_mngr_loop :: HANDLE -> Manager -> IO ()+io_mngr_loop _event _mgr+ | not threadedIOMgr+ = do debugIO "io_mngr_loop:no-op:called in non-threaded case"+ return ()+io_mngr_loop _event mgr = go False+ where+ go maxDelay =+ do debugIO "io_mngr_loop:WinIORunning"+ -- Step will process IO events, or block if none are outstanding.+ (more, delay) <- step maxDelay mgr+ let !use_max_delay = not (isJust delay || more)+ debugIO "I/O manager stepping."+ event_id <- c_readIOManagerEvent+ exit <-+ case event_id of+ _ | event_id == io_MANAGER_WAKEUP -> return False+ _ | event_id == io_MANAGER_DIE -> return True+ 0 -> return False -- spurious wakeup+ _ -> do debugIO $ "handling console event: " ++ show (event_id `shiftR` 1)+ start_console_handler (event_id `shiftR` 1)+ return False++ -- If we have no more work to do, or something from the outside+ -- told us to stop then we let the thread die and stop the I/O+ -- manager. It will be woken up again when there is more to do.+ case () of+ _ | exit -> debugIO "I/O manager shutting down."+ _ -> go use_max_delay+++io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word32+io_MANAGER_WAKEUP = #{const IO_MANAGER_WAKEUP}+io_MANAGER_DIE = #{const IO_MANAGER_DIE}++-- | Wake up a single thread from the I/O Manager's worker queue. This will+-- unblock a thread blocked in `processCompletion` and allows the I/O manager to+-- react accordingly to changes in timers or to process console signals.+-- No-op if the io-manager is already running.+wakeupIOManager :: IO ()+wakeupIOManager+ = do mngr <- getSystemManager+ -- We don't care about the event handle here, only that it exists.+ _event <- c_getIOManagerEvent+ debugIO "waking up I/O manager."+ startIOManagerThread (io_mngr_loop (error "IOManagerEvent used") mngr)++-- | Returns the signaling event for the IO Manager.+foreign import ccall unsafe "getIOManagerEvent" -- in the RTS (ThrIOManager.c)+ c_getIOManagerEvent :: IO HANDLE++-- | Reads one IO Manager event. For WINIO we distinguish:+-- * Shutdown events, sent from the RTS+-- * Console events, sent from the default console handler.+-- * Wakeup events, which are not used by WINIO and will be ignored+foreign import ccall unsafe "readIOManagerEvent" -- in the RTS (ThrIOManager.c)+ c_readIOManagerEvent :: IO Word32++foreign import ccall unsafe "rtsSupportsBoundThreads" threadedIOMgr :: Bool++-- | Sleep for n ms+foreign import WINDOWS_CCONV unsafe "Sleep" sleepBlock :: Int -> IO ()++-- ---------------------------------------------------------------------------+-- I/O manager event notifications+++data HandleData = HandleData {+ tokenKey :: {-# UNPACK #-} !HandleKey+ , tokenEvents :: {-# UNPACK #-} !EventLifetime+ , _handleCallback :: !EventCallback+ }++-- | A file handle registration cookie.+data HandleKey = HandleKey {+ handleValue :: {-# UNPACK #-} !HANDLE+ , handleUnique :: {-# UNPACK #-} !Unique+ } deriving ( Eq -- ^ @since 4.4.0.0+ , Show -- ^ @since 4.4.0.0+ )++-- | Callback invoked on I/O events.+type EventCallback = HandleKey -> Event -> IO ()++registerHandle :: Manager -> EventCallback -> HANDLE -> Event -> Lifetime+ -> IO HandleKey+registerHandle (Manager{..}) cb hwnd evs lt = do+ u <- newUnique mgrUniqueSource+ let reg = HandleKey hwnd u+ hwnd' = fromIntegral $ ptrToIntPtr hwnd+ el = I.eventLifetime evs lt+ !hwdd = HandleData reg el cb+ event = EventData evs [(evs, hwdd)]+ _ <- withMVar mgrEvntHandlers $ \evts -> do+ IT.insertWith mappend hwnd' event evts+ wakeupIOManager+ return reg++unregisterHandle :: Manager -> HandleKey -> IO ()+unregisterHandle (Manager{..}) key@HandleKey{..} = do+ withMVar mgrEvntHandlers $ \evts -> do+ let hwnd' = fromIntegral $ ptrToIntPtr handleValue+ val <- IT.lookup hwnd' evts+ case val of+ Nothing -> return ()+ Just (EventData evs lst) -> do+ let cmp (_, a) (_, b) = tokenKey a == tokenKey b+ key' = (undefined, HandleData key undefined undefined)+ updated = deleteBy cmp key' lst+ new_lst = EventData evs updated+ _ <- IT.updateWith (\_ -> return new_lst) hwnd' evts+ return ()++-- ---------------------------------------------------------------------------+-- debugging++#if defined(DEBUG)+c_DEBUG_DUMP :: IO Bool+c_DEBUG_DUMP = return True -- scheduler `fmap` getDebugFlags+#endif++debugIO :: String -> IO ()+#if defined(DEBUG_TRACE)+debugIO s = traceEventIO ( "winIO :: " ++ s)+#elif defined(DEBUG)+debugIO s+ = do debug <- c_DEBUG_DUMP+ if debug+ then do tid <- myThreadId+ let pref = if threadedIOMgr then "\t" else ""+ _ <- withCStringLen (pref ++ "winio: " ++ s ++ " (" +++ showThreadId tid ++ ")\n") $+ \(p, len) -> c_write 2 (castPtr p) (fromIntegral len)+ return ()+ else do return ()+#else+debugIO _ = return ()+#endif++-- dbxIO :: String -> IO ()+-- dbxIO s = do tid <- myThreadId+-- let pref = if threadedIOMgr then "\t" else ""+-- _ <- withCStringLen (pref ++ "winio: " ++ s ++ " (" +++-- showThreadId tid ++ ")\n") $+-- \(p, len) -> c_write 2 (castPtr p) (fromIntegral len)+-- return ()
+ GHC/Event/Windows/Clock.hs view
@@ -0,0 +1,55 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE NoImplicitPrelude #-}+module GHC.Event.Windows.Clock (+ Clock,+ Seconds,+ getTime,+ getClock,++ -- * Specific implementations+ queryPerformanceCounter,+ getTickCount64+) where++import qualified GHC.Event.Windows.FFI as FFI++import Data.Maybe+import GHC.Base+import GHC.Real++-- | Monotonic clock+newtype Clock = Clock (IO Seconds)++type Seconds = Double++-- | Get the current time, in seconds since some fixed time in the past.+getTime :: Clock -> IO Seconds+getTime (Clock io) = io++-- | Figure out what time API to use, and return a 'Clock' for accessing it.+getClock :: IO Clock+getClock = tryInOrder+ [ queryPerformanceCounter+ , fmap Just getTickCount64+ ]++tryInOrder :: Monad m => [m (Maybe a)] -> m a+tryInOrder (x:xs) = x >>= maybe (tryInOrder xs) return+tryInOrder [] = undefined++mapJust :: Monad m => m (Maybe a) -> (a -> b) -> m (Maybe b)+mapJust m f = liftM (fmap f) m++queryPerformanceCounter :: IO (Maybe Clock)+queryPerformanceCounter =+ FFI.queryPerformanceFrequency `mapJust` \freq ->+ Clock $! do+ count <- FFI.queryPerformanceCounter+ let !secs = fromIntegral count / fromIntegral freq+ return secs++getTickCount64 :: IO Clock+getTickCount64 =+ return $! Clock $! do+ msecs <- FFI.getTickCount64+ return $! fromIntegral msecs / 1000
+ GHC/Event/Windows/ConsoleEvent.hsc view
@@ -0,0 +1,72 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.Event.Windows.ConsoleEvent+-- Copyright : (c) The University of Glasgow, 1994-2002+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC extensions)+--+-- Windows I/O manager interfaces. Depending on which I/O Subsystem is used+-- requests will be routed to different places.+--+-----------------------------------------------------------------------------++module GHC.Event.Windows.ConsoleEvent (+ ConsoleEvent (..),+ start_console_handler,+ toWin32ConsoleEvent,+ win32ConsoleHandler+) where++import GHC.Base+import GHC.Conc.Sync+import GHC.Enum (Enum)+import GHC.IO (unsafePerformIO)+import GHC.MVar+import GHC.Num (Num(..))+import GHC.Read (Read)+import GHC.Word (Word32)+import GHC.Show (Show)++#include <windows.h>++data ConsoleEvent+ = ControlC+ | Break+ | Close+ -- these are sent to Services only.+ | Logoff+ | Shutdown+ deriving ( Eq -- ^ @since 4.3.0.0+ , Ord -- ^ @since 4.3.0.0+ , Enum -- ^ @since 4.3.0.0+ , Show -- ^ @since 4.3.0.0+ , Read -- ^ @since 4.3.0.0+ )++start_console_handler :: Word32 -> IO ()+start_console_handler r =+ case toWin32ConsoleEvent r of+ Just x -> withMVar win32ConsoleHandler $ \handler -> do+ _ <- forkIO (handler x)+ return ()+ Nothing -> return ()++toWin32ConsoleEvent :: (Eq a, Num a) => a -> Maybe ConsoleEvent+toWin32ConsoleEvent ev =+ case ev of+ #{const CTRL_C_EVENT } -> Just ControlC+ #{const CTRL_BREAK_EVENT } -> Just Break+ #{const CTRL_CLOSE_EVENT } -> Just Close+ #{const CTRL_LOGOFF_EVENT } -> Just Logoff+ #{const CTRL_SHUTDOWN_EVENT } -> Just Shutdown+ _ -> Nothing++win32ConsoleHandler :: MVar (ConsoleEvent -> IO ())+win32ConsoleHandler =+ unsafePerformIO (newMVar (errorWithoutStackTrace "win32ConsoleHandler"))
+ GHC/Event/Windows/FFI.hsc view
@@ -0,0 +1,469 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NoImplicitPrelude #-}++-------------------------------------------------------------------------------+-- |+-- Module : GHC.Event.Windows.FFI+-- Copyright : (c) Tamar Christina 2019+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable+--+-- WinIO Windows API Foreign Function imports+--+-------------------------------------------------------------------------------++module GHC.Event.Windows.FFI (+ -- * IOCP+ IOCP(..),+ CompletionKey,+ newIOCP,+ associateHandleWithIOCP,+ getQueuedCompletionStatusEx,+ postQueuedCompletionStatus,+ getOverlappedResult,++ -- * Completion Data+ CompletionData(..),+ CompletionCallback,+ withRequest,++ -- * Overlapped+ OVERLAPPED,+ LPOVERLAPPED,+ OVERLAPPED_ENTRY(..),+ LPOVERLAPPED_ENTRY,+ HASKELL_OVERLAPPED,+ LPHASKELL_OVERLAPPED,+ allocOverlapped,+ zeroOverlapped,+ pokeOffsetOverlapped,+ overlappedIOStatus,+ overlappedIONumBytes,++ -- * Cancel pending I/O+ cancelIoEx,+ cancelIoEx',++ -- * Monotonic time++ -- ** GetTickCount+ getTickCount64,++ -- ** QueryPerformanceCounter+ queryPerformanceCounter,+ queryPerformanceFrequency,++ -- ** Miscellaneous+ throwWinErr,+ setLastError+) where++#include <ntstatus.h>+#include <windows.h>+#include "winio_structs.h"++##include "windows_cconv.h"++import Data.Maybe+import Foreign+import GHC.Base+import GHC.Num ((*))+import GHC.Real (fromIntegral)+import GHC.Show+import GHC.Windows+import qualified GHC.Event.Array as A+import qualified GHC.Windows as Win32+import GHC.IO.Handle.Internals (debugIO)++------------------------------------------------------------------------+-- IOCP++-- | An I/O completion port.+newtype IOCP = IOCP HANDLE+ deriving (Eq, Ord, Show)++type CompletionKey = ULONG_PTR++-- | This function has two distinct purposes depending on the value of+-- The completion port handle:+--+-- - When the IOCP port is NULL then the function creates a new I/O completion+-- port. See `newIOCP`.+--+-- - When The port contains a valid handle then the given handle is+-- associated with he given completion port handle. Once associated it+-- cannot be easily changed. Associating a Handle with a Completion Port+-- allows the I/O manager's worker threads to handle requests to the given+-- handle.+foreign import WINDOWS_CCONV unsafe "windows.h CreateIoCompletionPort"+ c_CreateIoCompletionPort :: HANDLE -> IOCP -> ULONG_PTR -> DWORD+ -> IO IOCP++-- | Create a new I/O completion port.+newIOCP :: IO IOCP+newIOCP = failIf (== IOCP nullPtr) "newIOCP" $+ c_CreateIoCompletionPort iNVALID_HANDLE_VALUE (IOCP nullPtr) 0 0++-- | Associate a HANDLE with an I/O completion port.+associateHandleWithIOCP :: IOCP -> HANDLE -> CompletionKey -> IO ()+associateHandleWithIOCP iocp handle completionKey =+ failIf_ (/= iocp) "associateHandleWithIOCP" $+ c_CreateIoCompletionPort handle iocp completionKey 0++foreign import WINDOWS_CCONV safe "windows.h GetOverlappedResult"+ c_GetOverlappedResult :: HANDLE -> LPOVERLAPPED -> Ptr DWORD -> BOOL+ -> IO BOOL++-- | Get the result of a single overlap operation without the IO manager+getOverlappedResult :: HANDLE -> Ptr OVERLAPPED -> BOOL -> IO (Maybe DWORD)+getOverlappedResult handle lp block+ = alloca $ \bytes ->+ do res <- c_GetOverlappedResult handle lp bytes block+ if res+ then fmap Just $ peek bytes+ else return Nothing++foreign import WINDOWS_CCONV safe "windows.h GetQueuedCompletionStatusEx"+ c_GetQueuedCompletionStatusEx :: IOCP -> LPOVERLAPPED_ENTRY -> Word32+ -> Ptr ULONG -> DWORD -> BOOL -> IO BOOL++-- | Note [Completion Ports]+-- When an I/O operation has been queued by an operation+-- (ReadFile/WriteFile/etc) it is placed in a queue that the driver uses when+-- servicing IRQs. This queue has some important properties:+--+-- 1.) It is not an ordered queue. Requests may be performed out of order as+-- as the OS's native I/O manager may try to re-order requests such that as+-- few random seeks as possible are needed to complete the pending+-- operations. As such do not assume a fixed order between something being+-- queued and dequeued.+--+-- 2.) Operations may skip the queue entirely. In which case they do not end in+-- in this function. (This is an optimization flag we have turned on. See+-- `openFile`.)+--+-- 3.) Across this call the specified OVERLAPPED_ENTRY buffer MUST remain live,+-- and the buffer for an I/O operation cannot be freed or moved until+-- `getOverlappedResult` says it's done. The reason is the kernel may not+-- have fully released the buffer, or finished writing to it when this+-- operation returns. Failure to adhere to this will cause your IRQs to be+-- silently dropped and your program will never receive a completion for it.+-- This means that the OVERLAPPED buffer must also remain valid for the+-- duration of the call and as such must be allocated on the unmanaged heap.+--+-- 4.) When a thread calls this method it is associated with the I/O manager's+-- worker threads pool. You should always use dedicated threads for this+-- since the OS I/O manager will now monitor the threads. If the thread+-- becomes blocked for whatever reason, the Haskell I/O manager will wake up+-- another threads from it's pool to service the remaining results.+-- A new thread will also be woken up from the pool when the previous thread+-- is busy servicing requests and new requests have finished. For this+-- reason the Haskell I/O manager multiplexes I/O operations from N haskell+-- threads into 1 completion port, which is serviced by M native threads in+-- an asynchronous method. This allows it to scale efficiently.+getQueuedCompletionStatusEx :: IOCP+ -> A.Array OVERLAPPED_ENTRY+ -> DWORD -- ^ Timeout in milliseconds (or+ -- 'GHC.Windows.iNFINITE')+ -> IO Int+getQueuedCompletionStatusEx iocp arr timeout =+ alloca $ \num_removed_ptr ->do+ A.unsafeLoad arr $ \oes cap -> do+ -- TODO: remove after debugging+ fillBytes oes 0 (cap * (sizeOf (undefined :: OVERLAPPED_ENTRY)))+ debugIO $ "-- call getQueuedCompletionStatusEx "+ -- don't block the call if the rts is not supporting threads.+ -- this would block the entire program.+ let alertable = False -- not rtsSupportsBoundThreads+ ok <- c_GetQueuedCompletionStatusEx iocp oes (fromIntegral cap)+ num_removed_ptr timeout alertable+ debugIO $ "-- call getQueuedCompletionStatusEx: " ++ show ok+ err <- getLastError+ nc <- (peek num_removed_ptr)+ debugIO $ "-- getQueuedCompletionStatusEx: n=" ++ show nc ++ " ,err=" ++ show err+ if ok then fromIntegral `fmap` peek num_removed_ptr+ else do debugIO $ "failed getQueuedCompletionStatusEx: " ++ show err+ if err == #{const WAIT_TIMEOUT} || alertable then return 0+ else failWith "GetQueuedCompletionStatusEx" err++overlappedIOStatus :: LPOVERLAPPED -> IO NTSTATUS+overlappedIOStatus lpol = do+ status <- #{peek OVERLAPPED, Internal} lpol+ -- TODO: Map NTSTATUS to ErrCode?+ -- See https://github.com/libuv/libuv/blob/b12624c13693c4d29ca84b3556eadc9e9c0936a4/src/win/winsock.c#L153+ return status+{-# INLINE overlappedIOStatus #-}++overlappedIONumBytes :: LPOVERLAPPED -> IO ULONG_PTR+overlappedIONumBytes lpol = do+ bytes <- #{peek OVERLAPPED, InternalHigh} lpol+ return bytes+{-# INLINE overlappedIONumBytes #-}++foreign import WINDOWS_CCONV unsafe "windows.h PostQueuedCompletionStatus"+ c_PostQueuedCompletionStatus :: IOCP -> DWORD -> ULONG_PTR -> LPOVERLAPPED+ -> IO BOOL++-- | Manually post a completion to the specified I/O port. This will wake up+-- a thread waiting `GetQueuedCompletionStatusEx`.+postQueuedCompletionStatus :: IOCP -> DWORD -> CompletionKey -> LPOVERLAPPED+ -> IO ()+postQueuedCompletionStatus iocp numBytes completionKey lpol =+ failIfFalse_ "PostQueuedCompletionStatus" $+ c_PostQueuedCompletionStatus iocp numBytes completionKey lpol++------------------------------------------------------------------------+-- Completion Data++-- | Called when the completion is delivered.+type CompletionCallback a = ErrCode -- ^ 0 indicates success+ -> DWORD -- ^ Number of bytes transferred+ -> IO a++-- | Callback type that will be called when an I/O operation completes.+type IOCallback = CompletionCallback ()++-- | Wrap the IOCallback type into a FunPtr.+foreign import ccall "wrapper"+ wrapIOCallback :: IOCallback -> IO (FunPtr IOCallback)++-- | Unwrap a FunPtr IOCallback to a normal Haskell function.+foreign import ccall "dynamic"+ mkIOCallback :: FunPtr IOCallback -> IOCallback++-- | Structure that the I/O manager uses to associate callbacks with+-- additional payload such as their OVERLAPPED structure and Win32 handle+-- etc. *Must* be kept in sync with that in `winio_structs.h` or horrible things+-- happen.+--+-- We keep the handle around for the benefit of ghc-external libraries making+-- use of the manager.+data CompletionData = CompletionData { cdHandle :: !HANDLE+ , cdCallback :: !IOCallback+ }++instance Storable CompletionData where+ sizeOf _ = #{size CompletionData}+ alignment _ = #{alignment CompletionData}++ peek ptr = do+ cdCallback <- mkIOCallback `fmap` #{peek CompletionData, cdCallback} ptr+ cdHandle <- #{peek CompletionData, cdHandle} ptr+ let !cd = CompletionData{..}+ return cd++ poke ptr CompletionData{..} = do+ cb <- wrapIOCallback cdCallback+ #{poke CompletionData, cdCallback} ptr cb+ #{poke CompletionData, cdHandle} ptr cdHandle++------------------------------------------------------------------------+-- Overlapped++-- | Tag type for @LPOVERLAPPED@.+data OVERLAPPED++-- | Tag type for the extended version of @OVERLAPPED@ containg some book+-- keeping information.+data HASKELL_OVERLAPPED++-- | Identifies an I/O operation. Used as the @LPOVERLAPPED@ parameter+-- for overlapped I/O functions (e.g. @ReadFile@, @WSASend@).+type LPOVERLAPPED = Ptr OVERLAPPED++-- | Pointer to the extended HASKELL_OVERLAPPED function.+type LPHASKELL_OVERLAPPED = Ptr HASKELL_OVERLAPPED++-- | An array of these is passed to GetQueuedCompletionStatusEx as an output+-- argument.+data OVERLAPPED_ENTRY = OVERLAPPED_ENTRY {+ lpCompletionKey :: ULONG_PTR,+ lpOverlapped :: LPOVERLAPPED,+ dwNumberOfBytesTransferred :: DWORD+ }++type LPOVERLAPPED_ENTRY = Ptr OVERLAPPED_ENTRY++instance Storable OVERLAPPED_ENTRY where+ sizeOf _ = #{size OVERLAPPED_ENTRY}+ alignment _ = #{alignment OVERLAPPED_ENTRY}++ peek ptr = do+ lpCompletionKey <- #{peek OVERLAPPED_ENTRY, lpCompletionKey} ptr+ lpOverlapped <- #{peek OVERLAPPED_ENTRY, lpOverlapped} ptr+ dwNumberOfBytesTransferred <-+ #{peek OVERLAPPED_ENTRY, dwNumberOfBytesTransferred} ptr+ let !oe = OVERLAPPED_ENTRY{..}+ return oe++ poke ptr OVERLAPPED_ENTRY{..} = do+ #{poke OVERLAPPED_ENTRY, lpCompletionKey} ptr lpCompletionKey+ #{poke OVERLAPPED_ENTRY, lpOverlapped} ptr lpOverlapped+ #{poke OVERLAPPED_ENTRY, dwNumberOfBytesTransferred}+ ptr dwNumberOfBytesTransferred++-- | Allocate a new+-- <http://msdn.microsoft.com/en-us/library/windows/desktop/ms684342%28v=vs.85%29.aspx+-- OVERLAPPED> structure on the unmanaged heap. This also zeros the memory to+-- prevent the values inside the struct to be incorrectlt interpreted as data+-- payload.+--+-- We extend the overlapped structure with some extra book keeping information+-- such that we don't have to do a lookup on the Haskell side.+--+-- Future: We can gain some performance here by using a pool instead of calling+-- malloc for each request. A simple block allocator would be very+-- useful here, especially when we implement sockets support.+allocOverlapped :: Word64 -- ^ Offset/OffsetHigh+ -> IO (Ptr HASKELL_OVERLAPPED)+allocOverlapped offset = do+ lpol <- mallocBytes #{size HASKELL_OVERLAPPED}+ zeroOverlapped lpol+ pokeOffsetOverlapped (castPtr lpol) offset+ return lpol++-- | Zero-fill an HASKELL_OVERLAPPED structure.+zeroOverlapped :: LPHASKELL_OVERLAPPED -> IO ()+zeroOverlapped lpol = fillBytes lpol 0 #{size HASKELL_OVERLAPPED}+{-# INLINE zeroOverlapped #-}++-- | Set the offset field in an OVERLAPPED structure.+pokeOffsetOverlapped :: LPOVERLAPPED -> Word64 -> IO ()+pokeOffsetOverlapped lpol offset = do+ let (offsetHigh, offsetLow) = Win32.ddwordToDwords offset+ #{poke OVERLAPPED, Offset} lpol offsetLow+ #{poke OVERLAPPED, OffsetHigh} lpol offsetHigh+{-# INLINE pokeOffsetOverlapped #-}++------------------------------------------------------------------------+-- Request management++withRequest :: Word64 -> CompletionData+ -> (Ptr HASKELL_OVERLAPPED -> Ptr CompletionData -> IO a)+ -> IO a+withRequest offset cbData f =+ -- Create the completion record and store it.+ -- We only need the record when we enqueue a request, however if we+ -- delay creating it then we will run into a race condition where the+ -- driver may have finished servicing the request before we were ready+ -- and so the request won't have the book keeping information to know+ -- what to do. So because of that we always create the payload, If we+ -- need it ok, if we don't that's no problem. This approach prevents+ -- expensive lookups in hash-tables.+ --+ -- Todo: Use a memory pool for this so we don't have to hit malloc every+ -- time. This would allow us to scale better.+ allocaBytes #{size HASKELL_OVERLAPPED} $ \hs_lpol ->+ with cbData $ \cdData -> do+ zeroOverlapped hs_lpol+ pokeOffsetOverlapped (castPtr hs_lpol) offset+ f hs_lpol cdData++------------------------------------------------------------------------+-- Cancel pending I/O++-- | CancelIo shouldn't block, but cancellation happens infrequently,+-- so we might as well be on the safe side.+foreign import WINDOWS_CCONV unsafe "windows.h CancelIoEx"+ c_CancelIoEx :: HANDLE -> LPOVERLAPPED -> IO BOOL++-- | Cancel all pending overlapped I/O for the given file that was initiated by+-- the current OS thread. Cancelling is just a request for cancellation and+-- before the OVERLAPPED struct is freed we must make sure that the IRQ has been+-- removed from the queue. See `getOverlappedResult`.+cancelIoEx :: HANDLE -> LPOVERLAPPED -> IO ()+cancelIoEx h o = failIfFalse_ "CancelIoEx" . c_CancelIoEx h $ o++cancelIoEx' :: HANDLE -> LPOVERLAPPED -> IO Bool+cancelIoEx' = c_CancelIoEx++------------------------------------------------------------------------+-- Monotonic time++foreign import WINDOWS_CCONV "windows.h GetTickCount64"+ c_GetTickCount64 :: IO #{type ULONGLONG}++-- | Call the @GetTickCount64@ function, which returns a monotonic time in+-- milliseconds.+--+-- Problems:+--+-- * Low resolution (10 to 16 milliseconds).+--+-- <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx>+getTickCount64 :: IO Word64+getTickCount64 = c_GetTickCount64++-- | Call the @QueryPerformanceCounter@ function.+--+-- Problems:+--+-- * Might not be available on some hardware. Use 'queryPerformanceFrequency'+-- to test for availability before calling this function.+--+-- * On a multiprocessor computer, may produce different results on+-- different processors due to hardware bugs.+--+-- To get a monotonic time in seconds, divide the result of+-- 'queryPerformanceCounter' by that of 'queryPerformanceFrequency'.+--+-- <http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904%28v=vs.85%29.aspx>+queryPerformanceCounter :: IO Int64+queryPerformanceCounter =+ callQP c_QueryPerformanceCounter+ >>= maybe (throwGetLastError "QueryPerformanceCounter") return++-- | Call the @QueryPerformanceFrequency@ function. Return 'Nothing' if the+-- hardware does not provide a high-resolution performance counter.+--+-- <http://msdn.microsoft.com/en-us/library/windows/desktop/ms644905%28v=vs.85%29.aspx>+queryPerformanceFrequency :: IO (Maybe Int64)+queryPerformanceFrequency = do+ m <- callQP c_QueryPerformanceFrequency+ case m of+ Nothing -> return Nothing+ Just 0 -> return Nothing -- Shouldn't happen; just a safeguard to+ -- avoid a zero denominator.+ Just freq -> return (Just freq)++type QPFunc = Ptr Int64 -> IO BOOL++foreign import WINDOWS_CCONV "Windows.h QueryPerformanceCounter"+ c_QueryPerformanceCounter :: QPFunc++foreign import WINDOWS_CCONV "Windows.h QueryPerformanceFrequency"+ c_QueryPerformanceFrequency :: QPFunc++callQP :: QPFunc -> IO (Maybe Int64)+callQP qpfunc =+ allocaBytes #{size LARGE_INTEGER} $ \ptr -> do+ ok <- qpfunc ptr+ if ok then do+ n <- #{peek LARGE_INTEGER, QuadPart} ptr+ return (Just n)+ else+ return Nothing++------------------------------------------------------------------------+-- Miscellaneous++type ULONG_PTR = #type ULONG_PTR++throwWinErr :: String -> ErrCode -> IO a+throwWinErr loc err = do+ c_SetLastError err+ Win32.failWith loc err++setLastError :: ErrCode -> IO ()+setLastError = c_SetLastError++foreign import WINDOWS_CCONV unsafe "windows.h SetLastError"+ c_SetLastError :: ErrCode -> IO ()
+ GHC/Event/Windows/ManagedThreadPool.hs view
@@ -0,0 +1,93 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NoImplicitPrelude #-}++-------------------------------------------------------------------------------+-- |+-- Module : GHC.Event.Windows.ManagedThreadPool+-- Copyright : (c) Tamar Christina 2019+-- License : BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer : libraries@haskell.org+-- Stability : experimental+-- Portability : non-portable+--+-- WinIO Windows Managed Thread pool API. This thread pool scales dynamically+-- based on demand.+--+-------------------------------------------------------------------------------++module GHC.Event.Windows.ManagedThreadPool+ ( ThreadPool(..)+ , startThreadPool+ , notifyRunning+ , notifyWaiting+ , monitorThreadPool+ ) where++import Control.Concurrent.MVar+import Data.Maybe+import Foreign+import GHC.Base+import GHC.Num ((-), (+))+import GHC.Real (fromIntegral)+import qualified GHC.Event.Array as A+import GHC.IO.Handle.Internals (debugIO)+import GHC.Conc.Sync (ThreadId(..))+import GHC.RTS.Flags++------------------------------------------------------------------------+-- Thread spool manager++type WorkerJob = IO ()++-- | Thread pool manager state+data ThreadPool = ThreadPool+ { thrMainThread :: Maybe ThreadId+ , thrMaxThreads :: {-# UNPACK #-} !Int+ , thrMinThreads :: {-# UNPACK #-} !Int+ , thrCurThreads :: {-# UNPACK #-} !Int+ , thrCallBack :: WorkerJob+ , thrActiveThreads :: MVar Int+ , thrMonitor :: MVar ()+ , thrThreadIds :: {-#UNPACK #-} !(A.Array ThreadId)+ }++startThreadPool :: WorkerJob -> IO ThreadPool+startThreadPool job = do+ debugIO "Starting I/O manager threadpool..."+ let thrMinThreads = 2+ let thrCurThreads = 0+ let thrCallBack = job+ thrMaxThreads <- (fromIntegral . numIoWorkerThreads) `fmap` getMiscFlags+ thrActiveThreads <- newMVar 0+ thrMonitor <- newEmptyMVar+ thrThreadIds <- undefined -- A.new thrMaxThreads+ let thrMainThread = Nothing++ let !pool = ThreadPool{..}+ return pool++monitorThreadPool :: MVar () -> IO ()+monitorThreadPool monitor = do+ _active <- takeMVar monitor++ return ()++notifyRunning :: Maybe ThreadPool -> IO ()+notifyRunning Nothing = return ()+notifyRunning (Just pool) = do+ modifyMVar_ (thrActiveThreads pool) (\x -> return $ x + 1)+ _ <- tryPutMVar (thrMonitor pool) ()+ return ()++notifyWaiting :: Maybe ThreadPool -> IO ()+notifyWaiting Nothing = return ()+notifyWaiting (Just pool) = do+ modifyMVar_ (thrActiveThreads pool) (\x -> return $ x - 1)+ _ <- tryPutMVar (thrMonitor pool) ()+ return ()
+ GHC/Event/Windows/Thread.hs view
@@ -0,0 +1,35 @@+{-# LANGUAGE NoImplicitPrelude #-}++module GHC.Event.Windows.Thread (+ ensureIOManagerIsRunning,+ interruptIOManager,+ threadDelay,+ registerDelay,+) where++import GHC.Conc.Sync+import GHC.Base+import GHC.Event.Windows+import GHC.IO+import GHC.IOPort++ensureIOManagerIsRunning :: IO ()+ensureIOManagerIsRunning = wakeupIOManager++interruptIOManager :: IO ()+interruptIOManager = interruptSystemManager++threadDelay :: Int -> IO ()+threadDelay usecs = mask_ $ do+ m <- newEmptyIOPort+ mgr <- getSystemManager+ reg <- registerTimeout mgr usecs $ writeIOPort m () >> return ()+ readIOPort m `onException` unregisterTimeout mgr reg++registerDelay :: Int -> IO (TVar Bool)+registerDelay usecs = do+ t <- newTVarIO False+ mgr <- getSystemManager+ _ <- registerTimeout mgr usecs $ atomically $ writeTVar t True+ return t+
GHC/ExecutionStack/Internal.hsc view
@@ -150,7 +150,7 @@ unknown symbols). I think this is a reasonable price to pay, however, as module loading/unloading is a rather rare event. - Morover, we stand to gain a great deal by lazy lookups as the stack frames+ Moreover, we stand to gain a great deal by lazy lookups as the stack frames may never even be requested, meaning the only effort wasted is the collection of the stack frames themselves.
GHC/Exts.hs view
@@ -2,6 +2,8 @@ {-# LANGUAGE MagicHash, UnboxedTuples, TypeFamilies, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, NoImplicitPrelude #-} +{-# OPTIONS_HADDOCK not-home #-}+ ----------------------------------------------------------------------------- -- | -- Module : GHC.Exts@@ -28,6 +30,7 @@ maxTupleSize, -- * Primitive operations+ FUN, -- See https://gitlab.haskell.org/ghc/ghc/issues/18302 module GHC.Prim, module GHC.Prim.Ext, shiftL#, shiftRL#, iShiftL#, iShiftRA#, iShiftRL#,@@ -52,11 +55,19 @@ -- * Overloaded string literals IsString(..), + -- * CString+ unpackCString#,+ unpackAppendCString#,+ unpackFoldrCString#,+ unpackCStringUtf8#,+ unpackNBytes#,+ cstringLength#,+ -- * Debugging breakpoint, breakpointCond, -- * Ids with special behaviour- lazy, inline, oneShot,+ inline, noinline, lazy, oneShot, SPEC (..), -- * Running 'RealWorld' state thread runRW#,@@ -68,6 +79,9 @@ -- @since 4.7.0.0 Data.Coerce.coerce, Data.Coerce.Coercible, + -- * Very unsafe coercion+ unsafeCoerce#,+ -- * Equality type (~~), @@ -112,6 +126,7 @@ import Data.Ord import Data.Version ( Version(..), makeVersion ) import qualified Debug.Trace+import Unsafe.Coerce ( unsafeCoerce# ) -- just for re-export import Control.Applicative (ZipList(..)) @@ -193,11 +208,12 @@ -- list of @Item l@ fromList :: [Item l] -> l - -- | The 'fromListN' function takes the input list's length as a hint. Its- -- behaviour should be equivalent to 'fromList'. The hint can be used to- -- construct the structure @l@ more efficiently compared to 'fromList'. If- -- the given hint does not equal to the input list's length the behaviour of- -- 'fromListN' is not specified.+ -- | The 'fromListN' function takes the input list's length and potentially+ -- uses it to construct the structure @l@ more efficiently compared to + -- 'fromList'. If the given number does not equal to the input list's length + -- the behaviour of 'fromListN' is not specified.+ --+ -- prop> fromListN (length xs) xs == fromList xs fromListN :: Int -> [Item l] -> l fromListN _ = fromList
GHC/Float.hs view
@@ -11,6 +11,7 @@ -- around, but we haven't got there yet: {-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_HADDOCK not-home #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} ----------------------------------------------------------------------------- -- |@@ -31,6 +32,17 @@ #include "ieee-flpt.h" #include "MachDeps.h" +#if WORD_SIZE_IN_BITS == 32+# define WSHIFT 5+# define MMASK 31+#elif WORD_SIZE_IN_BITS == 64+# define WSHIFT 6+# define MMASK 63+#else+# error unsupported WORD_SIZE_IN_BITS+#endif++ module GHC.Float ( module GHC.Float , Float(..), Double(..), Float#, Double#@@ -54,11 +66,13 @@ import GHC.Arr import GHC.Float.RealFracMethods import GHC.Float.ConversionUtils-import GHC.Integer.Logarithms ( integerLogBase# )-import GHC.Integer.Logarithms.Internals+import GHC.Num.BigNat infixr 8 ** +-- $setup+-- >>> import Prelude+ ------------------------------------------------------------------------ -- Standard numeric classes ------------------------------------------------------------------------@@ -237,7 +251,7 @@ -- to wrong results, hence we clamp the -- scaling parameter. -- If n + k would be larger than h,- -- n + clamp b k must be too, simliar+ -- n + clamp b k must be too, similar -- for smaller than l - d. -- Add a little extra to keep clear -- from the boundary cases.@@ -283,7 +297,7 @@ | otherwise = x -- handles 0.0, (-0.0), and NaN {-# INLINE fromInteger #-}- fromInteger i = F# (floatFromInteger i)+ fromInteger i = F# (integerToFloat# i) -- | @since 2.01 instance Real Float where@@ -291,12 +305,12 @@ case decodeFloat_Int# x# of (# m#, e# #) | isTrue# (e# >=# 0#) ->- (smallInteger m# `shiftLInteger` e#) :% 1+ (IS m# `integerShiftL#` int2Word# e#) :% 1 | isTrue# ((int2Word# m# `and#` 1##) `eqWord#` 0##) -> case elimZerosInt# m# (negateInt# e#) of- (# n, d# #) -> n :% shiftLInteger 1 d#+ (# n, d# #) -> n :% integerShiftL# 1 (int2Word# d#) | otherwise ->- smallInteger m# :% shiftLInteger 1 (negateInt# e#)+ IS m# :% integerShiftL# 1 (int2Word# (negateInt# e#)) -- | @since 2.01 -- Note that due to the presence of @NaN@, not all elements of 'Float' have an@@ -421,9 +435,9 @@ floatRange _ = (FLT_MIN_EXP, FLT_MAX_EXP) -- ditto decodeFloat (F# f#) = case decodeFloat_Int# f# of- (# i, e #) -> (smallInteger i, I# e)+ (# i, e #) -> (IS i, I# e) - encodeFloat i (I# e) = F# (encodeFloatInteger i e)+ encodeFloat i (I# e) = F# (integerEncodeFloat# i e) exponent x = case decodeFloat x of (m,n) -> if m == 0 then 0 else n + floatDigits x@@ -478,21 +492,21 @@ {-# INLINE fromInteger #-}- fromInteger i = D# (doubleFromInteger i)+ fromInteger i = D# (integerToDouble# i) -- | @since 2.01 instance Real Double where toRational (D# x#) =- case decodeDoubleInteger x# of+ case integerDecodeDouble# x# of (# m, e# #) | isTrue# (e# >=# 0#) ->- shiftLInteger m e# :% 1- | isTrue# ((integerToWord m `and#` 1##) `eqWord#` 0##) ->+ integerShiftL# m (int2Word# e#) :% 1+ | isTrue# ((integerToWord# m `and#` 1##) `eqWord#` 0##) -> case elimZerosInteger m (negateInt# e#) of- (# n, d# #) -> n :% shiftLInteger 1 d#+ (# n, d# #) -> n :% integerShiftL# 1 (int2Word# d#) | otherwise ->- m :% shiftLInteger 1 (negateInt# e#)+ m :% integerShiftL# 1 (int2Word# (negateInt# e#)) -- | @since 2.01 -- Note that due to the presence of @NaN@, not all elements of 'Double' have an@@ -610,10 +624,10 @@ floatRange _ = (DBL_MIN_EXP, DBL_MAX_EXP) -- ditto decodeFloat (D# x#)- = case decodeDoubleInteger x# of+ = case integerDecodeDouble# x# of (# i, j #) -> (i, I# j) - encodeFloat i (I# j) = D# (encodeDoubleInteger i j)+ encodeFloat i (I# j) = D# (integerEncodeDouble# i j) exponent x = case decodeFloat x of (m,n) -> if m == 0 then 0 else n + floatDigits x@@ -994,7 +1008,9 @@ (minExp0, _) = floatRange r minExp = minExp0 - p -- the real minimum exponent xMax = toRational (expt b p)- p0 = (integerLogBase b (numerator x) - integerLogBase b (denominator x) - p) `max` minExp+ ln = I# (word2Int# (integerLogBase# b (numerator x)))+ ld = I# (word2Int# (integerLogBase# b (denominator x)))+ p0 = (ln - ld - p) `max` minExp -- if x = n/d and ln = integerLogBase b n, ld = integerLogBase b d, -- then b^(ln-ld-1) < x < b^(ln-ld+1) f = if p0 < 0 then 1 :% expt b (-p0) else expt b p0 :% 1@@ -1028,18 +1044,6 @@ expts10 :: Array Int Integer expts10 = array (minExpt,maxExpt10) [(n,10^n) | n <- [minExpt .. maxExpt10]] --- Compute the (floor of the) log of i in base b.--- Simplest way would be just divide i by b until it's smaller then b, but that would--- be very slow! We are just slightly more clever, except for base 2, where--- we take advantage of the representation of Integers.--- The general case could be improved by a lookup table for--- approximating the result by integerLog2 i / integerLog2 b.-integerLogBase :: Integer -> Integer -> Int-integerLogBase b i- | i < b = 0- | b == 2 = I# (integerLog2# i)- | otherwise = I# (integerLogBase# b i)- {- Unfortunately, the old conversion code was awfully slow due to a) a slow integer logarithm@@ -1060,10 +1064,10 @@ fromRat'' :: RealFloat a => Int -> Int -> Integer -> Integer -> a -- Invariant: n and d strictly positive fromRat'' minEx@(I# me#) mantDigs@(I# md#) n d =- case integerLog2IsPowerOf2# d of- (# ld#, pw# #)- | isTrue# (pw# ==# 0#) ->- case integerLog2# n of+ case integerIsPowerOf2# d of+ (# | ldw# #) ->+ let ld# = word2Int# ldw#+ in case word2Int# (integerLog2# n) of ln# | isTrue# (ln# >=# (ld# +# me# -# 1#)) -> -- this means n/d >= 2^(minEx-1), i.e. we are guaranteed to get -- a normalised number, round to mantDigs bits@@ -1094,12 +1098,12 @@ _ -> encodeFloat (n' + 1) (minEx-mantDigs) | isTrue# (ld'# ># (ln# +# 1#)) -> encodeFloat 0 0 -- result of shift < 0.5 | otherwise -> -- first bit of n shifted to 0.5 place- case integerLog2IsPowerOf2# n of- (# _, 0# #) -> encodeFloat 0 0 -- round to even- (# _, _ #) -> encodeFloat 1 (minEx - mantDigs)- | otherwise ->- let ln = I# (integerLog2# n)- ld = I# ld#+ case integerIsPowerOf2# n of+ (# | _ #) -> encodeFloat 0 0 -- round to even+ (# (# #) | #) -> encodeFloat 1 (minEx - mantDigs)+ (# (# #) | #) ->+ let ln = I# (word2Int# (integerLog2# n))+ ld = I# (word2Int# (integerLog2# d)) -- 2^(ln-ld-1) < n/d < 2^(ln-ld+1) p0 = max minEx (ln - ld) (n', d')@@ -1122,6 +1126,46 @@ GT -> q+1 in encodeFloat rdq p' +-- Assumption: Integer and Int# are strictly positive, Int# is less+-- than logBase 2 of Integer, otherwise havoc ensues.+-- Used only for the numerator in fromRational when the denominator+-- is a power of 2.+-- The Int# argument is log2 n minus the number of bits in the mantissa+-- of the target type, i.e. the index of the first non-integral bit in+-- the quotient.+--+-- 0# means round down (towards zero)+-- 1# means we have a half-integer, round to even+-- 2# means round up (away from zero)+roundingMode# :: Integer -> Int# -> Int#+roundingMode# (IS i#) t =+ let+ k = int2Word# i# `and#` ((uncheckedShiftL# 2## t) `minusWord#` 1##)+ c = uncheckedShiftL# 1## t+ in if isTrue# (c `gtWord#` k)+ then 0#+ else if isTrue# (c `ltWord#` k)+ then 2#+ else 1#++roundingMode# (IN bn) t = roundingMode# (IP bn) t -- dummy+roundingMode# (IP bn) t =+ let+ j = word2Int# (int2Word# t `and#` MMASK##) -- index of relevant bit in word+ k = uncheckedIShiftRA# t WSHIFT# -- index of relevant word+ r = bigNatIndex# bn k `and#` ((uncheckedShiftL# 2## j) `minusWord#` 1##)+ c = uncheckedShiftL# 1## j+ test i = if isTrue# (i <# 0#)+ then 1#+ else case bigNatIndex# bn i of+ 0## -> test (i -# 1#)+ _ -> 2#+ in if isTrue# (c `gtWord#` r)+ then 0#+ else if isTrue# (c `ltWord#` r)+ then 2#+ else test (k -# 1#)+ ------------------------------------------------------------------------ -- Floating point numeric primops ------------------------------------------------------------------------@@ -1262,7 +1306,7 @@ {- Note [realToFrac int-to-float] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-Don found that the RULES for realToFrac/Int->Double and simliarly+Don found that the RULES for realToFrac/Int->Double and similarly Float made a huge difference to some stream-fusion programs. Here's an example
GHC/Float/ConversionUtils.hs view
@@ -22,7 +22,7 @@ module GHC.Float.ConversionUtils ( elimZerosInteger, elimZerosInt# ) where import GHC.Base-import GHC.Integer+import GHC.Num.Integer #if WORD_SIZE_IN_BITS < 64 import GHC.IntWord64 #endif@@ -31,7 +31,7 @@ #if WORD_SIZE_IN_BITS < 64 -#define TO64 integerToInt64+#define TO64 integerToInt64# toByte64# :: Int64# -> Int# toByte64# i = word2Int# (and# 255## (int2Word# (int64ToInt# i)))@@ -40,13 +40,13 @@ elim64# :: Int64# -> Int# -> (# Integer, Int# #) elim64# n e = case zeroCount (toByte64# n) of- t | isTrue# (e <=# t) -> (# int64ToInteger (uncheckedIShiftRA64# n e), 0# #)- | isTrue# (t <# 8#) -> (# int64ToInteger (uncheckedIShiftRA64# n t), e -# t #)+ t | isTrue# (e <=# t) -> (# integerFromInt64# (uncheckedIShiftRA64# n e), 0# #)+ | isTrue# (t <# 8#) -> (# integerFromInt64# (uncheckedIShiftRA64# n t), e -# t #) | otherwise -> elim64# (uncheckedIShiftRA64# n 8#) (e -# 8#) #else -#define TO64 integerToInt+#define TO64 integerToInt# -- Double mantissae fit it Int# elim64# :: Int# -> Int# -> (# Integer, Int# #)@@ -61,8 +61,8 @@ elimZerosInt# :: Int# -> Int# -> (# Integer, Int# #) elimZerosInt# n e = case zeroCount (toByte# n) of- t | isTrue# (e <=# t) -> (# smallInteger (uncheckedIShiftRA# n e), 0# #)- | isTrue# (t <# 8#) -> (# smallInteger (uncheckedIShiftRA# n t), e -# t #)+ t | isTrue# (e <=# t) -> (# IS (uncheckedIShiftRA# n e), 0# #)+ | isTrue# (t <# 8#) -> (# IS (uncheckedIShiftRA# n t), e -# t #) | otherwise -> elimZerosInt# (uncheckedIShiftRA# n 8#) (e -# 8#) {-# INLINE zeroCount #-}
GHC/Float/RealFracMethods.hs view
@@ -54,7 +54,7 @@ , int2Float ) where -import GHC.Integer+import GHC.Num.Integer import GHC.Base import GHC.Num ()@@ -63,15 +63,15 @@ import GHC.IntWord64 -#define TO64 integerToInt64-#define FROM64 int64ToInteger+#define TO64 integerToInt64#+#define FROM64 integerFromInt64# #define MINUS64 minusInt64# #define NEGATE64 negateInt64# #else -#define TO64 integerToInt-#define FROM64 smallInteger+#define TO64 integerToInt#+#define FROM64 IS #define MINUS64 ( -# ) #define NEGATE64 negateInt# @@ -140,15 +140,15 @@ s | isTrue# (s ># 23#) -> (0, v) | isTrue# (m <# 0#) -> case negateInt# (negateInt# m `uncheckedIShiftRA#` s) of- k -> (smallInteger k,+ k -> (IS k, case m -# (k `uncheckedIShiftL#` s) of- r -> F# (encodeFloatInteger (smallInteger r) e))+ r -> F# (integerEncodeFloat# (IS r) e)) | otherwise -> case m `uncheckedIShiftRL#` s of- k -> (smallInteger k,+ k -> (IS k, case m -# (k `uncheckedIShiftL#` s) of- r -> F# (encodeFloatInteger (smallInteger r) e))- | otherwise -> (shiftLInteger (smallInteger m) e, F# 0.0#)+ r -> F# (integerEncodeFloat# (IS r) e))+ | otherwise -> (integerShiftL# (IS m) (int2Word# e), F# 0.0#) {-# INLINE truncateFloatInteger #-} truncateFloatInteger :: Float -> Integer@@ -166,8 +166,8 @@ | isTrue# (e <# 0#) -> case negateInt# e of s | isTrue# (s ># 23#) -> if isTrue# (m <# 0#) then (-1) else 0- | otherwise -> smallInteger (m `uncheckedIShiftRA#` s)- | otherwise -> shiftLInteger (smallInteger m) e+ | otherwise -> IS (m `uncheckedIShiftRA#` s)+ | otherwise -> integerShiftL# (IS m) (int2Word# e) -- ceiling x = -floor (-x) -- If giving this its own implementation is faster at all,@@ -175,7 +175,7 @@ {-# INLINE ceilingFloatInteger #-} ceilingFloatInteger :: Float -> Integer ceilingFloatInteger (F# x) =- negateInteger (floorFloatInteger (F# (negateFloat# x)))+ integerNegate (floorFloatInteger (F# (negateFloat# x))) {-# INLINE roundFloatInteger #-} roundFloatInteger :: Float -> Integer@@ -231,28 +231,28 @@ {-# INLINE properFractionDoubleInteger #-} properFractionDoubleInteger :: Double -> (Integer, Double) properFractionDoubleInteger v@(D# x) =- case decodeDoubleInteger x of+ case integerDecodeDouble# x of (# m, e #) | isTrue# (e <# 0#) -> case negateInt# e of s | isTrue# (s ># 52#) -> (0, v) | m < 0 ->- case TO64 (negateInteger m) of+ case TO64 (integerNegate m) of n -> case n `uncheckedIShiftRA64#` s of k -> (FROM64 (NEGATE64 k), case MINUS64 n (k `uncheckedIShiftL64#` s) of r ->- D# (encodeDoubleInteger (FROM64 (NEGATE64 r)) e))+ D# (integerEncodeDouble# (FROM64 (NEGATE64 r)) e)) | otherwise -> case TO64 m of n -> case n `uncheckedIShiftRA64#` s of k -> (FROM64 k, case MINUS64 n (k `uncheckedIShiftL64#` s) of- r -> D# (encodeDoubleInteger (FROM64 r) e))- | otherwise -> (shiftLInteger m e, D# 0.0##)+ r -> D# (integerEncodeDouble# (FROM64 r) e))+ | otherwise -> (integerShiftL# m (int2Word# e), D# 0.0##) {-# INLINE truncateDoubleInteger #-} truncateDoubleInteger :: Double -> Integer@@ -265,7 +265,7 @@ {-# INLINE floorDoubleInteger #-} floorDoubleInteger :: Double -> Integer floorDoubleInteger (D# x) =- case decodeDoubleInteger x of+ case integerDecodeDouble# x of (# m, e #) | isTrue# (e <# 0#) -> case negateInt# e of@@ -273,12 +273,12 @@ | otherwise -> case TO64 m of n -> FROM64 (n `uncheckedIShiftRA64#` s)- | otherwise -> shiftLInteger m e+ | otherwise -> integerShiftL# m (int2Word# e) {-# INLINE ceilingDoubleInteger #-} ceilingDoubleInteger :: Double -> Integer ceilingDoubleInteger (D# x) =- negateInteger (floorDoubleInteger (D# (negateDouble# x)))+ integerNegate (floorDoubleInteger (D# (negateDouble# x))) {-# INLINE roundDoubleInteger #-} roundDoubleInteger :: Double -> Integer@@ -305,25 +305,25 @@ -- -- Note: Since the value is integral, the exponent can't be less than -- (-TYP_MANT_DIG), so we need not check the validity of the shift--- distance for the right shfts here.+-- distance for the right shifts here. {-# INLINE double2Integer #-} double2Integer :: Double -> Integer double2Integer (D# x) =- case decodeDoubleInteger x of+ case integerDecodeDouble# x of (# m, e #) | isTrue# (e <# 0#) -> case TO64 m of n -> FROM64 (n `uncheckedIShiftRA64#` negateInt# e)- | otherwise -> shiftLInteger m e+ | otherwise -> integerShiftL# m (int2Word# e) {-# INLINE float2Integer #-} float2Integer :: Float -> Integer float2Integer (F# x) = case decodeFloat_Int# x of (# m, e #)- | isTrue# (e <# 0#) -> smallInteger (m `uncheckedIShiftRA#` negateInt# e)- | otherwise -> shiftLInteger (smallInteger m) e+ | isTrue# (e <# 0#) -> IS (m `uncheckedIShiftRA#` negateInt# e)+ | otherwise -> integerShiftL# (IS m) (int2Word# e) -- Foreign imports, the rounding is done faster in C when the value -- isn't integral, so we call out for rounding. For values of large
GHC/Foreign.hs view
@@ -233,23 +233,14 @@ let go !iteration to_sz_bytes = do putDebugMsg ("withEncodedCString: " ++ show iteration) allocaBytes to_sz_bytes $ \to_p -> do- -- See Note [Check *before* fill in withEncodedCString] about why- -- this is subtle.- mb_res <- tryFillBuffer encoder null_terminate from to_p to_sz_bytes+ mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes act case mb_res of Nothing -> go (iteration + 1) (to_sz_bytes * 2)- Just to_buf -> withCStringBuffer to_buf null_terminate act+ Just res -> return res -- If the input string is ASCII, this value will ensure we only allocate once go (0 :: Int) (cCharSize * (sz + 1)) -withCStringBuffer :: Buffer Word8 -> Bool -> (CStringLen -> IO r) -> IO r-withCStringBuffer to_buf null_terminate act = do- let bytes = bufferElems to_buf- withBuffer to_buf $ \to_ptr -> do- when null_terminate $ pokeElemOff to_ptr (bufR to_buf) 0- act (castPtr to_ptr, bytes) -- NB: the length information is specified as being in *bytes*- {-# INLINE newEncodedCString #-} newEncodedCString :: TextEncoding -- ^ Encoding of CString to create -> Bool -- ^ Null-terminate?@@ -261,13 +252,13 @@ let go !iteration to_p to_sz_bytes = do putDebugMsg ("newEncodedCString: " ++ show iteration)- mb_res <- tryFillBuffer encoder null_terminate from to_p to_sz_bytes+ mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes return case mb_res of Nothing -> do let to_sz_bytes' = to_sz_bytes * 2 to_p' <- reallocBytes to_p to_sz_bytes' go (iteration + 1) to_p' to_sz_bytes'- Just to_buf -> withCStringBuffer to_buf null_terminate return+ Just res -> return res -- If the input string is ASCII, this value will ensure we only allocate once let to_sz_bytes = cCharSize * (sz + 1)@@ -275,9 +266,9 @@ go (0 :: Int) to_p to_sz_bytes -tryFillBuffer :: TextEncoder dstate -> Bool -> Buffer Char -> Ptr Word8 -> Int- -> IO (Maybe (Buffer Word8))-tryFillBuffer encoder null_terminate from0 to_p to_sz_bytes = do+tryFillBufferAndCall :: TextEncoder dstate -> Bool -> Buffer Char -> Ptr Word8 -> Int+ -> (CStringLen -> IO a) -> IO (Maybe a)+tryFillBufferAndCall encoder null_terminate from0 to_p to_sz_bytes act = do to_fp <- newForeignPtr_ to_p go (0 :: Int) (from0, emptyBuffer to_fp to_sz_bytes WriteBuffer) where@@ -287,43 +278,14 @@ if isEmptyBuffer from' then if null_terminate && bufferAvailable to' == 0 then return Nothing -- We had enough for the string but not the terminator: ask the caller for more buffer- else return (Just to')+ else do+ -- Awesome, we had enough buffer+ let bytes = bufferElems to'+ withBuffer to' $ \to_ptr -> do+ when null_terminate $ pokeElemOff to_ptr (bufR to') 0+ fmap Just $ act (castPtr to_ptr, bytes) -- NB: the length information is specified as being in *bytes* else case why of -- We didn't consume all of the input InputUnderflow -> recover encoder from' to' >>= go (iteration + 1) -- These conditions are equally bad InvalidSequence -> recover encoder from' to' >>= go (iteration + 1) -- since the input was truncated/invalid OutputUnderflow -> return Nothing -- Oops, out of buffer during decoding: ask the caller for more-{--Note [Check *before* fill in withEncodedCString]-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--It's very important that the size check and readjustment peformed by tryFillBuffer-happens before the continuation is called. The size check is the part which can-fail, the call to the continuation never fails and so the caller should respond-first to the size check failing and *then* call the continuation. Making this evident-to the compiler avoids historic space leaks.--In a previous interation of this code we had a pattern that, somewhat simplified,-looked like this:--go :: State -> (State -> IO a) -> IO a-go state action =- case tryFillBufferAndCall state action of- Left state' -> go state' action- Right result -> result--`tryFillBufferAndCall` performed some checks, and then we either called action,-or we modified the state and tried again.-This went wrong because `action` can be a function closure containing a reference to-a lazy data structure. If we call action directly, without retaining any references-to action, that is fine. The data structure is consumed as it is produced and we operate-in constant space.--However the failure branch `go state' action` *does* capture a reference to action.-This went wrong because the reference to action in the failure branch only becomes-unreachable *after* action returns. This means we keep alive the function closure-for `action` until `action` returns. Which in turn keeps alive the *whole* lazy list-via `action` until the action has fully run.-This went wrong in #20107, where the continuation kept an entire lazy bytestring alive-rather than allowing it to be incrementaly consumed and collected.--}
GHC/ForeignPtr.hs view
@@ -23,11 +23,13 @@ module GHC.ForeignPtr (+ -- * Types ForeignPtr(..), ForeignPtrContents(..), Finalizers(..), FinalizerPtr, FinalizerEnvPtr,+ -- * Create newForeignPtr_, mallocForeignPtr, mallocPlainForeignPtr,@@ -35,15 +37,23 @@ mallocPlainForeignPtrBytes, mallocForeignPtrAlignedBytes, mallocPlainForeignPtrAlignedBytes,+ newConcForeignPtr,+ -- * Add Finalizers addForeignPtrFinalizer, addForeignPtrFinalizerEnv,- touchForeignPtr,+ addForeignPtrConcFinalizer,+ -- * Conversion unsafeForeignPtrToPtr, castForeignPtr, plusForeignPtr,- newConcForeignPtr,- addForeignPtrConcFinalizer,+ -- * Control over lifetype+ withForeignPtr,+ unsafeWithForeignPtr,+ touchForeignPtr,+ -- * Finalization finalizeForeignPtr+ -- * Commentary+ -- $commentary ) where import Foreign.Storable@@ -55,6 +65,8 @@ import GHC.STRef ( STRef(..) ) import GHC.Ptr ( Ptr(..), FunPtr(..) ) +import Unsafe.Coerce ( unsafeCoerce, unsafeCoerceUnlifted )+ -- |The type 'ForeignPtr' represents references to objects that are -- maintained in a foreign language, i.e., that are not part of the -- data structures usually managed by the Haskell storage manager.@@ -84,16 +96,122 @@ -- object, because that ensures that whatever the finalizer is -- attached to is kept alive. +-- | Functions called when a 'ForeignPtr' is finalized. Note that+-- C finalizers and Haskell finalizers cannot be mixed. data Finalizers = NoFinalizers+ -- ^ No finalizer. If there is no intent to add a finalizer at+ -- any point in the future, consider 'FinalPtr' or 'PlainPtr' instead+ -- since these perform fewer allocations. | CFinalizers (Weak# ())+ -- ^ Finalizers are all C functions. | HaskellFinalizers [IO ()]+ -- ^ Finalizers are all Haskell functions. +-- | Controls finalization of a 'ForeignPtr', that is, what should happen+-- if the 'ForeignPtr' becomes unreachable. Visually, these data constructors+-- are appropriate in these scenarios:+--+-- > Memory backing pointer is+-- > GC-Managed Unmanaged+-- > Finalizer functions are: +------------+-----------------++-- > Allowed | MallocPtr | PlainForeignPtr |+-- > +------------+-----------------++-- > Prohibited | PlainPtr | FinalPtr |+-- > +------------+-----------------+ data ForeignPtrContents = PlainForeignPtr !(IORef Finalizers)- | MallocPtr (MutableByteArray# RealWorld) !(IORef Finalizers)- | PlainPtr (MutableByteArray# RealWorld)+ -- ^ The pointer refers to unmanaged memory that was allocated by+ -- a foreign function (typically using @malloc@). The finalizer+ -- frequently calls the C function @free@ or some variant of it.+ | FinalPtr+ -- ^ The pointer refers to unmanaged memory that should not be freed when+ -- the 'ForeignPtr' becomes unreachable. Functions that add finalizers+ -- to a 'ForeignPtr' throw exceptions when the 'ForeignPtr' is backed by+ -- 'PlainPtr'Most commonly, this is used with @Addr#@ literals.+ -- See Note [Why FinalPtr].+ --+ -- @since 4.15+ | MallocPtr (MutableByteArray# RealWorld) !(IORef Finalizers)+ -- ^ The pointer refers to a byte array.+ -- The 'MutableByteArray#' field means that the 'MutableByteArray#' is+ -- reachable (by GC) whenever the 'ForeignPtr' is reachable. When the+ -- 'ForeignPtr' becomes unreachable, the runtime\'s normal GC recovers+ -- the memory backing it. Here, the finalizer function intended to be used+ -- to @free()@ any ancilliary *unmanaged* memory pointed to by the+ -- 'MutableByteArray#'. See the @zlib@ library for an example of this use.+ --+ -- 1. Invariant: The 'Addr#' in the parent 'ForeignPtr' is an interior+ -- pointer into this 'MutableByteArray#'.+ -- 2. Invariant: The 'MutableByteArray#' is pinned, so the 'Addr#' does not+ -- get invalidated by the GC moving the byte array.+ -- 3. Invariant: A 'MutableByteArray#' must not be associated with more than+ -- one set of finalizers. For example, this is sound:+ --+ -- > incrGood :: ForeignPtr Word8 -> ForeignPtr Word8+ -- > incrGood (ForeignPtr p (MallocPtr m f)) = ForeignPtr (plusPtr p 1) (MallocPtr m f)+ --+ -- But this is unsound:+ --+ -- > incrBad :: ForeignPtr Word8 -> IO (ForeignPtr Word8)+ -- > incrBad (ForeignPtr p (MallocPtr m _)) = do+ -- > f <- newIORef NoFinalizers+ -- > pure (ForeignPtr p (MallocPtr m f))+ | PlainPtr (MutableByteArray# RealWorld)+ -- ^ The pointer refers to a byte array. Finalization is not+ -- supported. This optimizes @MallocPtr@ by avoiding the allocation+ -- of a @MutVar#@ when it is known that no one will add finalizers to+ -- the @ForeignPtr@. Functions that add finalizers to a 'ForeignPtr'+ -- throw exceptions when the 'ForeignPtr' is backed by 'PlainPtr'.+ -- The invariants that apply to 'MallocPtr' apply to 'PlainPtr' as well. +-- Note [Why FinalPtr]+--+-- FinalPtr exists as an optimization for foreign pointers created+-- from Addr# literals. Most commonly, this happens in the bytestring+-- library, where the combination of OverloadedStrings and a rewrite+-- rule overloads String literals as ByteString literals. See the+-- rule "ByteString packChars/packAddress" in+-- bytestring:Data.ByteString.Internal. Prior to the+-- introduction of FinalPtr, bytestring used PlainForeignPtr (in+-- Data.ByteString.Internal.unsafePackAddress) to handle such literals.+-- With O2 optimization, the resulting Core from a GHC patched with a+-- known-key cstringLength# function but without FinalPtr looked like:+--+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}+-- stringOne1 = "hello beautiful world"#+-- RHS size: {terms: 11, types: 17, coercions: 0, joins: 0/0}+-- stringOne+-- = case newMutVar# NoFinalizers realWorld# of+-- { (# ipv_i7b6, ipv1_i7b7 #) ->+-- PS stringOne1 (PlainForeignPtr ipv1_i7b7) 0# 21#+-- }+--+-- After the introduction of FinalPtr, the bytestring library was modified+-- so that the resulting Core was instead:+--+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}+-- stringOne1 = "hello beautiful world"#+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}+-- stringOne = PS stringOne1 FinalPtr 0# 21#+--+-- This improves performance in three ways:+--+-- 1. More optimization opportunities. GHC is willing to inline the FinalPtr+-- variant of stringOne into its use sites. This means the offset and length+-- are eligible for case-of-known-literal. Previously, this never happened.+-- 2. Smaller binaries. Setting up the thunk to call newMutVar# required+-- machine instruction in the generated code. On x86_64, FinalPtr reduces+-- the size of binaries by about 450 bytes per ByteString literal.+-- 3. Smaller memory footprint. Previously, every ByteString literal resulted+-- in the allocation of a MutVar# and a PlainForeignPtr data constructor.+-- These both hang around until the ByteString goes out of scope. FinalPtr+-- eliminates both of these sources of allocations. The MutVar# is not+-- allocated because FinalPtr does not allow it, and the data constructor+-- is not allocated because FinalPtr is a nullary data constructor.+--+-- For more discussion of FinalPtr, see GHC MR #2165 and bytestring PR #191.+ -- | @since 2.01 instance Eq (ForeignPtr a) where p == q = unsafeForeignPtrToPtr p == unsafeForeignPtrToPtr q@@ -165,7 +283,7 @@ r <- newIORef NoFinalizers IO $ \s -> case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (MallocPtr mbarr# r) #) } where !(I# size) = sizeOf a@@ -180,7 +298,7 @@ r <- newIORef NoFinalizers IO $ \s -> case newPinnedByteArray# size s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (MallocPtr mbarr# r) #) } @@ -194,7 +312,7 @@ r <- newIORef NoFinalizers IO $ \s -> case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (MallocPtr mbarr# r) #) } @@ -218,7 +336,7 @@ | I# size < 0 = errorWithoutStackTrace "mallocForeignPtr: size must be >= 0" | otherwise = IO $ \s -> case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (PlainPtr mbarr#) #) } where !(I# size) = sizeOf a@@ -233,7 +351,7 @@ errorWithoutStackTrace "mallocPlainForeignPtrBytes: size must be >= 0" mallocPlainForeignPtrBytes (I# size) = IO $ \s -> case newPinnedByteArray# size s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (PlainPtr mbarr#) #) } @@ -246,7 +364,7 @@ errorWithoutStackTrace "mallocPlainForeignPtrAlignedBytes: size must be >= 0" mallocPlainForeignPtrAlignedBytes (I# size) (I# align) = IO $ \s -> case newAlignedPinnedByteArray# size align s of { (# s', mbarr# #) ->- (# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))+ (# s', ForeignPtr (byteArrayContents# (unsafeCoerceUnlifted mbarr#)) (PlainPtr mbarr#) #) } @@ -257,7 +375,7 @@ addForeignPtrFinalizer (FunPtr fp) (ForeignPtr p c) = case c of PlainForeignPtr r -> insertCFinalizer r fp 0# nullAddr# p () MallocPtr _ r -> insertCFinalizer r fp 0# nullAddr# p c- _ -> errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"+ _ -> errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer or a final pointer" -- Note [MallocPtr finalizers] (#10904) --@@ -275,7 +393,7 @@ addForeignPtrFinalizerEnv (FunPtr fp) (Ptr ep) (ForeignPtr p c) = case c of PlainForeignPtr r -> insertCFinalizer r fp 1# ep p () MallocPtr _ r -> insertCFinalizer r fp 1# ep p c- _ -> errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"+ _ -> errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer or a final pointer" addForeignPtrConcFinalizer :: ForeignPtr a -> IO () -> IO () -- ^This function adds a finalizer to the given @ForeignPtr@. The@@ -317,7 +435,7 @@ finalizer' = unIO (foreignPtrFinalizer r >> touch f) addForeignPtrConcFinalizer_ _ _ =- errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to plain pointer"+ errorWithoutStackTrace "GHC.ForeignPtr: attempt to add a finalizer to plain pointer or a final pointer" insertHaskellFinalizer :: IORef Finalizers -> IO () -> IO Bool insertHaskellFinalizer r f = do@@ -343,6 +461,8 @@ -- replaced the content of r before calling finalizeWeak#. (# s1, _ #) -> unIO (insertCFinalizer r fp flag ep p val) s1 +-- Read the weak reference from an IORef Finalizers, creating it if necessary.+-- Throws an exception if HaskellFinalizers is encountered. ensureCFinalizerWeak :: IORef Finalizers -> value -> IO MyWeak ensureCFinalizerWeak ref@(IORef (STRef r#)) value = do fin <- readIORef ref@@ -350,7 +470,7 @@ CFinalizers weak -> return (MyWeak weak) HaskellFinalizers{} -> noMixingError NoFinalizers -> IO $ \s ->- case mkWeakNoFinalizer# r# (unsafeCoerce# value) s of { (# s1, w #) ->+ case mkWeakNoFinalizer# r# (unsafeCoerce value) s of { (# s1, w #) -> -- See Note [MallocPtr finalizers] (#10904) case atomicModifyMutVar2# r# (update w) s1 of { (# s2, _, (_, (weak, needKill )) #) ->@@ -368,6 +488,7 @@ "GHC.ForeignPtr: attempt to mix Haskell and C finalizers " ++ "in the same ForeignPtr" +-- Swap out the finalizers with NoFinalizers and then run them. foreignPtrFinalizer :: IORef Finalizers -> IO () foreignPtrFinalizer r = do fs <- atomicSwapIORef r NoFinalizers@@ -386,21 +507,64 @@ r <- newIORef NoFinalizers return (ForeignPtr obj (PlainForeignPtr r)) +withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b+-- ^This is a way to look at the pointer living inside a+-- foreign object. This function takes a function which is+-- applied to that pointer. The resulting 'IO' action is then+-- executed. The foreign object is kept alive at least during+-- the whole action, even if it is not used directly+-- inside. Note that it is not safe to return the pointer from+-- the action and use it after the action completes. All uses+-- of the pointer should be inside the+-- 'withForeignPtr' bracket. The reason for+-- this unsafeness is the same as for+-- 'unsafeForeignPtrToPtr' below: the finalizer+-- may run earlier than expected, because the compiler can only+-- track usage of the 'ForeignPtr' object, not+-- a 'Ptr' object made from it.+--+-- This function is normally used for marshalling data to+-- or from the object pointed to by the+-- 'ForeignPtr', using the operations from the+-- 'Storable' class.+withForeignPtr fo@(ForeignPtr _ r) f = IO $ \s ->+ case f (unsafeForeignPtrToPtr fo) of+ IO action# -> keepAlive# r s action#++-- | This is similar to 'withForeignPtr' but comes with an important caveat:+-- the user must guarantee that the continuation does not diverge (e.g. loop or+-- throw an exception). In exchange for this loss of generality, this function+-- offers the ability of GHC to optimise more aggressively.+--+-- Specifically, applications of the form:+-- @+-- unsafeWithForeignPtr fptr ('Control.Monad.forever' something)+-- @+--+-- See GHC issue #17760 for more information about the unsoundness behavior+-- that this function can result in.+unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b+unsafeWithForeignPtr fo f = do+ r <- f (unsafeForeignPtrToPtr fo)+ touchForeignPtr fo+ return r+ touchForeignPtr :: ForeignPtr a -> IO () -- ^This function ensures that the foreign object in -- question is alive at the given place in the sequence of IO--- actions. In particular 'Foreign.ForeignPtr.withForeignPtr'--- does a 'touchForeignPtr' after it--- executes the user action.+-- actions. However, this comes with a significant caveat: the contract above+-- does not hold if GHC can demonstrate that the code preceeding+-- @touchForeignPtr@ diverges (e.g. by looping infinitely or throwing an+-- exception). For this reason, you are strongly advised to use instead+-- 'withForeignPtr' where possible. ----- Note that this function should not be used to express dependencies--- between finalizers on 'ForeignPtr's. For example, if the finalizer--- for a 'ForeignPtr' @F1@ calls 'touchForeignPtr' on a second--- 'ForeignPtr' @F2@, then the only guarantee is that the finalizer--- for @F2@ is never started before the finalizer for @F1@. They--- might be started together if for example both @F1@ and @F2@ are--- otherwise unreachable, and in that case the scheduler might end up--- running the finalizer for @F2@ first.+-- Also, note that this function should not be used to express dependencies+-- between finalizers on 'ForeignPtr's. For example, if the finalizer for a+-- 'ForeignPtr' @F1@ calls 'touchForeignPtr' on a second 'ForeignPtr' @F2@,+-- then the only guarantee is that the finalizer for @F2@ is never started+-- before the finalizer for @F1@. They might be started together if for+-- example both @F1@ and @F2@ are otherwise unreachable, and in that case the+-- scheduler might end up running the finalizer for @F2@ first. -- -- In general, it is not recommended to use finalizers on separate -- objects with ordering constraints between them. To express the@@ -453,14 +617,55 @@ plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c -- | Causes the finalizers associated with a foreign pointer to be run--- immediately.+-- immediately. The foreign pointer must not be used again after this+-- function is called. If the foreign pointer does not support finalizers,+-- this is a no-op. finalizeForeignPtr :: ForeignPtr a -> IO ()-finalizeForeignPtr (ForeignPtr _ (PlainPtr _)) = return () -- no effect-finalizeForeignPtr (ForeignPtr _ foreignPtr) = foreignPtrFinalizer refFinalizers- where- refFinalizers = case foreignPtr of- (PlainForeignPtr ref) -> ref- (MallocPtr _ ref) -> ref- PlainPtr _ ->- errorWithoutStackTrace "finalizeForeignPtr PlainPtr"+finalizeForeignPtr (ForeignPtr _ c) = case c of+ PlainForeignPtr ref -> foreignPtrFinalizer ref+ MallocPtr _ ref -> foreignPtrFinalizer ref+ PlainPtr{} -> return ()+ FinalPtr{} -> return () +{- $commentary++This is a high-level overview of how 'ForeignPtr' works.+The implementation of 'ForeignPtr' must accomplish several goals:++1. Invoke a finalizer once a foreign pointer becomes unreachable.+2. Support augmentation of finalizers, i.e. 'addForeignPtrFinalizer'.+ As a motivating example, suppose that the payload of a foreign+ pointer is C struct @bar@ that has an optionally NULL pointer field+ @foo@ to an unmanaged heap object. Initially, @foo@ is NULL, and+ later the program uses @malloc@, initializes the object, and assigns+ @foo@ the address returned by @malloc@. When the foreign pointer+ becomes unreachable, it is now necessary to first @free@ the object+ pointed to by @foo@ and then invoke whatever finalizer was associated+ with @bar@. That is, finalizers must be invoked in the opposite order+ they are added.+3. Allow users to invoke a finalizer promptly if they know that the+ foreign pointer is unreachable, i.e. 'finalizeForeignPtr'.++How can these goals be accomplished? Goal 1 suggests that weak references+and finalizers (via 'Weak#' and 'mkWeak#') are necessary. But how should+they be used and what should their key be? Certainly not 'ForeignPtr' or+'ForeignPtrContents'. See the warning in "GHC.Weak" about weak pointers with+lifted (non-primitive) keys. The two finalizer-supporting data constructors of+'ForeignPtr' have an @'IORef' 'Finalizers'@ (backed by 'MutVar#') field.+This gets used in two different ways depending on the kind of finalizer:++* 'HaskellFinalizers': The first @addForeignPtrConcFinalizer_@ call uses+ 'mkWeak#' to attach the finalizer @foreignPtrFinalizer@ to the 'MutVar#'.+ The resulting 'Weak#' is discarded (see @addForeignPtrConcFinalizer_@).+ Subsequent calls to @addForeignPtrConcFinalizer_@ (goal 2) just add+ finalizers onto the list in the 'HaskellFinalizers' data constructor.+* 'CFinalizers': The first 'addForeignPtrFinalizer' call uses+ 'mkWeakNoFinalizer#' to create a 'Weak#'. The 'Weak#' is preserved in the+ 'CFinalizers' data constructor. Both the first call and subsequent+ calls (goal 2) use 'addCFinalizerToWeak#' to attach finalizers to the+ 'Weak#' itself. Also, see Note [MallocPtr finalizers] for discussion of+ the key and value of this 'Weak#'.++In either case, the runtime invokes the appropriate finalizers when the+'ForeignPtr' becomes unreachable.+-}
GHC/Generics.hs view
@@ -730,7 +730,7 @@ import Data.Either ( Either (..) ) import Data.Maybe ( Maybe(..), fromMaybe ) import Data.Ord ( Down(..) )-import GHC.Integer ( Integer, integerToInt )+import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) import GHC.Ptr ( Ptr ) import GHC.Types@@ -744,6 +744,10 @@ import GHC.Enum ( Bounded, Enum ) import GHC.Read ( Read(..) ) import GHC.Show ( Show(..), showString )+import GHC.Stack.Types ( SrcLoc(..) )+import GHC.Tuple (Solo (..))+import GHC.Unicode ( GeneralCategory(..) )+import GHC.Fingerprint.Type ( Fingerprint(..) ) -- Needed for metadata import Data.Proxy ( Proxy(..) )@@ -1416,6 +1420,9 @@ -- | @since 4.6.0.0 deriving instance Generic () +-- | @since 4.15+deriving instance Generic (Solo a)+ -- | @since 4.6.0.0 deriving instance Generic ((,) a b) @@ -1437,7 +1444,15 @@ -- | @since 4.12.0.0 deriving instance Generic (Down a) +-- | @since 4.15.0.0+deriving instance Generic SrcLoc +-- | @since 4.15.0.0+deriving instance Generic GeneralCategory++-- | @since 4.15.0.0+deriving instance Generic Fingerprint+ -- | @since 4.6.0.0 deriving instance Generic1 [] @@ -1453,6 +1468,9 @@ -- | @since 4.6.0.0 deriving instance Generic1 Proxy +-- | @since 4.15+deriving instance Generic1 Solo+ -- | @since 4.6.0.0 deriving instance Generic1 ((,) a) @@ -1560,7 +1578,7 @@ instance SingKind FixityI where type DemoteRep FixityI = Fixity fromSing SPrefix = Prefix- fromSing (SInfix a n) = Infix (fromSing a) (I# (integerToInt n))+ fromSing (SInfix a n) = Infix (fromSing a) (integerToInt n) -- Singleton Associativity data instance Sing (a :: Associativity) where
GHC/IO.hs view
@@ -29,7 +29,7 @@ unsafeDupablePerformIO, unsafeDupableInterleaveIO, noDuplicate, - -- To and from from ST+ -- To and from ST stToIO, ioToST, unsafeIOToST, unsafeSTToIO, FilePath,@@ -47,6 +47,7 @@ import GHC.Exception import GHC.Show import GHC.IO.Unsafe+import Unsafe.Coerce ( unsafeCoerce ) import {-# SOURCE #-} GHC.IO.Exception ( userError, IOError ) @@ -61,7 +62,7 @@ NOTE: The IO representation is deeply wired in to various parts of the system. The following list may or may not be exhaustive: -Compiler - types of various primitives in PrimOp.hs+Compiler - types of various primitives in GHC.Builtin.PrimOps RTS - forceIO (StgStartup.cmm) - catchzh_fast, (un)?blockAsyncExceptionszh_fast, raisezh_fast@@ -99,7 +100,7 @@ -- This relies on 'IO' and 'ST' having the same representation modulo the -- constraint on the state thread type parameter. unsafeIOToST :: IO a -> ST s a-unsafeIOToST (IO io) = ST $ \ s -> (unsafeCoerce# io) s+unsafeIOToST (IO io) = ST $ \ s -> (unsafeCoerce io) s -- | Convert an 'ST' action to an 'IO' action. -- This relies on 'IO' and 'ST' having the same representation modulo the@@ -108,7 +109,7 @@ -- For an example demonstrating why this is unsafe, see -- https://mail.haskell.org/pipermail/haskell-cafe/2009-April/060719.html unsafeSTToIO :: ST s a -> IO a-unsafeSTToIO (ST m) = IO (unsafeCoerce# m)+unsafeSTToIO (ST m) = IO (unsafeCoerce m) -- ----------------------------------------------------------------------------- -- | File and directory names are values of type 'String', whose precise@@ -171,7 +172,7 @@ -- might catch either. If you are calling @catch@ with type -- @IO Int -> (ArithException -> IO Int) -> IO Int@ then the handler may -- get run with @DivideByZero@ as an argument, or an @ErrorCall \"urk\"@--- exception may be propogated further up. If you call it again, you+-- exception may be propagated further up. If you call it again, you -- might get a the opposite behaviour. This is ok, because 'catch' is an -- 'IO' computation. --
GHC/IO.hs-boot view
@@ -4,7 +4,7 @@ module GHC.IO where import GHC.Types-import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base import {-# SOURCE #-} GHC.Exception.Type (SomeException) mplusIO :: IO a -> IO a -> IO a
GHC/IO/Buffer.hs view
@@ -31,6 +31,8 @@ bufferAdd, slideContents, bufferAdjustL,+ bufferAddOffset,+ bufferAdjustOffset, -- ** Inspecting isEmptyBuffer,@@ -39,6 +41,7 @@ isWriteBuffer, bufferElems, bufferAvailable,+ bufferOffset, summaryBuffer, -- ** Operating on the raw buffer as a Ptr@@ -68,6 +71,8 @@ import GHC.Word import GHC.Show import GHC.Real+import GHC.List+import GHC.ForeignPtr (unsafeWithForeignPtr) import Foreign.C.Types import Foreign.ForeignPtr import Foreign.Storable@@ -89,6 +94,9 @@ -- broken. In particular, the built-in codecs -- e.g. GHC.IO.Encoding.UTF{8,16,32} need to use isFullCharBuffer or -- similar in place of the ow >= os comparisons.+--+-- Tamar: We need to do this eventually for Windows, as we have to re-encode+-- the text as UTF-16 anyway, so if we can avoid it it would be great. -- --------------------------------------------------------------------------- -- Raw blocks of data@@ -96,10 +104,10 @@ type RawBuffer e = ForeignPtr e readWord8Buf :: RawBuffer Word8 -> Int -> IO Word8-readWord8Buf arr ix = withForeignPtr arr $ \p -> peekByteOff p ix+readWord8Buf fp ix = unsafeWithForeignPtr fp $ \p -> peekByteOff p ix writeWord8Buf :: RawBuffer Word8 -> Int -> Word8 -> IO ()-writeWord8Buf arr ix w = withForeignPtr arr $ \p -> pokeByteOff p ix w+writeWord8Buf fp ix w = unsafeWithForeignPtr fp $ \p -> pokeByteOff p ix w #if defined(CHARBUF_UTF16) type CharBufElem = Word16@@ -110,17 +118,17 @@ type RawCharBuffer = RawBuffer CharBufElem peekCharBuf :: RawCharBuffer -> Int -> IO Char-peekCharBuf arr ix = withForeignPtr arr $ \p -> do+peekCharBuf arr ix = unsafeWithForeignPtr arr $ \p -> do (c,_) <- readCharBufPtr p ix return c {-# INLINE readCharBuf #-} readCharBuf :: RawCharBuffer -> Int -> IO (Char, Int)-readCharBuf arr ix = withForeignPtr arr $ \p -> readCharBufPtr p ix+readCharBuf arr ix = unsafeWithForeignPtr arr $ \p -> readCharBufPtr p ix {-# INLINE writeCharBuf #-} writeCharBuf :: RawCharBuffer -> Int -> Char -> IO Int-writeCharBuf arr ix c = withForeignPtr arr $ \p -> writeCharBufPtr p ix c+writeCharBuf arr ix c = unsafeWithForeignPtr arr $ \p -> writeCharBufPtr p ix c {-# INLINE readCharBufPtr #-} readCharBufPtr :: Ptr CharBufElem -> Int -> IO (Char, Int)@@ -177,13 +185,27 @@ -- a memory-mapped file and in which case 'bufL' will point to the -- next location to be written, which is not necessarily the beginning -- of the file.+--+-- On Posix systems the I/O manager has an implicit reliance on doing a file+-- read moving the file pointer. However on Windows async operations the kernel+-- object representing a file does not use the file pointer offset. Logically+-- this makes sense since operations can be performed in any arbitrary order.+-- OVERLAPPED operations don't respect the file pointer offset as their+-- intention is to support arbitrary async reads to anywhere at a much lower+-- level. As such we should explicitly keep track of the file offsets of the+-- target in the buffer. Any operation to seek should also update this entry.+--+-- In order to keep us sane we try to uphold the invariant that any function+-- being passed a Handle is responsible for updating the handles offset unless+-- other behaviour is documented. data Buffer e = Buffer {- bufRaw :: !(RawBuffer e),- bufState :: BufferState,- bufSize :: !Int, -- in elements, not bytes- bufL :: !Int, -- offset of first item in the buffer- bufR :: !Int -- offset of last item + 1+ bufRaw :: !(RawBuffer e),+ bufState :: BufferState,+ bufSize :: !Int, -- in elements, not bytes+ bufOffset :: !Word64, -- start location for next read/write+ bufL :: !Int, -- offset of first item in the buffer+ bufR :: !Int -- offset of last item + 1 } #if defined(CHARBUF_UTF16)@@ -237,9 +259,22 @@ bufferAdd :: Int -> Buffer e -> Buffer e bufferAdd i buf@Buffer{ bufR=w } = buf{ bufR=w+i } +bufferOffset :: Buffer e -> Word64+bufferOffset Buffer{ bufOffset=off } = off++bufferAdjustOffset :: Word64 -> Buffer e -> Buffer e+bufferAdjustOffset offs buf = buf{ bufOffset=offs }++-- The adjustment to the offset can be 32bit int on 32 platforms.+-- This is fine, we only use this after reading into/writing from+-- the buffer so we will never overflow here.+bufferAddOffset :: Int -> Buffer e -> Buffer e+bufferAddOffset offs buf@Buffer{ bufOffset=w } =+ buf{ bufOffset=w+(fromIntegral offs) }+ emptyBuffer :: RawBuffer e -> Int -> BufferState -> Buffer e emptyBuffer raw sz state =- Buffer{ bufRaw=raw, bufState=state, bufR=0, bufL=0, bufSize=sz }+ Buffer{ bufRaw=raw, bufState=state, bufOffset=0, bufR=0, bufL=0, bufSize=sz } newByteBuffer :: Int -> BufferState -> IO (Buffer Word8) newByteBuffer c st = newBuffer c c st@@ -266,9 +301,16 @@ summaryBuffer :: Buffer a -> String summaryBuffer !buf -- Strict => slightly better code- = "buf" ++ show (bufSize buf) ++ "(" ++ show (bufL buf) ++ "-" ++ show (bufR buf) ++ ")"+ = ppr (show $ bufRaw buf) ++ "@buf" ++ show (bufSize buf)+ ++ "(" ++ show (bufL buf) ++ "-" ++ show (bufR buf) ++ ")"+ ++ " (>=" ++ show (bufOffset buf) ++ ")"+ where ppr :: String -> String+ ppr ('0':'x':xs) = let p = dropWhile (=='0') xs+ in if null p then "0x0" else '0':'x':p+ ppr x = x --- INVARIANTS on Buffers:+-- Note [INVARIANTS on Buffers]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- * r <= w -- * if r == w, and the buffer is for reading, then r == 0 && w == 0 -- * a write buffer is never full. If an operation
GHC/IO/BufferedIO.hs view
@@ -92,9 +92,11 @@ readBuf :: RawIO dev => dev -> Buffer Word8 -> IO (Int, Buffer Word8) readBuf dev bbuf = do let bytes = bufferAvailable bbuf+ let offset = bufferOffset bbuf res <- withBuffer bbuf $ \ptr ->- RawIO.read dev (ptr `plusPtr` bufR bbuf) bytes- return (res, bbuf{ bufR = bufR bbuf + res })+ RawIO.read dev (ptr `plusPtr` bufR bbuf) offset bytes+ let bbuf' = bufferAddOffset res bbuf+ return (res, bbuf'{ bufR = bufR bbuf' + res }) -- zero indicates end of file readBufNonBlocking :: RawIO dev => dev -> Buffer Word8@@ -103,24 +105,30 @@ Buffer Word8) readBufNonBlocking dev bbuf = do let bytes = bufferAvailable bbuf+ let offset = bufferOffset bbuf res <- withBuffer bbuf $ \ptr ->- IODevice.readNonBlocking dev (ptr `plusPtr` bufR bbuf) bytes+ IODevice.readNonBlocking dev (ptr `plusPtr` bufR bbuf) offset bytes case res of Nothing -> return (Nothing, bbuf)- Just n -> return (Just n, bbuf{ bufR = bufR bbuf + n })+ Just n -> do let bbuf' = bufferAddOffset n bbuf+ return (Just n, bbuf'{ bufR = bufR bbuf' + n }) writeBuf :: RawIO dev => dev -> Buffer Word8 -> IO (Buffer Word8) writeBuf dev bbuf = do let bytes = bufferElems bbuf+ let offset = bufferOffset bbuf withBuffer bbuf $ \ptr ->- IODevice.write dev (ptr `plusPtr` bufL bbuf) bytes- return bbuf{ bufL=0, bufR=0 }+ IODevice.write dev (ptr `plusPtr` bufL bbuf) offset bytes+ let bbuf' = bufferAddOffset bytes bbuf+ return bbuf'{ bufL=0, bufR=0 } -- XXX ToDo writeBufNonBlocking :: RawIO dev => dev -> Buffer Word8 -> IO (Int, Buffer Word8) writeBufNonBlocking dev bbuf = do let bytes = bufferElems bbuf+ let offset = bufferOffset bbuf res <- withBuffer bbuf $ \ptr ->- IODevice.writeNonBlocking dev (ptr `plusPtr` bufL bbuf) bytes- return (res, bufferAdjustL (bufL bbuf + res) bbuf)+ IODevice.writeNonBlocking dev (ptr `plusPtr` bufL bbuf) offset bytes+ let bbuf' = bufferAddOffset bytes bbuf+ return (res, bufferAdjustL (bufL bbuf + res) bbuf')
GHC/IO/Device.hs view
@@ -34,26 +34,29 @@ import {-# SOURCE #-} GHC.IO.Exception ( unsupportedOperation ) -- | A low-level I/O provider where the data is bytes in memory.+-- The Word64 offsets currently have no effect on POSIX system or consoles+-- where the implicit behaviour of the C runtime is assume to move the file+-- pointer on every read/write without needing an explicit seek. class RawIO a where- -- | Read up to the specified number of bytes, returning the number- -- of bytes actually read. This function should only block if there- -- is no data available. If there is not enough data available,- -- then the function should just return the available data. A return- -- value of zero indicates that the end of the data stream (e.g. end+ -- | Read up to the specified number of bytes starting from a specified+ -- offset, returning the number of bytes actually read. This function+ -- should only block if there is no data available. If there is not enough+ -- data available, then the function should just return the available data.+ -- A return value of zero indicates that the end of the data stream (e.g. end -- of file) has been reached.- read :: a -> Ptr Word8 -> Int -> IO Int+ read :: a -> Ptr Word8 -> Word64 -> Int -> IO Int - -- | Read up to the specified number of bytes, returning the number- -- of bytes actually read, or 'Nothing' if the end of the stream has- -- been reached.- readNonBlocking :: a -> Ptr Word8 -> Int -> IO (Maybe Int)+ -- | Read up to the specified number of bytes starting from a specified+ -- offset, returning the number of bytes actually read, or 'Nothing' if+ -- the end of the stream has been reached.+ readNonBlocking :: a -> Ptr Word8 -> Word64 -> Int -> IO (Maybe Int) - -- | Write the specified number of bytes.- write :: a -> Ptr Word8 -> Int -> IO ()+ -- | Write the specified number of bytes starting at a given offset.+ write :: a -> Ptr Word8 -> Word64 -> Int -> IO () - -- | Write up to the specified number of bytes without blocking. Returns- -- the actual number of bytes written.- writeNonBlocking :: a -> Ptr Word8 -> Int -> IO Int+ -- | Write up to the specified number of bytes without blocking starting at a+ -- given offset. Returns the actual number of bytes written.+ writeNonBlocking :: a -> Ptr Word8 -> Word64 -> Int -> IO Int -- | I/O operations required for implementing a 'System.IO.Handle'.@@ -78,7 +81,7 @@ isSeekable _ = return False -- | seek to the specified position in the data.- seek :: a -> SeekMode -> Integer -> IO ()+ seek :: a -> SeekMode -> Integer -> IO Integer seek _ _ _ = ioe_unsupportedOperation -- | return the current position in the data.
GHC/IO/Encoding.hs view
@@ -82,7 +82,7 @@ utf16 :: TextEncoding utf16 = UTF16.utf16 --- | The UTF-16 Unicode encoding (litte-endian)+-- | The UTF-16 Unicode encoding (little-endian) utf16le :: TextEncoding utf16le = UTF16.utf16le @@ -95,7 +95,7 @@ utf32 :: TextEncoding utf32 = UTF32.utf32 --- | The UTF-32 Unicode encoding (litte-endian)+-- | The UTF-32 Unicode encoding (little-endian) utf32le :: TextEncoding utf32le = UTF32.utf32le @@ -107,6 +107,7 @@ -- -- @since 4.5.0.0 getLocaleEncoding :: IO TextEncoding+{-# NOINLINE getLocaleEncoding #-} -- | The Unicode encoding of the current locale, but allowing arbitrary -- undecodable bytes to be round-tripped through it.@@ -120,6 +121,7 @@ -- -- @since 4.5.0.0 getFileSystemEncoding :: IO TextEncoding+{-# NOINLINE getFileSystemEncoding #-} -- | The Unicode encoding of the current locale, but where undecodable -- bytes are replaced with their closest visual match. Used for@@ -127,9 +129,13 @@ -- -- @since 4.5.0.0 getForeignEncoding :: IO TextEncoding+{-# NOINLINE getForeignEncoding #-} -- | @since 4.5.0.0 setLocaleEncoding, setFileSystemEncoding, setForeignEncoding :: TextEncoding -> IO ()+{-# NOINLINE setLocaleEncoding #-}+{-# NOINLINE setFileSystemEncoding #-}+{-# NOINLINE setForeignEncoding #-} (getLocaleEncoding, setLocaleEncoding) = mkGlobal initLocaleEncoding (getFileSystemEncoding, setFileSystemEncoding) = mkGlobal initFileSystemEncoding@@ -139,9 +145,13 @@ mkGlobal x = unsafePerformIO $ do x_ref <- newIORef x return (readIORef x_ref, writeIORef x_ref)+{-# NOINLINE mkGlobal #-} -- | @since 4.5.0.0 initLocaleEncoding, initFileSystemEncoding, initForeignEncoding :: TextEncoding+{-# NOINLINE initLocaleEncoding #-}+-- N.B. initLocaleEncoding is exported for use in System.IO.localeEncoding.+-- NOINLINE ensures that this result is shared. #if !defined(mingw32_HOST_OS) -- It is rather important that we don't just call Iconv.mkIconvEncoding here
GHC/IO/Encoding/CodePage.hs view
@@ -5,7 +5,8 @@ module GHC.IO.Encoding.CodePage( #if defined(mingw32_HOST_OS) codePageEncoding, mkCodePageEncoding,- localeEncoding, mkLocaleEncoding+ localeEncoding, mkLocaleEncoding, CodePage,+ getCurrentCodePage #endif ) where @@ -32,19 +33,15 @@ import GHC.IO.Encoding.UTF16 (mkUTF16le, mkUTF16be) import GHC.IO.Encoding.UTF32 (mkUTF32le, mkUTF32be) -#if defined(mingw32_HOST_OS)-# if defined(i386_HOST_ARCH)-# define WINDOWS_CCONV stdcall-# elif defined(x86_64_HOST_ARCH)-# define WINDOWS_CCONV ccall-# else-# error Unknown mingw32 arch-# endif-#endif+import GHC.Windows (DWORD) +#include "windows_cconv.h"++type CodePage = DWORD+ -- note CodePage = UInt which might not work on Win64. But the Win32 package -- also has this issue.-getCurrentCodePage :: IO Word32+getCurrentCodePage :: IO CodePage getCurrentCodePage = do conCP <- getConsoleCP if conCP > 0
GHC/IO/Encoding/CodePage/API.hs view
@@ -27,7 +27,7 @@ import GHC.Num import GHC.Show import GHC.Real-import GHC.Windows+import GHC.Windows hiding (LPCSTR) import GHC.ForeignPtr (castForeignPtr) import System.Posix.Internals@@ -41,15 +41,7 @@ | c_DEBUG_DUMP = puts s | otherwise = return () --#if defined(i386_HOST_ARCH)-# define WINDOWS_CCONV stdcall-#elif defined(x86_64_HOST_ARCH)-# define WINDOWS_CCONV ccall-#else-# error Unknown mingw32 arch-#endif-+#include "windows_cconv.h" type LPCSTR = Ptr Word8 @@ -188,10 +180,10 @@ else return (why, bufL ibuf' - bufL ibuf, ibuf', obuf') byteView :: Buffer CWchar -> Buffer Word8-byteView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = bufSize * 2, bufL = bufL * 2, bufR = bufR * 2 }+byteView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = bufSize * 2, bufOffset = bufOffset, bufL = bufL * 2, bufR = bufR * 2 } cwcharView :: Buffer Word8 -> Buffer CWchar-cwcharView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = half bufSize, bufL = half bufL, bufR = half bufR }+cwcharView (Buffer {..}) = Buffer { bufState = bufState, bufRaw = castForeignPtr bufRaw, bufSize = half bufSize, bufOffset = bufOffset, bufL = half bufL, bufR = half bufR } where half x = case x `divMod` 2 of (y, 0) -> y _ -> errorWithoutStackTrace "cwcharView: utf16_(encode|decode) (wrote out|consumed) non multiple-of-2 number of bytes" @@ -317,7 +309,7 @@ | ocnt == 0 = return (Left True) | otherwise = alloca $ \defaulted_ptr -> do poke defaulted_ptr False- err <- c_WideCharToMultiByte (fromIntegral cp) 0 -- NB: the WC_ERR_INVALID_CHARS flag is uselses: only has an effect with the UTF-8 code page+ err <- c_WideCharToMultiByte (fromIntegral cp) 0 -- NB: the WC_ERR_INVALID_CHARS flag is useless: only has an effect with the UTF-8 code page iptr (fromIntegral icnt) optr (fromIntegral ocnt) nullPtr defaulted_ptr defaulted <- peek defaulted_ptr
GHC/IO/FD.hs view
@@ -6,7 +6,6 @@ {-# OPTIONS_GHC -Wno-identities #-} -- Whether there are identities depends on the platform {-# OPTIONS_HADDOCK not-home #-}- ----------------------------------------------------------------------------- -- | -- Module : GHC.IO.FD@@ -46,6 +45,7 @@ #if defined(mingw32_HOST_OS) import GHC.Windows import Data.Bool+import GHC.IO.SubSystem ((<!>)) #endif import Foreign@@ -101,29 +101,37 @@ instance Show FD where show fd = show (fdFD fd) +{-# INLINE ifSupported #-}+ifSupported :: String -> a -> a+#if defined(mingw32_HOST_OS)+ifSupported s a = a <!> (error $ "FD:" ++ s ++ " not supported")+#else+ifSupported _ = id+#endif+ -- | @since 4.1.0.0 instance GHC.IO.Device.RawIO FD where- read = fdRead- readNonBlocking = fdReadNonBlocking- write = fdWrite- writeNonBlocking = fdWriteNonBlocking+ read = ifSupported "fdRead" fdRead+ readNonBlocking = ifSupported "fdReadNonBlocking" fdReadNonBlocking+ write = ifSupported "fdWrite" fdWrite+ writeNonBlocking = ifSupported "fdWriteNonBlocking" fdWriteNonBlocking -- | @since 4.1.0.0 instance GHC.IO.Device.IODevice FD where- ready = ready- close = close- isTerminal = isTerminal- isSeekable = isSeekable- seek = seek- tell = tell- getSize = getSize- setSize = setSize- setEcho = setEcho- getEcho = getEcho- setRaw = setRaw- devType = devType- dup = dup- dup2 = dup2+ ready = ifSupported "ready" ready+ close = ifSupported "close" close+ isTerminal = ifSupported "isTerm" isTerminal+ isSeekable = ifSupported "isSeek" isSeekable+ seek = ifSupported "seek" seek+ tell = ifSupported "tell" tell+ getSize = ifSupported "getSize" getSize+ setSize = ifSupported "setSize" setSize+ setEcho = ifSupported "setEcho" setEcho+ getEcho = ifSupported "getEcho" getEcho+ setRaw = ifSupported "setRaw" setRaw+ devType = ifSupported "devType" devType+ dup = ifSupported "dup" dup+ dup2 = ifSupported "dup2" dup2 -- We used to use System.Posix.Internals.dEFAULT_BUFFER_SIZE, which is -- taken from the value of BUFSIZ on the current platform. This value@@ -134,11 +142,11 @@ -- | @since 4.1.0.0 instance BufferedIO FD where- newBuffer _dev state = newByteBuffer dEFAULT_FD_BUFFER_SIZE state- fillReadBuffer fd buf = readBuf' fd buf- fillReadBuffer0 fd buf = readBufNonBlocking fd buf- flushWriteBuffer fd buf = writeBuf' fd buf- flushWriteBuffer0 fd buf = writeBufNonBlocking fd buf+ newBuffer _dev state = ifSupported "newBuf" $ newByteBuffer dEFAULT_FD_BUFFER_SIZE state+ fillReadBuffer fd buf = ifSupported "readBuf" $ readBuf' fd buf+ fillReadBuffer0 fd buf = ifSupported "readBufNonBlock" $ readBufNonBlocking fd buf+ flushWriteBuffer fd buf = ifSupported "writeBuf" $ writeBuf' fd buf+ flushWriteBuffer0 fd buf = ifSupported "writeBufNonBlock" $ writeBufNonBlocking fd buf readBuf' :: FD -> Buffer Word8 -> IO (Int, Buffer Word8) readBuf' fd buf = do@@ -256,8 +264,10 @@ RegularFile -> do -- On Windows we need an additional call to get a unique device id -- and inode, since fstat just returns 0 for both.+ -- See also Note [RTS File locking] (unique_dev, unique_ino) <- getUniqueFileInfo fd dev ino- r <- lockFile fd unique_dev unique_ino (fromBool write)+ r <- lockFile (fromIntegral fd) unique_dev unique_ino+ (fromBool write) when (r == -1) $ ioException (IOError Nothing ResourceBusy "openFile" "file is locked" Nothing Nothing)@@ -335,7 +345,7 @@ closeFdWith closer (fromIntegral (fdFD fd)) release :: FD -> IO ()-release fd = do _ <- unlockFile (fdFD fd)+release fd = do _ <- unlockFile (fromIntegral $ fdFD fd) return () #if defined(mingw32_HOST_OS)@@ -348,10 +358,10 @@ t <- devType fd return (t == RegularFile || t == RawDevice) -seek :: FD -> SeekMode -> Integer -> IO ()-seek fd mode off = do- throwErrnoIfMinus1Retry_ "seek" $- c_lseek (fdFD fd) (fromIntegral off) seektype+seek :: FD -> SeekMode -> Integer -> IO Integer+seek fd mode off = fromIntegral `fmap`+ (throwErrnoIfMinus1Retry "seek" $+ c_lseek (fdFD fd) (fromIntegral off) seektype) where seektype :: CInt seektype = case mode of@@ -436,14 +446,14 @@ -- ----------------------------------------------------------------------------- -- Reading and Writing -fdRead :: FD -> Ptr Word8 -> Int -> IO Int-fdRead fd ptr bytes+fdRead :: FD -> Ptr Word8 -> Word64 -> Int -> IO Int+fdRead fd ptr _offset bytes = do { r <- readRawBufferPtr "GHC.IO.FD.fdRead" fd ptr 0 (fromIntegral $ clampReadSize bytes) ; return (fromIntegral r) } -fdReadNonBlocking :: FD -> Ptr Word8 -> Int -> IO (Maybe Int)-fdReadNonBlocking fd ptr bytes = do+fdReadNonBlocking :: FD -> Ptr Word8 -> Word64 -> Int -> IO (Maybe Int)+fdReadNonBlocking fd ptr _offset bytes = do r <- readRawBufferPtrNoBlock "GHC.IO.FD.fdReadNonBlocking" fd ptr 0 (fromIntegral $ clampReadSize bytes) case fromIntegral r of@@ -451,18 +461,18 @@ n -> return (Just n) -fdWrite :: FD -> Ptr Word8 -> Int -> IO ()-fdWrite fd ptr bytes = do+fdWrite :: FD -> Ptr Word8 -> Word64 -> Int -> IO ()+fdWrite fd ptr _offset bytes = do res <- writeRawBufferPtr "GHC.IO.FD.fdWrite" fd ptr 0 (fromIntegral $ clampWriteSize bytes) let res' = fromIntegral res if res' < bytes- then fdWrite fd (ptr `plusPtr` res') (bytes - res')+ then fdWrite fd (ptr `plusPtr` res') (_offset + fromIntegral res') (bytes - res') else return () -- XXX ToDo: this isn't non-blocking-fdWriteNonBlocking :: FD -> Ptr Word8 -> Int -> IO Int-fdWriteNonBlocking fd ptr bytes = do+fdWriteNonBlocking :: FD -> Ptr Word8 -> Word64 -> Int -> IO Int+fdWriteNonBlocking fd ptr _offset bytes = do res <- writeRawBufferPtrNoBlock "GHC.IO.FD.fdWriteNonBlocking" fd ptr 0 (fromIntegral $ clampWriteSize bytes) return (fromIntegral res)@@ -688,10 +698,10 @@ -- Locking/unlocking foreign import ccall unsafe "lockFile"- lockFile :: CInt -> Word64 -> Word64 -> CInt -> IO CInt+ lockFile :: Word64 -> Word64 -> Word64 -> CInt -> IO CInt foreign import ccall unsafe "unlockFile"- unlockFile :: CInt -> IO CInt+ unlockFile :: Word64 -> IO CInt #if defined(mingw32_HOST_OS) foreign import ccall unsafe "get_unique_file_info"
GHC/IO/Handle.hs view
@@ -45,7 +45,7 @@ hShow, - hWaitForInput, hGetChar, hGetLine, hGetContents, hPutChar, hPutStr,+ hWaitForInput, hGetChar, hGetLine, hGetContents, hGetContents', hPutChar, hPutStr, hGetBuf, hGetBufNonBlocking, hPutBuf, hPutBufNonBlocking ) where@@ -56,7 +56,8 @@ import GHC.IO.Buffer import GHC.IO.BufferedIO ( BufferedIO ) import GHC.IO.Device as IODevice-import GHC.IO.Handle.FD+import GHC.IO.StdHandles+import GHC.IO.SubSystem import GHC.IO.Handle.Lock import GHC.IO.Handle.Types import GHC.IO.Handle.Internals@@ -120,12 +121,14 @@ SemiClosedHandle -> ioe_semiclosedHandle _ -> do flushWriteBuffer handle_ r <- IODevice.getSize dev+ debugIO $ "hFileSize: " ++ show r ++ " " ++ show handle if r /= -1- then return r- else ioException (IOError Nothing InappropriateType "hFileSize"- "not a regular file" Nothing Nothing)+ then return r+ else ioException (IOError Nothing InappropriateType "hFileSize"+ "not a regular file" Nothing Nothing) + -- | 'hSetFileSize' @hdl@ @size@ truncates the physical file with handle @hdl@ to @size@ bytes. hSetFileSize :: Handle -> Integer -> IO ()@@ -234,10 +237,11 @@ case mode of #if !defined(mingw32_HOST_OS) -- 'raw' mode under win32 is a bit too specialised (and troublesome- -- for most common uses), so simply disable its use here.+ -- for most common uses), so simply disable its use here when not using+ -- WinIO. NoBuffering -> IODevice.setRaw haDevice True #else- NoBuffering -> return ()+ NoBuffering -> return () <!> IODevice.setRaw haDevice True #endif _ -> IODevice.setRaw haDevice False @@ -402,22 +406,36 @@ hSeek handle mode offset = wantSeekableHandle "hSeek" handle $ \ handle_@Handle__{..} -> do debugIO ("hSeek " ++ show (mode,offset))- buf <- readIORef haCharBuffer+ cbuf <- readIORef haCharBuffer+ bbuf <- readIORef haByteBuffer+ debugIO $ "hSeek - bbuf:" ++ summaryBuffer bbuf+ debugIO $ "hSeek - cbuf:" ++ summaryBuffer cbuf - if isWriteBuffer buf+ if isWriteBuffer cbuf then do flushWriteBuffer handle_- IODevice.seek haDevice mode offset+ new_offset <- IODevice.seek haDevice mode offset+ -- buffer has been updated, need to re-read it+ bbuf1 <- readIORef haByteBuffer+ let bbuf2 = bbuf1{ bufOffset = fromIntegral new_offset }+ debugIO $ "hSeek - seek:: " ++ show offset +++ " - " ++ show new_offset+ debugIO $ "hSeek - wr flush bbuf1:" ++ summaryBuffer bbuf2+ writeIORef haByteBuffer bbuf2 else do - let r = bufL buf; w = bufR buf+ let r = bufL cbuf; w = bufR cbuf if mode == RelativeSeek && isNothing haDecoder && offset >= 0 && offset < fromIntegral (w - r)- then writeIORef haCharBuffer buf{ bufL = r + fromIntegral offset }+ then writeIORef haCharBuffer cbuf{ bufL = r + fromIntegral offset } else do flushCharReadBuffer handle_ flushByteReadBuffer handle_- IODevice.seek haDevice mode offset+ -- read the updated values+ bbuf2 <- readIORef haByteBuffer+ new_offset <- IODevice.seek haDevice mode offset+ debugIO $ "hSeek after: " ++ show new_offset+ writeIORef haByteBuffer bbuf2{ bufOffset = fromIntegral new_offset } -- | Computation 'hTell' @hdl@ returns the current position of the@@ -433,13 +451,18 @@ hTell handle = wantSeekableHandle "hGetPosn" handle $ \ handle_@Handle__{..} -> do - posn <- IODevice.tell haDevice+ -- TODO: Guard these on Windows+ posn <- if ioSubSystem == IoNative+ then (fromIntegral . bufOffset) `fmap` readIORef haByteBuffer+ else IODevice.tell haDevice -- we can't tell the real byte offset if there are buffered -- Chars, so must flush first: flushCharBuffer handle_ bbuf <- readIORef haByteBuffer+ debugIO ("hTell bbuf (elems=" ++ show (bufferElems bbuf) ++ ")"+ ++ summaryBuffer bbuf) let real_posn | isWriteBuffer bbuf = posn + fromIntegral (bufferElems bbuf)@@ -448,7 +471,7 @@ cbuf <- readIORef haCharBuffer debugIO ("\nhGetPosn: (posn, real_posn) = " ++ show (posn, real_posn)) debugIO (" cbuf: " ++ summaryBuffer cbuf ++- " bbuf: " ++ summaryBuffer bbuf)+ " bbuf: " ++ summaryBuffer bbuf) return real_posn @@ -647,7 +670,7 @@ withHandle_' "dupHandle" h r $ \Handle__{haDevice=dev} -> do dupHandle_ dev filepath other_side h_ mb_finalizer -dupHandle_ :: (IODevice dev, BufferedIO dev, Typeable dev) => dev+dupHandle_ :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe (MVar Handle__) -> Handle__@@ -676,21 +699,23 @@ hDuplicateTo :: Handle -> Handle -> IO () hDuplicateTo h1@(FileHandle path m1) h2@(FileHandle _ m2) = do withHandle__' "hDuplicateTo" h2 m2 $ \h2_ -> do- _ <- hClose_help h2_+ try $ flushWriteBuffer h2_ withHandle_' "hDuplicateTo" h1 m1 $ \h1_ -> do dupHandleTo path h1 Nothing h2_ h1_ (Just handleFinalizer) hDuplicateTo h1@(DuplexHandle path r1 w1) h2@(DuplexHandle _ r2 w2) = do withHandle__' "hDuplicateTo" h2 w2 $ \w2_ -> do- _ <- hClose_help w2_+ try $ flushWriteBuffer w2_ withHandle_' "hDuplicateTo" h1 w1 $ \w1_ -> do dupHandleTo path h1 Nothing w2_ w1_ (Just handleFinalizer) withHandle__' "hDuplicateTo" h2 r2 $ \r2_ -> do- _ <- hClose_help r2_+ try $ flushWriteBuffer r2_ withHandle_' "hDuplicateTo" h1 r1 $ \r1_ -> do dupHandleTo path h1 (Just w1) r2_ r1_ Nothing hDuplicateTo h1 _ = ioe_dupHandlesNotCompatible h1 +try :: IO () -> IO ()+try io = io `catchException` (const (pure ()) :: SomeException -> IO ()) ioe_dupHandlesNotCompatible :: Handle -> IO a ioe_dupHandlesNotCompatible h =
GHC/IO/Handle/FD.hs view
@@ -150,6 +150,11 @@ -- This can be useful for opening a FIFO for writing: if we open in -- non-blocking mode then the open will fail if there are no readers, -- whereas a blocking open will block until a reader appear.+-- +-- Note: when blocking happens, an OS thread becomes tied up with the+-- processing, so the program must have at least another OS thread if+-- it wants to unblock itself. By corollary, a non-threaded runtime+-- will need a process-external trigger in order to become unblocked. -- -- @since 4.4.0.0 openFileBlocking :: FilePath -> IOMode -> IO Handle
GHC/IO/Handle/Internals.hs view
@@ -7,6 +7,7 @@ #-} {-# OPTIONS_GHC -Wno-unused-matches #-} {-# OPTIONS_GHC -Wno-name-shadowing #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} {-# OPTIONS_HADDOCK not-home #-} -----------------------------------------------------------------------------@@ -50,7 +51,7 @@ HandleFinalizer, handleFinalizer, - debugIO,+ debugIO, traceIO ) where import GHC.IO@@ -61,7 +62,8 @@ import GHC.IO.Buffer import GHC.IO.BufferedIO (BufferedIO) import GHC.IO.Exception-import GHC.IO.Device (IODevice, SeekMode(..))+import GHC.IO.Device (IODevice, RawIO, SeekMode(..))+import GHC.IO.SubSystem ((<!>), isWindowsNativeIO) import qualified GHC.IO.Device as IODevice import qualified GHC.IO.BufferedIO as Buffered @@ -92,8 +94,10 @@ newFileHandle filepath mb_finalizer hc = do m <- newMVar hc case mb_finalizer of- Just finalizer -> addMVarFinalizer m (finalizer filepath m)- Nothing -> return ()+ Just finalizer -> do debugIO $ "Registering finalizer: " ++ show filepath+ addMVarFinalizer m (finalizer filepath m)+ Nothing -> do debugIO $ "No finalizer: " ++ show filepath+ return () return (FileHandle filepath m) -- ---------------------------------------------------------------------------@@ -221,6 +225,11 @@ -- --------------------------------------------------------------------------- -- Wrapper for write operations. +-- If we already have a writeable handle just run the action.+-- If we have a read only handle we throw an exception.+-- If we have a read/write handle in read mode we:+-- * Seek to the unread (from the users PoV) position and+-- change the handles buffer to a write buffer. wantWritableHandle :: String -> Handle -> (Handle__ -> IO a) -> IO a wantWritableHandle fun h@(FileHandle _ m) act = wantWritableHandle' fun h m act@@ -252,13 +261,15 @@ buf' <- Buffered.emptyWriteBuffer haDevice buf writeIORef haByteBuffer buf' act h_- _other -> act h_+ AppendHandle -> act h_+ WriteHandle -> act h_ -- --------------------------------------------------------------------------- -- Wrapper for read operations. wantReadableHandle :: String -> Handle -> (Handle__ -> IO (Handle__,a)) -> IO a-wantReadableHandle fun h act = withHandle fun h (checkReadableHandle act)+wantReadableHandle fun h act =+ withHandle fun h (checkReadableHandle act) wantReadableHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a wantReadableHandle_ fun h@(FileHandle _ m) act@@ -358,7 +369,7 @@ -- Wrapper for Handle encoding/decoding. -- The interface for TextEncoding changed so that a TextEncoding doesn't raise--- an exception if it encounters an invalid sequnce. Furthermore, encoding+-- an exception if it encounters an invalid sequence. Furthermore, encoding -- returns a reason as to why encoding stopped, letting us know if it was due -- to input/output underflow or an invalid sequence. --@@ -503,11 +514,13 @@ bbuf <- readIORef haByteBuffer when (not (isEmptyBuffer bbuf)) $ do bbuf' <- Buffered.flushWriteBuffer haDevice bbuf+ debugIO ("flushByteWriteBuffer: bbuf=" ++ summaryBuffer bbuf') writeIORef haByteBuffer bbuf' -- write the contents of the CharBuffer to the Handle__. -- The data will be encoded and pushed to the byte buffer, -- flushing if the buffer becomes full.+-- Data is written to the handles current buffer offset. writeCharBuffer :: Handle__ -> CharBuffer -> IO () writeCharBuffer h_@Handle__{..} !cbuf = do --@@ -535,6 +548,7 @@ then do bbuf'' <- Buffered.flushWriteBuffer haDevice bbuf' writeIORef haByteBuffer bbuf''+ debugIO ("writeCharBuffer after flushing: cbuf=" ++ summaryBuffer bbuf'') else writeIORef haByteBuffer bbuf' @@ -582,8 +596,12 @@ (bbuf1,cbuf1) <- (streamEncode decoder) bbuf0 cbuf0{ bufL=0, bufR=0, bufSize = bufL cbuf0 } - debugIO ("finished, bbuf=" ++ summaryBuffer bbuf1 ++- " cbuf=" ++ summaryBuffer cbuf1)+ -- We should not need to update the offset here. The bytebuffer contains the+ -- offset for the next read after it's used up. But this function only flushes+ -- the char buffer.+ -- let bbuf2 = bbuf1 -- {bufOffset = bufOffset bbuf1 - fromIntegral (bufL bbuf1)}+ -- debugIO ("finished, bbuf=" ++ summaryBuffer bbuf2 +++ -- " cbuf=" ++ summaryBuffer cbuf1) writeIORef haByteBuffer bbuf1 @@ -603,30 +621,51 @@ when (not seekable) $ ioe_cannotFlushNotSeekable let seek = negate (bufR bbuf - bufL bbuf)+ let offset = bufOffset bbuf - fromIntegral (bufR bbuf - bufL bbuf) debugIO ("flushByteReadBuffer: new file offset = " ++ show seek)- IODevice.seek haDevice RelativeSeek (fromIntegral seek)+ debugIO ("flushByteReadBuffer: " ++ summaryBuffer bbuf) - writeIORef haByteBuffer bbuf{ bufL=0, bufR=0 }+ let mIOSeek = IODevice.seek haDevice RelativeSeek (fromIntegral seek)+ -- win-io doesn't need this, but it allows us to error out on invalid offsets+ let winIOSeek = IODevice.seek haDevice AbsoluteSeek (fromIntegral offset) + _ <- mIOSeek <!> winIOSeek -- execute one of these two seek functions++ writeIORef haByteBuffer bbuf{ bufL=0, bufR=0, bufOffset=offset }+ -- ---------------------------------------------------------------------------- -- Making Handles -mkHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev- -> FilePath- -> HandleType- -> Bool -- buffered?- -> Maybe TextEncoding- -> NewlineMode- -> Maybe HandleFinalizer- -> Maybe (MVar Handle__)- -> IO Handle+{- Note [Making offsets for append]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -mkHandle dev filepath ha_type buffered mb_codec nl finalizer other_side = do+ The WINIO subysstem keeps track of offsets for handles+ on the Haskell side of things instead of letting the OS+ handle it. This requires us to establish the correct offset+ for a handle on creation. This is usually zero but slightly+ more tedious for append modes. There we fall back on IODevice+ functionality to establish the size of the file and then set+ the offset accordingly. This is only required for WINIO.+-}++mkHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev+ -> FilePath+ -> HandleType+ -> Bool -- buffered?+ -> Maybe TextEncoding+ -> NewlineMode+ -> Maybe HandleFinalizer+ -> Maybe (MVar Handle__)+ -> IO Handle+mkHandle dev filepath ha_type buffered mb_codec nl finalizer other_side = openTextEncoding mb_codec ha_type $ \ mb_encoder mb_decoder -> do - let buf_state = initBufferState ha_type- bbuf <- Buffered.newBuffer dev buf_state+ let !buf_state = initBufferState ha_type+ !bbuf_no_offset <- (Buffered.newBuffer dev buf_state)+ !buf_offset <- initHandleOffset+ let !bbuf = bbuf_no_offset { bufOffset = buf_offset}+ bbufref <- newIORef bbuf last_decode <- newIORef (errorWithoutStackTrace "codec_state", bbuf) @@ -635,6 +674,7 @@ else mkUnBuffer buf_state spares <- newIORef BufferListNil+ debugIO $ "making handle for " ++ filepath newFileHandle filepath finalizer (Handle__ { haDevice = dev, haType = ha_type,@@ -650,9 +690,17 @@ haOutputNL = outputNL nl, haOtherSide = other_side })+ where+ -- See Note [Making offsets for append]+ initHandleOffset+ | isAppendHandleType ha_type+ , isWindowsNativeIO = do+ size <- IODevice.getSize dev+ return (fromIntegral size :: Word64)+ | otherwise = return 0 -- | makes a new 'Handle'-mkFileHandle :: (IODevice dev, BufferedIO dev, Typeable dev)+mkFileHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -- ^ the underlying IO device, which must support -- 'IODevice', 'BufferedIO' and 'Typeable' -> FilePath@@ -673,7 +721,7 @@ -- | like 'mkFileHandle', except that a 'Handle' is created with two -- independent buffers, one for reading and one for writing. Used for -- full-duplex streams, such as network sockets.-mkDuplexHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev+mkDuplexHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => dev -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle mkDuplexHandle dev filepath mb_codec tr_newlines = do @@ -805,6 +853,7 @@ -- debugging debugIO :: String -> IO ()+-- debugIO s = traceEventIO s debugIO s | c_DEBUG_DUMP = do _ <- withCStringLen (s ++ "\n") $@@ -812,6 +861,13 @@ return () | otherwise = return () +-- For development, like debugIO but always on.+traceIO :: String -> IO ()+traceIO s = do+ _ <- withCStringLen (s ++ "\n") $+ \(p, len) -> c_write 1 (castPtr p) (fromIntegral len)+ return ()+ -- ---------------------------------------------------------------------------- -- Text input/output @@ -839,7 +895,9 @@ bbuf1 <- if not (isEmptyBuffer bbuf0) then return bbuf0 else do+ debugIO $ "readBuf at " ++ show (bufferOffset bbuf0) (r,bbuf1) <- Buffered.fillReadBuffer haDevice bbuf0+ debugIO $ "readBuf after " ++ show (bufferOffset bbuf1) if r == 0 then ioe_EOF else do -- raise EOF return bbuf1
GHC/IO/Handle/Lock.hs view
@@ -44,7 +44,7 @@ -- 2) The implementation uses 'LockFileEx' on Windows and 'flock' otherwise, -- hence all of their caveats also apply here. ----- 3) On non-Windows plaftorms that don't support 'flock' (e.g. Solaris) this+-- 3) On non-Windows platforms that don't support 'flock' (e.g. Solaris) this -- function throws 'FileLockingNotImplemented'. We deliberately choose to not -- provide fcntl based locking instead because of its broken semantics. --
GHC/IO/Handle/Lock/Windows.hsc view
@@ -13,32 +13,60 @@ import GHC.Base () -- Make implicit dependency known to build system #else -#if defined(i386_HOST_ARCH)-## define WINDOWS_CCONV stdcall-#elif defined(x86_64_HOST_ARCH)-## define WINDOWS_CCONV ccall-#else-# error Unknown mingw32 arch-#endif-+##include <windows_cconv.h> #include <windows.h> import Data.Bits import Data.Function+import GHC.IO.Handle.Windows (handleToHANDLE) import Foreign.C.Error import Foreign.C.Types import Foreign.Marshal.Alloc import Foreign.Marshal.Utils import GHC.Base+import qualified GHC.Event.Windows as Mgr+import GHC.Event.Windows (LPOVERLAPPED, withOverlapped) import GHC.IO.FD import GHC.IO.Handle.FD import GHC.IO.Handle.Types (Handle) import GHC.IO.Handle.Lock.Common (LockMode(..))-import GHC.Ptr+import GHC.IO.SubSystem import GHC.Windows lockImpl :: Handle -> String -> LockMode -> Bool -> IO Bool-lockImpl h ctx mode block = do+lockImpl = lockImplPOSIX <!> lockImplWinIO++lockImplWinIO :: Handle -> String -> LockMode -> Bool -> IO Bool+lockImplWinIO h ctx mode block = do+ wh <- handleToHANDLE h+ fix $ \retry ->+ do retcode <- Mgr.withException ctx $+ withOverlapped ctx wh 0 (startCB wh) completionCB+ case () of+ _ | retcode == #{const ERROR_OPERATION_ABORTED} -> retry+ | retcode == #{const ERROR_SUCCESS} -> return True+ | retcode == #{const ERROR_LOCK_VIOLATION} && not block+ -> return False+ | otherwise -> failWith ctx retcode+ where+ cmode = case mode of+ SharedLock -> 0+ ExclusiveLock -> #{const LOCKFILE_EXCLUSIVE_LOCK}+ flags = if block+ then cmode+ else cmode .|. #{const LOCKFILE_FAIL_IMMEDIATELY}++ startCB wh lpOverlapped = do+ ret <- c_LockFileEx wh flags 0 #{const INFINITE} #{const INFINITE}+ lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err _dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess 0+ | otherwise = Mgr.ioFailed err++lockImplPOSIX :: Handle -> String -> LockMode -> Bool -> IO Bool+lockImplPOSIX h ctx mode block = do FD{fdFD = fd} <- handleToFd h wh <- throwErrnoIf (== iNVALID_HANDLE_VALUE) ctx $ c_get_osfhandle fd allocaBytes sizeof_OVERLAPPED $ \ovrlpd -> do@@ -49,12 +77,13 @@ -- "locking a region that goes beyond the current end-of-file position is -- not an error", hence we pass maximum value as the number of bytes to -- lock.- fix $ \retry -> c_LockFileEx wh flags 0 0xffffffff 0xffffffff ovrlpd >>= \case+ fix $ \retry -> c_LockFileEx wh flags 0 #{const INFINITE} #{const INFINITE}+ ovrlpd >>= \case True -> return True False -> getLastError >>= \err -> if | not block && err == #{const ERROR_LOCK_VIOLATION} -> return False- | err == #{const ERROR_OPERATION_ABORTED} -> retry- | otherwise -> failWith ctx err+ | err == #{const ERROR_OPERATION_ABORTED} -> retry+ | otherwise -> failWith ctx err where sizeof_OVERLAPPED = #{size OVERLAPPED} @@ -63,12 +92,31 @@ ExclusiveLock -> #{const LOCKFILE_EXCLUSIVE_LOCK} unlockImpl :: Handle -> IO ()-unlockImpl h = do+unlockImpl = unlockImplPOSIX <!> unlockImplWinIO++unlockImplWinIO :: Handle -> IO ()+unlockImplWinIO h = do+ wh <- handleToHANDLE h+ _ <- Mgr.withException "unlockImpl" $+ withOverlapped "unlockImpl" wh 0 (startCB wh) completionCB+ return ()+ where+ startCB wh lpOverlapped = do+ ret <- c_UnlockFileEx wh 0 #{const INFINITE} #{const INFINITE}+ lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err _dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess 0+ | otherwise = Mgr.ioFailed err++unlockImplPOSIX :: Handle -> IO ()+unlockImplPOSIX h = do FD{fdFD = fd} <- handleToFd h wh <- throwErrnoIf (== iNVALID_HANDLE_VALUE) "hUnlock" $ c_get_osfhandle fd allocaBytes sizeof_OVERLAPPED $ \ovrlpd -> do fillBytes ovrlpd 0 sizeof_OVERLAPPED- c_UnlockFileEx wh 0 0xffffffff 0xffffffff ovrlpd >>= \case+ c_UnlockFileEx wh 0 #{const INFINITE} #{const INFINITE} ovrlpd >>= \case True -> return () False -> getLastError >>= failWith "hUnlock" where@@ -80,10 +128,11 @@ -- https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203.aspx foreign import WINDOWS_CCONV interruptible "LockFileEx"- c_LockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> DWORD -> Ptr () -> IO BOOL+ c_LockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED+ -> IO BOOL -- https://msdn.microsoft.com/en-us/library/windows/desktop/aa365716.aspx foreign import WINDOWS_CCONV interruptible "UnlockFileEx"- c_UnlockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> Ptr () -> IO BOOL+ c_UnlockFileEx :: HANDLE -> DWORD -> DWORD -> DWORD -> LPOVERLAPPED -> IO BOOL #endif
GHC/IO/Handle/Text.hs view
@@ -6,7 +6,6 @@ , NondecreasingIndentation , MagicHash #-}-{-# OPTIONS_GHC -Wno-name-shadowing #-} {-# OPTIONS_GHC -Wno-unused-matches #-} {-# OPTIONS_HADDOCK not-home #-} @@ -28,11 +27,10 @@ hWaitForInput, hGetChar, hGetLine, hGetContents, hPutChar, hPutStr, commitBuffer', -- hack, see below hGetBuf, hGetBufSome, hGetBufNonBlocking, hPutBuf, hPutBufNonBlocking,- memcpy, hPutStrLn,+ memcpy, hPutStrLn, hGetContents', ) where import GHC.IO-import GHC.IO.FD import GHC.IO.Buffer import qualified GHC.IO.BufferedIO as Buffered import GHC.IO.Exception@@ -46,8 +44,8 @@ import Foreign.C import qualified Control.Exception as Exception-import Data.Typeable import System.IO.Error+import Data.Either (Either(..)) import Data.Maybe import GHC.IORef@@ -453,6 +451,90 @@ _otherwise -> return buf +-- -----------------------------------------------------------------------------+-- hGetContents'++-- We read everything into a list of CharBuffer chunks, and convert it lazily+-- to a string, which minimizes memory usage.+-- In the worst case, space usage is at most that of the complete String,+-- as the chunks can be garbage collected progressively.+-- For streaming consumers, space usage is at most that of the list of chunks.++-- | The 'hGetContents'' operation reads all input on the given handle+-- before returning it as a 'String' and closing the handle.+--+-- @since 4.15.0.0++hGetContents' :: Handle -> IO String+hGetContents' handle = do+ es <- wantReadableHandle "hGetContents'" handle (strictRead handle)+ case es of+ Right s -> return s+ Left e ->+ case fromException e of+ Just ioe -> throwIO (augmentIOError ioe "hGetContents'" handle)+ Nothing -> throwIO e++strictRead :: Handle -> Handle__ -> IO (Handle__, Either SomeException String)+strictRead h handle_@Handle__{..} = do+ cbuf <- readIORef haCharBuffer+ cbufs <- strictReadLoop' handle_ [] cbuf+ (handle_', me) <- hClose_help handle_+ case me of+ Just e -> return (handle_', Left e)+ Nothing -> do+ s <- lazyBuffersToString haInputNL cbufs ""+ return (handle_', Right s)++strictReadLoop :: Handle__ -> [CharBuffer] -> CharBuffer -> IO [CharBuffer]+strictReadLoop handle_ cbufs cbuf0 = do+ mcbuf <- Exception.catch+ (do r <- readTextDevice handle_ cbuf0+ return (Just r))+ (\e -> if isEOFError e+ then return Nothing+ else throw e)+ case mcbuf of+ Nothing -> return (cbuf0 : cbufs)+ Just cbuf1 -> strictReadLoop' handle_ cbufs cbuf1++-- If 'cbuf' is full, allocate a new buffer.+strictReadLoop' :: Handle__ -> [CharBuffer] -> CharBuffer -> IO [CharBuffer]+strictReadLoop' handle_ cbufs cbuf+ | isFullCharBuffer cbuf = do+ cbuf' <- newCharBuffer dEFAULT_CHAR_BUFFER_SIZE ReadBuffer+ strictReadLoop handle_ (cbuf : cbufs) cbuf'+ | otherwise = strictReadLoop handle_ cbufs cbuf++-- Lazily convert a list of buffers to a String. The buffers are+-- in reverse order: the first buffer is the end of the String.+lazyBuffersToString :: Newline -> [CharBuffer] -> String -> IO String+lazyBuffersToString LF = loop where+ loop [] s = return s+ loop (Buffer{..} : cbufs) s = do+ s' <- unsafeInterleaveIO (unpack bufRaw bufL bufR s)+ loop cbufs s'+lazyBuffersToString CRLF = loop '\0' where+ loop before [] s = return s+ loop before (Buffer{..} : cbufs) s+ | bufL == bufR = loop before cbufs s -- skip empty buffers+ | otherwise = do+ -- When a CRLF is broken across two buffers, we already have a newline+ -- from decoding the LF, so we ignore the CR in the current buffer.+ s1 <- if before == '\n'+ then return s+ else do+ -- We restore trailing CR not followed by LF.+ c <- peekCharBuf bufRaw (bufR - 1)+ if c == '\r'+ then return ('\r' : s)+ else return s+ s2 <- unsafeInterleaveIO (do+ (s2, _) <- unpack_nl bufRaw bufL bufR s1+ return s2)+ c0 <- peekCharBuf bufRaw bufL+ loop c0 cbufs s2+ -- --------------------------------------------------------------------------- -- hPutChar @@ -493,9 +575,9 @@ LineBuffering -> True _ -> False - putc buf@Buffer{ bufRaw=raw, bufR=w } c = do+ putc buf@Buffer{ bufRaw=raw, bufR=w } c' = do debugIO ("putc: " ++ summaryBuffer buf)- w' <- writeCharBuf raw w c+ w' <- writeCharBuf raw w c' return buf{ bufR = w' } -- ---------------------------------------------------------------------------@@ -559,6 +641,7 @@ hPutChars _ [] = return () hPutChars handle (c:cs) = hPutChar handle c >> hPutChars handle cs +-- Buffer offset is always zero. getSpareBuffer :: Handle__ -> IO (BufferMode, CharBuffer) getSpareBuffer Handle__{haCharBuffer=ref, haBuffers=spare_ref,@@ -618,7 +701,6 @@ -- -- Write the contents of the buffer 'buf' ('sz' bytes long, containing -- 'count' bytes of data) to handle (handle must be block or line buffered).- commitBuffer :: Handle -- handle to commit to -> RawCharBuffer -> Int -- address and size (in bytes) of buffer@@ -630,9 +712,10 @@ commitBuffer hdl !raw !sz !count flush release = wantWritableHandle "commitBuffer" hdl $ \h_@Handle__{..} -> do debugIO ("commitBuffer: sz=" ++ show sz ++ ", count=" ++ show count- ++ ", flush=" ++ show flush ++ ", release=" ++ show release)+ ++ ", flush=" ++ show flush ++ ", release=" ++ show release ++ ", handle=" ++ show hdl) - writeCharBuffer h_ Buffer{ bufRaw=raw, bufState=WriteBuffer,+ -- Offset taken from handle+ writeCharBuffer h_ Buffer{ bufRaw=raw, bufState=WriteBuffer, bufOffset=0, bufL=0, bufR=count, bufSize=sz } when flush $ flushByteWriteBuffer h_@@ -645,6 +728,8 @@ spare_bufs <- readIORef haBuffers writeIORef haBuffers (BufferListCons raw spare_bufs) + -- bb <- readIORef haByteBuffer+ -- debugIO ("commitBuffer: buffer=" ++ summaryBuffer bb ++ ", handle=" ++ show hdl) return () -- backwards compatibility; the text package uses this@@ -656,7 +741,7 @@ ++ ", flush=" ++ show flush ++ ", release=" ++ show release) let this_buf = Buffer{ bufRaw=raw, bufState=WriteBuffer,- bufL=0, bufR=count, bufSize=sz }+ bufL=0, bufR=count, bufSize=sz, bufOffset=0 } writeCharBuffer h_ this_buf @@ -731,64 +816,81 @@ _line_or_no_buffering -> do flushWriteBuffer h_ return r +-- TODO: Possible optimisation:+-- If we know that `w + count > size`, we should write both the+-- handle buffer and the `ptr` in a single `writev()` syscall. bufWrite :: Handle__-> Ptr Word8 -> Int -> Bool -> IO Int-bufWrite h_@Handle__{..} ptr count can_block =- seq count $ do -- strictness hack- old_buf@Buffer{ bufRaw=old_raw, bufR=w, bufSize=size }- <- readIORef haByteBuffer-- -- TODO: Possible optimisation:- -- If we know that `w + count > size`, we should write both the- -- handle buffer and the `ptr` in a single `writev()` syscall.+bufWrite h_@Handle__{..} ptr !count can_block = do+ -- Get buffer to determine size and free space in buffer+ old_buf@Buffer{ bufR=w, bufSize=size }+ <- readIORef haByteBuffer - -- Need to buffer and enough room in handle buffer?- -- There's no need to buffer if the data to be written is larger than+ -- There's no need to buffer if the incoming data is larger than -- the handle buffer (`count >= size`).- if (count < size && count <= size - w)- -- We need to buffer and there's enough room in the buffer:- -- just copy the data in and update bufR.- then do debugIO ("hPutBuf: copying to buffer, w=" ++ show w)- copyToRawBuffer old_raw w ptr count- let copied_buf = old_buf{ bufR = w + count }- -- If the write filled the buffer completely, we need to flush,- -- to maintain the "INVARIANTS on Buffers" from- -- GHC.IO.Buffer.checkBuffer: "a write buffer is never full".- if (count == size - w)- then do- debugIO "hPutBuf: flushing full buffer after writing"- flushed_buf <- Buffered.flushWriteBuffer haDevice copied_buf- -- TODO: we should do a non-blocking flush here- writeIORef haByteBuffer flushed_buf- else do- writeIORef haByteBuffer copied_buf- return count+ -- Check if we can try to buffer the given chunk of data.+ b <- if (count < size && count <= size - w)+ then bufferChunk h_ old_buf ptr count+ else do+ -- The given data does not fit into the buffer.+ -- Either because it's too large for the buffer+ -- or the buffer is too full. Either way we need+ -- to flush the buffered data first.+ flushed_buf <- flushByteWriteBufferGiven h_ old_buf+ if count < size+ -- The data is small enough to be buffered.+ then bufferChunk h_ flushed_buf ptr count+ else do+ let offset = bufOffset flushed_buf+ !bytes <- if can_block+ then do writeChunk h_ (castPtr ptr) offset count+ else writeChunkNonBlocking h_ (castPtr ptr) offset count+ -- Update buffer with actual bytes written.+ writeIORef haByteBuffer $! bufferAddOffset bytes flushed_buf+ return bytes+ debugIO "hPutBuf: done"+ return b - -- else, we have to flush any existing handle buffer data- -- and can then write out the data in `ptr` directly.- else do -- No point flushing when there's nothing in the buffer.- when (w > 0) $ do- debugIO "hPutBuf: flushing first"- flushed_buf <- Buffered.flushWriteBuffer haDevice old_buf- -- TODO: we should do a non-blocking flush here- writeIORef haByteBuffer flushed_buf- -- if we can fit in the buffer, then just loop- if count < size- then bufWrite h_ ptr count can_block- else if can_block- then do writeChunk h_ (castPtr ptr) count- return count- else writeChunkNonBlocking h_ (castPtr ptr) count+-- Flush the given buffer via the handle, return the flushed buffer+flushByteWriteBufferGiven :: Handle__ -> Buffer Word8 -> IO (Buffer Word8)+flushByteWriteBufferGiven h_@Handle__{..} bbuf = do+ if (not (isEmptyBuffer bbuf))+ then do+ bbuf' <- Buffered.flushWriteBuffer haDevice bbuf+ debugIO ("flushByteWriteBufferGiven: bbuf=" ++ summaryBuffer bbuf')+ writeIORef haByteBuffer bbuf'+ return bbuf'+ else+ return bbuf -writeChunk :: Handle__ -> Ptr Word8 -> Int -> IO ()-writeChunk h_@Handle__{..} ptr bytes- | Just fd <- cast haDevice = RawIO.write (fd::FD) ptr bytes- | otherwise = error "Todo: hPutBuf"+-- Fill buffer and return bytes buffered/written.+-- Flushes buffer if it's full after adding the data.+bufferChunk :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> IO Int+bufferChunk h_@Handle__{..} old_buf@Buffer{ bufRaw=raw, bufR=w, bufSize=size } ptr !count = do+ debugIO ("hPutBuf: copying to buffer, w=" ++ show w)+ copyToRawBuffer raw w ptr count+ let copied_buf = old_buf{ bufR = w + count }+ -- If the write filled the buffer completely, we need to flush,+ -- to maintain the "INVARIANTS on Buffers" from+ -- GHC.IO.Buffer.checkBuffer: "a write buffer is never full".+ if isFullBuffer copied_buf+ then do+ -- TODO: we should do a non-blocking flush here+ debugIO "hPutBuf: flushing full buffer after writing"+ _ <- flushByteWriteBufferGiven h_ copied_buf+ return ()+ else do+ writeIORef haByteBuffer copied_buf+ return count -writeChunkNonBlocking :: Handle__ -> Ptr Word8 -> Int -> IO Int-writeChunkNonBlocking h_@Handle__{..} ptr bytes- | Just fd <- cast haDevice = RawIO.writeNonBlocking (fd::FD) ptr bytes- | otherwise = error "Todo: hPutBuf"+writeChunk :: Handle__ -> Ptr Word8 -> Word64 -> Int -> IO Int+writeChunk h_@Handle__{..} ptr offset bytes+ = do RawIO.write haDevice ptr offset bytes+ return bytes +writeChunkNonBlocking :: Handle__ -> Ptr Word8 -> Word64 -> Int -> IO Int+writeChunkNonBlocking h_@Handle__{..} ptr offset bytes+ = RawIO.writeNonBlocking haDevice ptr offset bytes+ -- --------------------------------------------------------------------------- -- hGetBuf @@ -813,12 +915,16 @@ | count < 0 = illegalBufferSize h "hGetBuf" count | otherwise = wantReadableHandle_ "hGetBuf" h $ \ h_@Handle__{..} -> do- flushCharReadBuffer h_- buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+ debugIO $ ":: hGetBuf - " ++ show h ++ " - " ++ show count+ flushCharReadBuffer h_+ buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz } <- readIORef haByteBuffer- if isEmptyBuffer buf- then bufReadEmpty h_ buf (castPtr ptr) 0 count- else bufReadNonEmpty h_ buf (castPtr ptr) 0 count+ debugIO ("hGetBuf: " ++ summaryBuffer buf)+ res <- if isEmptyBuffer buf+ then bufReadEmpty h_ buf (castPtr ptr) 0 count+ else bufReadNonEmpty h_ buf (castPtr ptr) 0 count+ debugIO "** hGetBuf done."+ return res -- small reads go through the buffer, large reads are satisfied by -- taking data first from the buffer and then direct from the file@@ -826,9 +932,14 @@ bufReadNonEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int bufReadNonEmpty h_@Handle__{..}+ -- w for width, r for ... read ptr? buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz } ptr !so_far !count = do+ debugIO ":: bufReadNonEmpty"+ -- We use < instead of <= because for count == avail+ -- we need to reset bufL and bufR to zero.+ -- See also: INVARIANTS on Buffers let avail = w - r if (count < avail) then do@@ -844,30 +955,47 @@ so_far' = so_far + avail ptr' = ptr `plusPtr` avail - if remaining == 0+ debugIO ("bufReadNonEmpty: " ++ summaryBuffer buf' ++ " s:" ++ show so_far' ++ " r:" ++ show remaining)+ b <- if remaining == 0 then return so_far' else bufReadEmpty h_ buf' ptr' so_far' remaining-+ debugIO ":: bufReadNonEmpty - done"+ return b +-- We want to read more data, but the buffer is empty. (buffL == buffR == 0)+-- See also Note [INVARIANTS on Buffers] in Buffer.hs bufReadEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int bufReadEmpty h_@Handle__{..}- buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+ buf@Buffer{ bufRaw=raw, bufR=w, bufL=_r, bufSize=sz, bufOffset=bff } ptr so_far count- | count > sz, Just fd <- cast haDevice = loop fd 0 count+ | count > sz+ = do+ bytes_read <- loop haDevice 0 bff count+ -- bytes_read includes so_far (content that was in the buffer)+ -- but that is already accounted for in the old offset, so don't+ -- count it twice.+ let buf1 = bufferAddOffset (fromIntegral $ bytes_read - so_far) buf+ writeIORef haByteBuffer buf1+ debugIO ("bufReadEmpty1.1: " ++ summaryBuffer buf1 ++ " read:" ++ show bytes_read)+ return bytes_read | otherwise = do- (r,buf') <- Buffered.fillReadBuffer haDevice buf- if r == 0- then return so_far- else do writeIORef haByteBuffer buf'- bufReadNonEmpty h_ buf' ptr so_far count+ (r,buf') <- Buffered.fillReadBuffer haDevice buf+ writeIORef haByteBuffer buf'+ if r == 0 -- end of file reached+ then return so_far+ else bufReadNonEmpty h_ buf' ptr so_far count where- loop :: FD -> Int -> Int -> IO Int- loop fd off bytes | bytes <= 0 = return (so_far + off)- loop fd off bytes = do- r <- RawIO.read (fd::FD) (ptr `plusPtr` off) bytes+ -- Read @bytes@ byte into ptr. Repeating the read until either zero+ -- bytes where read, or we are done reading.+ loop :: RawIO.RawIO dev => dev -> Int -> Word64 -> Int -> IO Int+ loop dev delta off bytes | bytes <= 0 = return (so_far + delta)+ loop dev delta off bytes = do+ r <- RawIO.read dev (ptr `plusPtr` delta) off bytes+ debugIO $ show ptr ++ " - loop read@" ++ show delta ++ ": " ++ show r+ debugIO $ "next:" ++ show (delta + r) ++ " - left:" ++ show (bytes - r) if r == 0- then return (so_far + off)- else loop fd (off + r) (bytes - r)+ then return (so_far + delta)+ else loop dev (delta + r) (off + fromIntegral r) (bytes - r) -- --------------------------------------------------------------------------- -- hGetBufSome@@ -896,10 +1024,13 @@ | otherwise = wantReadableHandle_ "hGetBufSome" h $ \ h_@Handle__{..} -> do flushCharReadBuffer h_- buf@Buffer{ bufSize=sz } <- readIORef haByteBuffer+ buf@Buffer{ bufSize=sz, bufOffset=offset } <- readIORef haByteBuffer if isEmptyBuffer buf then case count > sz of -- large read? optimize it with a little special case:- True | Just fd <- haFD h_ -> do RawIO.read fd (castPtr ptr) count+ True -> do bytes <- RawIO.read haDevice (castPtr ptr) offset count+ -- Update buffer with actual bytes written.+ writeIORef haByteBuffer $! bufferAddOffset bytes buf+ return bytes _ -> do (r,buf') <- Buffered.fillReadBuffer haDevice buf if r == 0 then return 0@@ -912,9 +1043,6 @@ let count' = min count (bufferElems buf) in bufReadNBNonEmpty h_ buf (castPtr ptr) 0 count' -haFD :: Handle__ -> Maybe FD-haFD h_@Handle__{..} = cast haDevice- -- | 'hGetBufNonBlocking' @hdl buf count@ reads data from the handle @hdl@ -- into the buffer @buf@ until either EOF is reached, or -- @count@ 8-bit bytes have been read, or there is no more data available@@ -949,25 +1077,27 @@ bufReadNBEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int bufReadNBEmpty h_@Handle__{..}- buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+ buf@Buffer{ bufRaw=raw, bufR=w, bufL=_r, bufSize=sz+ , bufOffset=offset } ptr so_far count- | count > sz,- Just fd <- cast haDevice = do- m <- RawIO.readNonBlocking (fd::FD) ptr count+ | count > sz = do+ m <- RawIO.readNonBlocking haDevice ptr offset count case m of Nothing -> return so_far- Just n -> return (so_far + n)+ Just n -> do -- Update buffer with actual bytes written.+ writeIORef haByteBuffer $! bufferAddOffset n buf+ return (so_far + n) | otherwise = do- buf <- readIORef haByteBuffer+ -- buf <- readIORef haByteBuffer (r,buf') <- Buffered.fillReadBuffer0 haDevice buf case r of Nothing -> return so_far Just 0 -> return so_far- Just r -> do+ Just r' -> do writeIORef haByteBuffer buf'- bufReadNBNonEmpty h_ buf' ptr so_far (min count r)- -- NOTE: new count is min count r+ bufReadNBNonEmpty h_ buf' ptr so_far (min count r')+ -- NOTE: new count is min count r' -- so we will just copy the contents of the -- buffer in the recursive call, and not -- loop again.@@ -979,6 +1109,9 @@ ptr so_far count = do let avail = w - r+ -- We use < instead of <= because for count == avail+ -- we need to reset bufL and bufR to zero.+ -- See also [INVARIANTS on Buffers] in Buffer.hs if (count < avail) then do copyFromRawBuffer ptr raw r count
GHC/IO/Handle/Types.hs view
@@ -26,6 +26,7 @@ BufferList(..), HandleType(..), isReadableHandleType, isWritableHandleType, isReadWriteHandleType,+ isAppendHandleType, BufferMode(..), BufferCodec(..), NewlineMode(..), Newline(..), nativeNewline,@@ -119,13 +120,14 @@ _ == _ = False data Handle__- = forall dev enc_state dec_state . (IODevice dev, BufferedIO dev, Typeable dev) =>+ = forall dev enc_state dec_state . (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev) => Handle__ { haDevice :: !dev, haType :: HandleType, -- type (read/write/append etc.) haByteBuffer :: !(IORef (Buffer Word8)), -- See [note Buffering Implementation] haBufferMode :: BufferMode, haLastDecode :: !(IORef (dec_state, Buffer Word8)),+ -- ^ The byte buffer just before we did our last batch of decoding. haCharBuffer :: !(IORef (Buffer CharBufElem)), -- See [note Buffering Implementation] haBuffers :: !(IORef (BufferList CharBufElem)), -- spare buffers haEncoder :: Maybe (TextEncoder enc_state),@@ -170,6 +172,11 @@ isReadWriteHandleType ReadWriteHandle{} = True isReadWriteHandleType _ = False +isAppendHandleType :: HandleType -> Bool+isAppendHandleType AppendHandle = True+isAppendHandleType _ = False++ -- INVARIANTS on Handles: -- -- * A handle *always* has a buffer, even if it is only 1 character long@@ -386,7 +393,7 @@ #endif -- | Map @\'\\r\\n\'@ into @\'\\n\'@ on input, and @\'\\n\'@ to the native newline--- represetnation on output. This mode can be used on any platform, and+-- representation on output. This mode can be used on any platform, and -- works with text files using any newline convention. The downside is -- that @readFile >>= writeFile@ might yield a different file. --
+ GHC/IO/Handle/Windows.hs view
@@ -0,0 +1,235 @@+ {-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP, NoImplicitPrelude #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.Handle.Windows+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-- Handle operations implemented by Windows native handles+--+-----------------------------------------------------------------------------++module GHC.IO.Handle.Windows (+ stdin, stdout, stderr,+ openFile, openBinaryFile, openFileBlocking,+ handleToHANDLE, mkHandleFromHANDLE+ ) where++import Data.Maybe+import Data.Typeable++import GHC.Base+import GHC.MVar+import GHC.IO+import GHC.IO.BufferedIO hiding (flushWriteBuffer)+import GHC.IO.Encoding+import GHC.IO.Device as IODevice+import GHC.IO.Exception+import GHC.IO.IOMode+import GHC.IO.Handle.Types+import GHC.IO.Handle.Internals+import qualified GHC.IO.Windows.Handle as Win++-- ---------------------------------------------------------------------------+-- Standard Handles++-- Three handles are allocated during program initialisation. The first+-- two manage input or output from the Haskell program's standard input+-- or output channel respectively. The third manages output to the+-- standard error channel. These handles are initially open.++-- | If the std handles are redirected to file handles then WriteConsole etc+-- won't work anymore. When the handle is created test it and if it's a file+-- handle then just convert it to the proper IODevice so WriteFile is used+-- instead. This is done here so it's buffered and only happens once.+mkConsoleHandle :: Win.IoHandle Win.ConsoleHandle+ -> FilePath+ -> HandleType+ -> Bool -- buffered?+ -> Maybe TextEncoding+ -> NewlineMode+ -> Maybe HandleFinalizer+ -> Maybe (MVar Handle__)+ -> IO Handle+mkConsoleHandle dev filepath ha_type buffered mb_codec nl finalizer other_side+ = do isTerm <- IODevice.isTerminal dev+ case isTerm of+ True -> mkHandle dev filepath ha_type buffered mb_codec nl finalizer+ other_side+ False -> mkHandle (Win.convertHandle dev) filepath ha_type buffered+ mb_codec nl finalizer other_side++-- | A handle managing input from the Haskell program's standard input channel.+stdin :: Handle+{-# NOINLINE stdin #-}+stdin = unsafePerformIO $ do+ enc <- getLocaleEncoding+ mkConsoleHandle Win.stdin "<stdin>" ReadHandle True (Just enc)+ nativeNewlineMode{-translate newlines-}+ (Just stdHandleFinalizer) Nothing++-- | A handle managing output to the Haskell program's standard output channel.+stdout :: Handle+{-# NOINLINE stdout #-}+stdout = unsafePerformIO $ do+ enc <- getLocaleEncoding+ mkConsoleHandle Win.stdout "<stdout>" WriteHandle True (Just enc)+ nativeNewlineMode{-translate newlines-}+ (Just stdHandleFinalizer) Nothing++-- | A handle managing output to the Haskell program's standard error channel.+stderr :: Handle+{-# NOINLINE stderr #-}+stderr = unsafePerformIO $ do+ enc <- getLocaleEncoding+ mkConsoleHandle Win.stderr "<stderr>" WriteHandle+ False{-stderr is unbuffered-} (Just enc)+ nativeNewlineMode{-translate newlines-}+ (Just stdHandleFinalizer) Nothing++stdHandleFinalizer :: FilePath -> MVar Handle__ -> IO ()+stdHandleFinalizer fp m = do+ h_ <- takeMVar m+ flushWriteBuffer h_+ case haType h_ of+ ClosedHandle -> return ()+ _other -> closeTextCodecs h_+ putMVar m (ioe_finalizedHandle fp)++-- ---------------------------------------------------------------------------+-- Opening and Closing Files++addFilePathToIOError :: String -> FilePath -> IOException -> IOException+addFilePathToIOError fun fp ioe+ = ioe{ ioe_location = fun, ioe_filename = Just fp }++-- | Computation 'openFile' @file mode@ allocates and returns a new, open+-- handle to manage the file @file@. It manages input if @mode@+-- is 'ReadMode', output if @mode@ is 'WriteMode' or 'AppendMode',+-- and both input and output if mode is 'ReadWriteMode'.+--+-- If the file does not exist and it is opened for output, it should be+-- created as a new file. If @mode@ is 'WriteMode' and the file+-- already exists, then it should be truncated to zero length.+-- Some operating systems delete empty files, so there is no guarantee+-- that the file will exist following an 'openFile' with @mode@+-- 'WriteMode' unless it is subsequently written to successfully.+-- The handle is positioned at the end of the file if @mode@ is+-- 'AppendMode', and otherwise at the beginning (in which case its+-- internal position is 0).+-- The initial buffer mode is implementation-dependent.+--+-- This operation may fail with:+--+-- * 'isAlreadyInUseError' if the file is already open and cannot be reopened;+--+-- * 'isDoesNotExistError' if the file does not exist; or+--+-- * 'isPermissionError' if the user does not have permission to open the file.+--+-- Note: if you will be working with files containing binary data, you'll want to+-- be using 'openBinaryFile'.+openFile :: FilePath -> IOMode -> IO Handle+openFile fp im =+ catchException+ (openFile' fp im dEFAULT_OPEN_IN_BINARY_MODE True)+ (\e -> ioError (addFilePathToIOError "openFile" fp e))++-- | Like 'openFile', but opens the file in ordinary blocking mode.+-- This can be useful for opening a FIFO for writing: if we open in+-- non-blocking mode then the open will fail if there are no readers,+-- whereas a blocking open will block until a reader appear.+--+-- @since 4.4.0.0+openFileBlocking :: FilePath -> IOMode -> IO Handle+openFileBlocking fp im =+ catchException+ (openFile' fp im dEFAULT_OPEN_IN_BINARY_MODE False)+ (\e -> ioError (addFilePathToIOError "openFileBlocking" fp e))++-- | Like 'openFile', but open the file in binary mode.+-- On Windows, reading a file in text mode (which is the default)+-- will translate CRLF to LF, and writing will translate LF to CRLF.+-- This is usually what you want with text files. With binary files+-- this is undesirable; also, as usual under Microsoft operating systems,+-- text mode treats control-Z as EOF. Binary mode turns off all special+-- treatment of end-of-line and end-of-file characters.+-- (See also 'hSetBinaryMode'.)++openBinaryFile :: FilePath -> IOMode -> IO Handle+openBinaryFile fp m =+ catchException+ (openFile' fp m True True)+ (\e -> ioError (addFilePathToIOError "openBinaryFile" fp e))++openFile' :: String -> IOMode -> Bool -> Bool -> IO Handle+openFile' filepath iomode binary non_blocking = do+ -- first open the file to get a Win32 handle+ (hwnd, hwnd_type) <- Win.openFile filepath iomode non_blocking++ mb_codec <- if binary then return Nothing else fmap Just getLocaleEncoding++ -- then use it to make a Handle+ mkHandleFromHANDLE hwnd hwnd_type filepath iomode mb_codec+ `onException` IODevice.close hwnd+ -- NB. don't forget to close the Handle if mkHandleFromHANDLE fails,+ -- otherwise this Handle leaks.++-- ---------------------------------------------------------------------------+-- Converting Windows Handles from/to Handles++mkHandleFromHANDLE+ :: (RawIO dev, IODevice.IODevice dev, BufferedIO dev, Typeable dev) => dev+ -> IODeviceType+ -> FilePath -- a string describing this Windows handle (e.g. the filename)+ -> IOMode+ -> Maybe TextEncoding+ -> IO Handle++mkHandleFromHANDLE dev hw_type filepath iomode mb_codec+ = do+ let nl | isJust mb_codec = nativeNewlineMode+ | otherwise = noNewlineTranslation++ case hw_type of+ Directory ->+ ioException (IOError Nothing InappropriateType "openFile"+ "is a directory" Nothing Nothing)++ Stream+ -- only *Streams* can be DuplexHandles. Other read/write+ -- Handles must share a buffer.+ | ReadWriteMode <- iomode ->+ mkDuplexHandle dev filepath mb_codec nl+++ _other -> mkFileHandle dev filepath iomode mb_codec nl++-- | Turn an existing Handle into a Win32 HANDLE. This function throws an+-- IOError if the Handle does not reference a HANDLE+handleToHANDLE :: Handle -> IO Win.HANDLE+handleToHANDLE h = case h of+ FileHandle _ mv -> do+ Handle__{haDevice = dev} <- readMVar mv+ case (cast dev :: Maybe (Win.Io Win.NativeHandle)) of+ Just hwnd -> return $ Win.toHANDLE hwnd+ Nothing -> throwErr "not a file HANDLE"+ DuplexHandle{} -> throwErr "not a file handle"+ where+ throwErr msg = ioException $ IOError (Just h)+ InappropriateType "handleToHANDLE" msg Nothing Nothing++-- ---------------------------------------------------------------------------+-- Are files opened by default in text or binary mode, if the user doesn't+-- specify? The thing is, to the Win32 APIs which are lowerlevel there exist no+-- such thing as binary/text mode. That's strictly a thing of the C library on+-- top of it. So I'm not sure what to do with this. -Tamar++dEFAULT_OPEN_IN_BINARY_MODE :: Bool+dEFAULT_OPEN_IN_BINARY_MODE = False
+ GHC/IO/StdHandles.hs view
@@ -0,0 +1,73 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.StdHandles+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-- This model abtracts away the platform specific handles that can be toggled+-- through the RTS.+--+-----------------------------------------------------------------------------++module GHC.IO.StdHandles+ ( -- std handles+ stdin, stdout, stderr,+ openFile, openBinaryFile, openFileBlocking+ ) where++import GHC.IO+import GHC.IO.IOMode+import GHC.IO.Handle.Types++import qualified GHC.IO.Handle.FD as POSIX+#if defined(mingw32_HOST_OS)+import GHC.IO.SubSystem+import qualified GHC.IO.Handle.Windows as Win++stdin :: Handle+stdin = POSIX.stdin <!> Win.stdin++stdout :: Handle+stdout = POSIX.stdout <!> Win.stdout++stderr :: Handle+stderr = POSIX.stderr <!> Win.stderr++openFile :: FilePath -> IOMode -> IO Handle+openFile = POSIX.openFile <!> Win.openFile++openBinaryFile :: FilePath -> IOMode -> IO Handle+openBinaryFile = POSIX.openBinaryFile <!> Win.openBinaryFile++openFileBlocking :: FilePath -> IOMode -> IO Handle+openFileBlocking = POSIX.openFileBlocking <!> Win.openFileBlocking++#else++stdin :: Handle+stdin = POSIX.stdin++stdout :: Handle+stdout = POSIX.stdout++stderr :: Handle+stderr = POSIX.stderr++openFile :: FilePath -> IOMode -> IO Handle+openFile = POSIX.openFile++openBinaryFile :: FilePath -> IOMode -> IO Handle+openBinaryFile = POSIX.openBinaryFile++openFileBlocking :: FilePath -> IOMode -> IO Handle+openFileBlocking = POSIX.openFileBlocking++#endif
+ GHC/IO/StdHandles.hs-boot view
@@ -0,0 +1,23 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.StdHandles [boot]+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-----------------------------------------------------------------------------++module GHC.IO.StdHandles where++import GHC.IO.Handle.Types++-- used in GHC.Conc, which is below GHC.IO.Handle.FD+stdout :: Handle+
+ GHC/IO/SubSystem.hs view
@@ -0,0 +1,79 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.SubSystem+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-- The SubSystem control interface. These methods can be used to disambiguate+-- between the two operations.+--+-----------------------------------------------------------------------------++module GHC.IO.SubSystem (+ withIoSubSystem,+ withIoSubSystem',+ whenIoSubSystem,+ ioSubSystem,+ IoSubSystem(..),+ conditional,+ (<!>),+ isWindowsNativeIO+ ) where++import GHC.Base+import GHC.RTS.Flags++#if defined(mingw32_HOST_OS)+import GHC.IO.Unsafe+#endif++infixl 7 <!>++-- | Conditionally execute an action depending on the configured I/O subsystem.+-- On POSIX systems always execute the first action.+-- On windows execute the second action if WINIO as active, otherwise fall back to+-- the first action.+conditional :: a -> a -> a+#if defined(mingw32_HOST_OS)+conditional posix windows =+ case ioSubSystem of+ IoPOSIX -> posix+ IoNative -> windows+#else+conditional posix _ = posix+#endif++-- | Infix version of `conditional`.+-- posix <!> windows == conditional posix windows+(<!>) :: a -> a -> a+(<!>) = conditional++isWindowsNativeIO :: Bool+isWindowsNativeIO = False <!> True++ioSubSystem :: IoSubSystem+#if defined(mingw32_HOST_OS)+{-# NOINLINE ioSubSystem #-}+ioSubSystem = unsafeDupablePerformIO getIoManagerFlag+#else+ioSubSystem = IoPOSIX+#endif++withIoSubSystem :: (IoSubSystem -> IO a) -> IO a+withIoSubSystem f = f ioSubSystem++withIoSubSystem' :: (IoSubSystem -> a) -> a+withIoSubSystem' f = f ioSubSystem++whenIoSubSystem :: IoSubSystem -> IO () -> IO ()+whenIoSubSystem m f = do let sub = ioSubSystem+ when (sub == m) f+
+ GHC/IO/Windows/Encoding.hs view
@@ -0,0 +1,218 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE NoImplicitPrelude #-}+{- |+ Module : System.Win32.Encoding+ Copyright : 2012 shelarcy+ License : BSD-style++ Maintainer : shelarcy@gmail.com+ Stability : Provisional+ Portability : Non-portable (Win32 API)++ Enocode/Decode mutibyte charactor using Win32 API.+-}++module GHC.IO.Windows.Encoding+ ( encodeMultiByte+ , encodeMultiByteIO+ , encodeMultiByteRawIO+ , decodeMultiByte+ , decodeMultiByteIO+ , wideCharToMultiByte+ , multiByteToWideChar+ , withGhcInternalToUTF16+ , withUTF16ToGhcInternal+ ) where++import Data.Word (Word8, Word16)+import Foreign.C.Types (CInt(..))+import Foreign.C.String (peekCAStringLen, peekCWStringLen,+ withCWStringLen, withCAStringLen, )+import Foreign.Ptr (nullPtr, Ptr ())+import Foreign.Marshal.Array (allocaArray)+import Foreign.Marshal.Unsafe (unsafeLocalState)+import GHC.Windows+import GHC.IO.Encoding.CodePage (CodePage, getCurrentCodePage)+import GHC.IO+import GHC.Base+import GHC.Real++#include "windows_cconv.h"++-- | The "System.IO" output functions (e.g. `putStr`) don't+-- automatically convert to multibyte string on Windows, so this+-- function is provided to make the conversion from a Unicode string+-- in the given code page to a proper multibyte string. To get the+-- code page for the console, use `getCurrentCodePage`.+--+encodeMultiByte :: CodePage -> String -> String+encodeMultiByte cp = unsafeLocalState . encodeMultiByteIO cp++{-# INLINE encodeMultiByteIO' #-}+-- | String must not be zero length.+encodeMultiByteIO' :: CodePage -> String -> ((LPCSTR, CInt) -> IO a) -> IO a+encodeMultiByteIO' cp wstr transformer =+ withCWStringLen wstr $ \(cwstr,len) -> do+ mbchars' <- failIfZero "WideCharToMultiByte" $ wideCharToMultiByte+ cp+ 0+ cwstr+ (fromIntegral len)+ nullPtr 0+ nullPtr nullPtr+ -- mbchar' is the length of buffer required+ allocaArray (fromIntegral mbchars') $ \mbstr -> do+ mbchars <- failIfZero "WideCharToMultiByte" $ wideCharToMultiByte+ cp+ 0+ cwstr+ (fromIntegral len)+ mbstr mbchars'+ nullPtr nullPtr+ transformer (mbstr,fromIntegral mbchars)++-- converts [Char] to UTF-16+encodeMultiByteIO :: CodePage -> String -> IO String+encodeMultiByteIO _ "" = return ""+encodeMultiByteIO cp s = encodeMultiByteIO' cp s toString+ where toString (st,l) = peekCAStringLen (st,fromIntegral l)++-- converts [Char] to UTF-16+encodeMultiByteRawIO :: CodePage -> String -> IO (LPCSTR, CInt)+encodeMultiByteRawIO _ "" = return (nullPtr, 0)+encodeMultiByteRawIO cp s = encodeMultiByteIO' cp s toSizedCString+ where toSizedCString (st,l) = return (st, fromIntegral l)++foreign import WINDOWS_CCONV "WideCharToMultiByte"+ wideCharToMultiByte+ :: CodePage+ -> DWORD -- dwFlags,+ -> LPCWSTR -- lpWideCharStr+ -> CInt -- cchWideChar+ -> LPSTR -- lpMultiByteStr+ -> CInt -- cbMultiByte+ -> LPCSTR -- lpMultiByteStr+ -> LPBOOL -- lpbFlags+ -> IO CInt++-- | The `System.IO` input functions (e.g. `getLine`) don't+-- automatically convert to Unicode, so this function is provided to+-- make the conversion from a multibyte string in the given code page+-- to a proper Unicode string. To get the code page for the console,+-- use `getConsoleCP`.+stringToUnicode :: CodePage -> String -> IO String+stringToUnicode _cp "" = return ""+ -- MultiByteToWideChar doesn't handle empty strings (#1929)+stringToUnicode cp mbstr =+ withCAStringLen mbstr $ \(cstr,len) -> do+ wchars <- failIfZero "MultiByteToWideChar" $ multiByteToWideChar+ cp+ 0+ cstr+ (fromIntegral len)+ nullPtr 0+ -- wchars is the length of buffer required+ allocaArray (fromIntegral wchars) $ \cwstr -> do+ wchars' <- failIfZero "MultiByteToWideChar" $ multiByteToWideChar+ cp+ 0+ cstr+ (fromIntegral len)+ cwstr wchars+ peekCWStringLen (cwstr,fromIntegral wchars') -- converts UTF-16 to [Char]++foreign import WINDOWS_CCONV unsafe "MultiByteToWideChar"+ multiByteToWideChar+ :: CodePage+ -> DWORD -- dwFlags,+ -> LPCSTR -- lpMultiByteStr+ -> CInt -- cbMultiByte+ -> LPWSTR -- lpWideCharStr+ -> CInt -- cchWideChar+ -> IO CInt++decodeMultiByte :: CodePage -> String -> String+decodeMultiByte cp = unsafeLocalState . decodeMultiByteIO cp++-- | Because of `stringToUnicode` is unclear name, we use `decodeMultiByteIO`+-- for alias of `stringToUnicode`.+decodeMultiByteIO :: CodePage -> String -> IO String+decodeMultiByteIO = stringToUnicode+{-# INLINE decodeMultiByteIO #-}++foreign import WINDOWS_CCONV unsafe "MultiByteToWideChar"+ multiByteToWideChar'+ :: CodePage+ -> DWORD -- dwFlags,+ -> Ptr Word8 -- lpMultiByteStr+ -> CInt -- cbMultiByte+ -> Ptr Word16 -- lpWideCharStr+ -> CInt -- cchWideChar+ -> IO CInt++-- TODO: GHC is internally UTF-32 which means we have re-encode for+-- Windows which is annoying. Switch to UTF-16 on IoNative+-- being default.+withGhcInternalToUTF16 :: Ptr Word8 -> Int -> ((Ptr Word16, CInt) -> IO a)+ -> IO a+withGhcInternalToUTF16 ptr len fn+ = do cp <- getCurrentCodePage+ wchars <- failIfZero "withGhcInternalToUTF16" $+ multiByteToWideChar' cp 0 ptr (fromIntegral len) nullPtr 0+ -- wchars is the length of buffer required+ allocaArray (fromIntegral wchars) $ \cwstr -> do+ wchars' <- failIfZero "withGhcInternalToUTF16" $+ multiByteToWideChar' cp 0 ptr (fromIntegral len) cwstr wchars+ fn (cwstr, wchars')++foreign import WINDOWS_CCONV "WideCharToMultiByte"+ wideCharToMultiByte'+ :: CodePage+ -> DWORD -- dwFlags,+ -> Ptr Word16 -- lpWideCharStr+ -> CInt -- cchWideChar+ -> Ptr Word8 -- lpMultiByteStr+ -> CInt -- cbMultiByte+ -> LPCSTR -- lpMultiByteStr+ -> LPBOOL -- lpbFlags+ -> IO CInt++-- TODO: GHC is internally UTF-32 which means we have re-encode for+-- Windows which is annoying. Switch to UTF-16 on IoNative+-- being default.++-- | Decode a UTF16 buffer into the given buffer in the current code page.+-- The source UTF16 buffer is filled by the function given as argument.+withUTF16ToGhcInternal :: Ptr Word8 -- Buffer to store the encoded string in.+ -> Int -- Length of the buffer+ -- Function to fill source buffer.+ -> ( CInt -- Size of available buffer in bytes+ -> Ptr Word16 -- Temporary source buffer.+ -> IO CInt -- Actual length of buffer content.+ )+ -> IO Int -- Returns number of bytes stored in buffer.+withUTF16ToGhcInternal ptr len fn+ = do cp <- getCurrentCodePage+ -- Annoyingly the IO system is very UTF-32 oriented and asks for bytes+ -- as buffer reads. Problem is we don't know how many bytes we'll end up+ -- having as UTF-32 MultiByte encoded UTF-16. So be conservative. We assume+ -- that a single byte may expand to atmost 1 Word16. So assume that each+ -- byte does and divide the requested number of bytes by two since each+ -- Word16 encoded wchar may expand to only two Word8 sequences.+ let reqBytes = fromIntegral (len `div` 2)+ allocaArray reqBytes $ \w_ptr -> do+ w_len <- fn (fromIntegral reqBytes) w_ptr+ if w_len == 0+ then return 0 else do+ -- Get required length of encoding+ mbchars' <- failIfZero "withUTF16ToGhcInternal" $+ wideCharToMultiByte' cp 0 w_ptr+ (fromIntegral w_len) nullPtr+ 0 nullPtr nullPtr+ assert (mbchars' <= (fromIntegral len)) $ do+ -- mbchar' is the length of buffer required+ mbchars <- failIfZero "withUTF16ToGhcInternal" $+ wideCharToMultiByte' cp 0 w_ptr+ (fromIntegral w_len) ptr+ mbchars' nullPtr nullPtr+ return $ fromIntegral mbchars
+ GHC/IO/Windows/Handle.hsc view
@@ -0,0 +1,966 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+-- Whether there are identities depends on the platform+{-# OPTIONS_HADDOCK hide #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.Windows.Handle+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-- Raw read/write operations on Windows Handles+--+-----------------------------------------------------------------------------++module GHC.IO.Windows.Handle+ ( -- * Basic Types+ NativeHandle(),+ ConsoleHandle(),+ IoHandle(),+ HANDLE,+ Io(),++ -- * Utility functions+ convertHandle,+ toHANDLE,+ fromHANDLE,+ handleToMode,+ optimizeFileAccess,++ -- * Standard Handles+ stdin,+ stdout,+ stderr,++ -- * File utilities+ openFile,+ openFileAsTemp,+ release+ ) where++#include <windows.h>+#include <ntstatus.h>+#include <winnt.h>+##include "windows_cconv.h"++-- Can't avoid these semantics leaks, they are base constructs+import Data.Bits ((.|.), (.&.), shiftL)+import Data.Functor ((<$>))+import Data.Typeable++import GHC.Base+import GHC.Enum+import GHC.Num+import GHC.Real+import GHC.List+import GHC.Word (Word8, Word16, Word64)++import GHC.IO hiding (mask)+import GHC.IO.Buffer+import GHC.IO.BufferedIO+import qualified GHC.IO.Device+import GHC.IO.Device (SeekMode(..), IODeviceType(..), IODevice(), devType, setSize)+import GHC.IO.Exception+import GHC.IO.IOMode+import GHC.IO.Windows.Encoding (withGhcInternalToUTF16, withUTF16ToGhcInternal)+import GHC.IO.Windows.Paths (getDevicePath)+import GHC.IO.Handle.Internals (debugIO)+import GHC.IORef+import GHC.Event.Windows (LPOVERLAPPED, withOverlapped, IOResult(..))+import Foreign.Ptr+import Foreign.C+import Foreign.Marshal.Array (pokeArray)+import Foreign.Marshal.Alloc (alloca, allocaBytes)+import Foreign.Marshal.Utils (with, fromBool)+import Foreign.Storable (Storable (..))+import qualified GHC.Event.Windows as Mgr++import GHC.Windows (LPVOID, LPDWORD, DWORD, HANDLE, BOOL, LPCTSTR, ULONG, WORD,+ UCHAR, failIf, iNVALID_HANDLE_VALUE, failWith,+ failIfFalse_, getLastError)+import Text.Show++-- -----------------------------------------------------------------------------+-- The Windows IO device handles++data NativeHandle+data ConsoleHandle++-- | Bit of a Hack, but we don't want every handle to have a cooked entry+-- but all copies of the handles for which we do want one need to share+-- the same value.+-- We can't store it separately because we don't know when the handle will+-- be destroyed or invalidated.+data IoHandle a where+ NativeHandle :: { getNativeHandle :: HANDLE } -> IoHandle NativeHandle+ ConsoleHandle :: { getConsoleHandle :: HANDLE+ , cookedHandle :: IORef Bool+ } -> IoHandle ConsoleHandle++type Io a = IoHandle a++-- | Convert a ConsoleHandle into a general FileHandle+-- This will change which DeviceIO is used.+convertHandle :: Io ConsoleHandle -> Io NativeHandle+convertHandle = fromHANDLE . toHANDLE++-- | @since 4.11.0.0+instance Show (Io NativeHandle) where+ show = show . toHANDLE++-- | @since 4.11.0.0+instance Show (Io ConsoleHandle) where+ show = show . getConsoleHandle++-- | @since 4.11.0.0+instance GHC.IO.Device.RawIO (Io NativeHandle) where+ read = hwndRead+ readNonBlocking = hwndReadNonBlocking+ write = hwndWrite+ writeNonBlocking = hwndWriteNonBlocking++-- | @since 4.11.0.0+instance GHC.IO.Device.RawIO (Io ConsoleHandle) where+ read = consoleRead+ readNonBlocking = consoleReadNonBlocking+ write = consoleWrite+ writeNonBlocking = consoleWriteNonBlocking++-- | Generalize a way to get and create handles.+class (GHC.IO.Device.RawIO a, IODevice a, BufferedIO a, Typeable a)+ => RawHandle a where+ toHANDLE :: a -> HANDLE+ fromHANDLE :: HANDLE -> a+ isLockable :: a -> Bool+ setCooked :: a -> Bool -> IO a+ isCooked :: a -> IO Bool++instance RawHandle (Io NativeHandle) where+ toHANDLE = getNativeHandle+ fromHANDLE = NativeHandle+ isLockable _ = True+ setCooked = const . return+ isCooked _ = return False++instance RawHandle (Io ConsoleHandle) where+ toHANDLE = getConsoleHandle+ fromHANDLE h = unsafePerformIO $ ConsoleHandle h <$> newIORef False+ isLockable _ = False+ setCooked h val =+ do writeIORef (cookedHandle h) val+ return h+ isCooked h = readIORef (cookedHandle h)++-- -----------------------------------------------------------------------------+-- The Windows IO device implementation++-- | @since 4.11.0.0+instance GHC.IO.Device.IODevice (Io NativeHandle) where+ ready = handle_ready+ close = handle_close+ isTerminal = handle_is_console+ isSeekable = handle_is_seekable+ seek = handle_seek+ tell = handle_tell+ getSize = handle_get_size+ setSize = handle_set_size+ setEcho = handle_set_echo+ getEcho = handle_get_echo+ setRaw = handle_set_buffering+ devType = handle_dev_type+ dup = handle_duplicate++-- | @since 4.11.0.0+instance GHC.IO.Device.IODevice (Io ConsoleHandle) where+ ready = handle_ready+ close = handle_close . convertHandle+ isTerminal = handle_is_console+ isSeekable = handle_is_seekable+ seek = handle_console_seek+ tell = handle_console_tell+ getSize = handle_get_console_size+ setSize = handle_set_console_size+ setEcho = handle_set_echo+ getEcho = handle_get_echo+ setRaw = console_set_buffering+ devType = handle_dev_type+ dup = handle_duplicate++-- Default sequential read buffer size.+-- for Windows 8k seems to be the optimal+-- buffer size.+dEFAULT_BUFFER_SIZE :: Int+dEFAULT_BUFFER_SIZE = 8192++-- | @since 4.11.0.0+-- See libraries/base/GHC/IO/BufferedIO.hs+instance BufferedIO (Io NativeHandle) where+ newBuffer _dev state = newByteBuffer dEFAULT_BUFFER_SIZE state+ fillReadBuffer = readBuf'+ fillReadBuffer0 = readBufNonBlocking+ flushWriteBuffer = writeBuf'+ flushWriteBuffer0 = writeBufNonBlocking++-- | @since 4.11.0.0+-- See libraries/base/GHC/IO/BufferedIO.hs+instance BufferedIO (Io ConsoleHandle) where+ newBuffer _dev state = newByteBuffer dEFAULT_BUFFER_SIZE state+ fillReadBuffer = readBuf'+ fillReadBuffer0 = readBufNonBlocking+ flushWriteBuffer = writeBuf'+ flushWriteBuffer0 = writeBufNonBlocking+++readBuf' :: RawHandle a => a -> Buffer Word8 -> IO (Int, Buffer Word8)+readBuf' hnd buf = do+ debugIO ("readBuf handle=" ++ show (toHANDLE hnd) ++ " " +++ summaryBuffer buf ++ "\n")+ (r,buf') <- readBuf hnd buf+ debugIO ("after: " ++ summaryBuffer buf' ++ "\n")+ return (r,buf')++writeBuf' :: RawHandle a => a -> Buffer Word8 -> IO (Buffer Word8)+writeBuf' hnd buf = do+ debugIO ("writeBuf handle=" ++ show (toHANDLE hnd) ++ " " +++ summaryBuffer buf ++ "\n")+ writeBuf hnd buf++-- -----------------------------------------------------------------------------+-- Standard I/O handles++type StdHandleId = DWORD++#{enum StdHandleId,+ , sTD_INPUT_HANDLE = STD_INPUT_HANDLE+ , sTD_OUTPUT_HANDLE = STD_OUTPUT_HANDLE+ , sTD_ERROR_HANDLE = STD_ERROR_HANDLE+}++getStdHandle :: StdHandleId -> IO HANDLE+getStdHandle hid =+ failIf (== iNVALID_HANDLE_VALUE) "GetStdHandle" $ c_GetStdHandle hid++stdin, stdout, stderr :: Io ConsoleHandle+stdin = unsafePerformIO $ mkConsoleHandle =<< getStdHandle sTD_INPUT_HANDLE+stdout = unsafePerformIO $ mkConsoleHandle =<< getStdHandle sTD_OUTPUT_HANDLE+stderr = unsafePerformIO $ mkConsoleHandle =<< getStdHandle sTD_ERROR_HANDLE++mkConsoleHandle :: HANDLE -> IO (Io ConsoleHandle)+mkConsoleHandle hwnd+ = do ref <- newIORef False+ return $ ConsoleHandle hwnd ref++-- -----------------------------------------------------------------------------+-- Some console internal types to detect EOF.++-- ASCII Ctrl+D (EOT) character. Typically used by Unix consoles.+-- use for cross platform compatibility and to adhere to the ASCII standard.+acCtrlD :: Int+acCtrlD = 0x04+-- ASCII Ctrl+Z (SUB) character. Typically used by Windows consoles to denote+-- EOT. Use for compatibility with user expectations.+acCtrlZ :: Int+acCtrlZ = 0x1A++-- Mask to use to trigger ReadConsole input processing end.+acEotMask :: ULONG+acEotMask = (1 `shiftL` acCtrlD) .|. (1 `shiftL` acCtrlZ)++-- Structure to hold the control character masks+type PCONSOLE_READCONSOLE_CONTROL = Ptr CONSOLE_READCONSOLE_CONTROL+data CONSOLE_READCONSOLE_CONTROL = CONSOLE_READCONSOLE_CONTROL+ { crcNLength :: ULONG+ , crcNInitialChars :: ULONG+ , crcDwCtrlWakeupMask :: ULONG+ , crcDwControlKeyState :: ULONG+ } deriving Show++instance Storable CONSOLE_READCONSOLE_CONTROL where+ sizeOf = const #size CONSOLE_READCONSOLE_CONTROL+ alignment = const #alignment CONSOLE_READCONSOLE_CONTROL+ poke buf crc = do+ (#poke CONSOLE_READCONSOLE_CONTROL, nLength) buf+ (crcNLength crc)+ (#poke CONSOLE_READCONSOLE_CONTROL, nInitialChars) buf+ (crcNInitialChars crc)+ (#poke CONSOLE_READCONSOLE_CONTROL, dwCtrlWakeupMask) buf+ (crcDwCtrlWakeupMask crc)+ (#poke CONSOLE_READCONSOLE_CONTROL, dwControlKeyState) buf+ (crcDwControlKeyState crc)++ peek buf = do+ vNLength <-+ (#peek CONSOLE_READCONSOLE_CONTROL, nLength) buf+ vNInitialChars <-+ (#peek CONSOLE_READCONSOLE_CONTROL, nInitialChars) buf+ vDwCtrlWakeupMask <-+ (#peek CONSOLE_READCONSOLE_CONTROL, dwCtrlWakeupMask) buf+ vDwControlKeyState <-+ (#peek CONSOLE_READCONSOLE_CONTROL, dwControlKeyState) buf+ return $ CONSOLE_READCONSOLE_CONTROL {+ crcNLength = vNLength,+ crcNInitialChars = vNInitialChars,+ crcDwCtrlWakeupMask = vDwCtrlWakeupMask,+ crcDwControlKeyState = vDwControlKeyState+ }++-- Create CONSOLE_READCONSOLE_CONTROL for breaking on control characters+-- specified by acEotMask+eotControl :: CONSOLE_READCONSOLE_CONTROL+eotControl =+ CONSOLE_READCONSOLE_CONTROL+ { crcNLength = fromIntegral $+ sizeOf (undefined :: CONSOLE_READCONSOLE_CONTROL)+ , crcNInitialChars = 0+ , crcDwCtrlWakeupMask = acEotMask+ , crcDwControlKeyState = 0+ }++type PINPUT_RECORD = Ptr ()+-- -----------------------------------------------------------------------------+-- Foreign imports+++foreign import WINDOWS_CCONV safe "windows.h CreateFileW"+ c_CreateFile :: LPCTSTR -> DWORD -> DWORD -> LPSECURITY_ATTRIBUTES+ -> DWORD -> DWORD -> HANDLE+ -> IO HANDLE++foreign import WINDOWS_CCONV safe "windows.h SetFileCompletionNotificationModes"+ c_SetFileCompletionNotificationModes :: HANDLE -> UCHAR -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h ReadFile"+ c_ReadFile :: HANDLE -> LPVOID -> DWORD -> LPDWORD -> LPOVERLAPPED+ -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h WriteFile"+ c_WriteFile :: HANDLE -> LPVOID -> DWORD -> LPDWORD -> LPOVERLAPPED+ -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h GetStdHandle"+ c_GetStdHandle :: StdHandleId -> IO HANDLE++foreign import ccall safe "__handle_ready"+ c_handle_ready :: HANDLE -> BOOL -> CInt -> IO CInt++foreign import ccall safe "__is_console"+ c_is_console :: HANDLE -> IO BOOL++foreign import ccall safe "__set_console_buffering"+ c_set_console_buffering :: HANDLE -> BOOL -> IO BOOL++foreign import ccall safe "__set_console_echo"+ c_set_console_echo :: HANDLE -> BOOL -> IO BOOL++foreign import ccall safe "__get_console_echo"+ c_get_console_echo :: HANDLE -> IO BOOL++foreign import ccall safe "__close_handle"+ c_close_handle :: HANDLE -> IO Bool++foreign import ccall safe "__handle_type"+ c_handle_type :: HANDLE -> IO Int++foreign import ccall safe "__set_file_pointer"+ c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL++foreign import ccall safe "__get_file_pointer"+ c_get_file_pointer :: HANDLE -> IO CLong++foreign import ccall safe "__get_file_size"+ c_get_file_size :: HANDLE -> IO CLong++foreign import ccall safe "__set_file_size"+ c_set_file_size :: HANDLE -> CLong -> IO BOOL++foreign import ccall safe "__duplicate_handle"+ c_duplicate_handle :: HANDLE -> Ptr HANDLE -> IO BOOL++foreign import ccall safe "__set_console_pointer"+ c_set_console_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL++foreign import ccall safe "__get_console_pointer"+ c_get_console_pointer :: HANDLE -> IO CLong++foreign import ccall safe "__get_console_buffer_size"+ c_get_console_buffer_size :: HANDLE -> IO CLong++foreign import ccall safe "__set_console_buffer_size"+ c_set_console_buffer_size :: HANDLE -> CLong -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h ReadConsoleW"+ c_read_console :: HANDLE -> Ptr Word16 -> DWORD -> Ptr DWORD+ -> PCONSOLE_READCONSOLE_CONTROL -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h WriteConsoleW"+ c_write_console :: HANDLE -> Ptr Word16 -> DWORD -> Ptr DWORD -> Ptr ()+ -> IO BOOL++foreign import WINDOWS_CCONV safe "windows.h ReadConsoleInputW"+ c_read_console_input :: HANDLE -> PINPUT_RECORD -> DWORD -> LPDWORD -> IO BOOL++type LPSECURITY_ATTRIBUTES = LPVOID++-- -----------------------------------------------------------------------------+-- Reading and Writing++-- For this to actually block, the file handle must have+-- been created with FILE_FLAG_OVERLAPPED not set. As an implementation note I+-- am choosing never to let this block. But this can be easily accomplished by+-- a getOverlappedResult call with True+hwndRead :: Io NativeHandle -> Ptr Word8 -> Word64 -> Int -> IO Int+hwndRead hwnd ptr offset bytes+ = fmap fromIntegral $ Mgr.withException "hwndRead" $+ withOverlapped "hwndRead" (toHANDLE hwnd) offset (startCB ptr) completionCB+ where+ startCB outBuf lpOverlapped = do+ debugIO ":: hwndRead"+ -- See Note [ReadFile/WriteFile].+ ret <- c_ReadFile (toHANDLE hwnd) (castPtr outBuf)+ (fromIntegral bytes) nullPtr lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess $ fromIntegral dwBytes+ | err == #{const ERROR_HANDLE_EOF} = Mgr.ioSuccess 0+ | err == #{const STATUS_END_OF_FILE} = Mgr.ioSuccess 0+ | err == #{const ERROR_BROKEN_PIPE} = Mgr.ioSuccess 0+ | err == #{const STATUS_PIPE_BROKEN} = Mgr.ioSuccess 0+ | err == #{const ERROR_NO_MORE_ITEMS} = Mgr.ioSuccess $ fromIntegral dwBytes+ | err == #{const ERROR_MORE_DATA} = Mgr.ioSuccess $ fromIntegral dwBytes+ | otherwise = Mgr.ioFailed err++-- In WinIO we'll never block in the FFI call, so this call is equivalent to+-- hwndRead, Though we may revisit this when implementing sockets and pipes.+-- It still won't block, but may set up extra book keeping so threadWait and+-- threadWrite may work.+hwndReadNonBlocking :: Io NativeHandle -> Ptr Word8 -> Word64 -> Int+ -> IO (Maybe Int)+hwndReadNonBlocking hwnd ptr offset bytes+ = do val <- withOverlapped "hwndReadNonBlocking" (toHANDLE hwnd) offset+ (startCB ptr) completionCB+ return $ ioValue val+ where+ startCB inputBuf lpOverlapped = do+ debugIO ":: hwndReadNonBlocking"+ -- See Note [ReadFile/WriteFile].+ ret <- c_ReadFile (toHANDLE hwnd) (castPtr inputBuf)+ (fromIntegral bytes) nullPtr lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess $ Just $! fromIntegral dwBytes+ | err == #{const ERROR_HANDLE_EOF} = Mgr.ioSuccess Nothing+ | err == #{const STATUS_END_OF_FILE} = Mgr.ioSuccess Nothing+ | err == #{const ERROR_BROKEN_PIPE} = Mgr.ioSuccess Nothing+ | err == #{const STATUS_PIPE_BROKEN} = Mgr.ioSuccess Nothing+ | err == #{const ERROR_NO_MORE_ITEMS} = Mgr.ioSuccess Nothing+ | err == #{const ERROR_MORE_DATA} = Mgr.ioSuccess $ Just $! fromIntegral dwBytes+ | otherwise = Mgr.ioFailedAny err++hwndWrite :: Io NativeHandle -> Ptr Word8 -> Word64 -> Int -> IO ()+hwndWrite hwnd ptr offset bytes+ = do _ <- Mgr.withException "hwndWrite" $+ withOverlapped "hwndWrite" (toHANDLE hwnd) offset (startCB ptr)+ completionCB+ return ()+ where+ startCB outBuf lpOverlapped = do+ debugIO ":: hwndWrite"+ -- See Note [ReadFile/WriteFile].+ ret <- c_WriteFile (toHANDLE hwnd) (castPtr outBuf)+ (fromIntegral bytes) nullPtr lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess $ fromIntegral dwBytes+ | err == #{const ERROR_HANDLE_EOF} = Mgr.ioSuccess $ fromIntegral dwBytes+ | otherwise = Mgr.ioFailed err++hwndWriteNonBlocking :: Io NativeHandle -> Ptr Word8 -> Word64 -> Int -> IO Int+hwndWriteNonBlocking hwnd ptr offset bytes+ = do val <- withOverlapped "hwndReadNonBlocking" (toHANDLE hwnd) offset+ (startCB ptr) completionCB+ return $ fromIntegral $ ioValue val+ where+ startCB :: Ptr a -> LPOVERLAPPED -> IO (Mgr.CbResult a1)+ startCB outBuf lpOverlapped = do+ debugIO ":: hwndWriteNonBlocking"+ -- See Note [ReadFile/WriteFile].+ ret <- c_WriteFile (toHANDLE hwnd) (castPtr outBuf)+ (fromIntegral bytes) nullPtr lpOverlapped+ return $ Mgr.CbNone ret++ completionCB err dwBytes+ | err == #{const ERROR_SUCCESS} = Mgr.ioSuccess $ fromIntegral dwBytes+ | err == #{const ERROR_HANDLE_EOF} = Mgr.ioSuccess $ fromIntegral dwBytes+ | otherwise = Mgr.ioFailed err++-- Note [ReadFile/WriteFile]+-- The results of these functions are somewhat different when working in an+-- asynchronous manner. The returning bool has two meaning.+--+-- True: The operation is done and was completed synchronously. This is+-- possible because of the optimization flags we enable. In this case+-- there won't be a completion event for this call and so we shouldn't+-- queue one up. If we do this request will never terminate. It's also+-- safe to free the OVERLAPPED structure immediately.+--+-- False: Only indicates that the operation was not completed synchronously, a+-- call to GetLastError () is needed to find out the actual status. If+-- the result is ERROR_IO_PENDING then the operation has been queued on+-- the completion port and we should proceed asynchronously. Any other+-- state is usually an indication that the call failed.+--+-- NB. reading an EOF will result in ERROR_HANDLE_EOF or STATUS_END_OF_FILE+-- during the checking of the completion results. We need to check for these+-- so we don't incorrectly fail.+++consoleWrite :: Io ConsoleHandle -> Ptr Word8 -> Word64 -> Int -> IO ()+consoleWrite hwnd ptr _offset bytes+ = alloca $ \res ->+ do failIfFalse_ "GHC.IO.Handle.consoleWrite" $ do+ debugIO ":: consoleWrite"+ withGhcInternalToUTF16 ptr bytes $ \(w_ptr, w_len) -> do+ success <- c_write_console (toHANDLE hwnd) w_ptr+ (fromIntegral w_len) res nullPtr+ if not success+ then return False+ else do val <- fromIntegral <$> peek res+ return $ val == w_len++consoleWriteNonBlocking :: Io ConsoleHandle -> Ptr Word8 -> Word64 -> Int -> IO Int+consoleWriteNonBlocking hwnd ptr _offset bytes+ = alloca $ \res ->+ do failIfFalse_ "GHC.IO.Handle.consoleWriteNonBlocking" $ do+ debugIO ":: consoleWriteNonBlocking"+ withGhcInternalToUTF16 ptr bytes $ \(w_ptr, w_len) -> do+ c_write_console (toHANDLE hwnd) w_ptr (fromIntegral w_len)+ res nullPtr+ val <- fromIntegral <$> peek res+ return val++consoleRead :: Io ConsoleHandle -> Ptr Word8 -> Word64 -> Int -> IO Int+consoleRead hwnd ptr _offset bytes+ = withUTF16ToGhcInternal ptr bytes $ \reqBytes w_ptr ->+ alloca $ \res -> do+ cooked <- isCooked hwnd+ -- Cooked input must be handled differently when the STD handles are+ -- attached to a real console handle. For File based handles we can't do+ -- proper cooked inputs, but since the actions are async you would get+ -- results as soon as available.+ --+ -- For console handles We have to use a lower level API then ReadConsole,+ -- namely we must use ReadConsoleInput which requires us to process+ -- all console message manually.+ --+ -- Do note that MSYS2 shells such as bash don't attach to a real handle,+ -- and instead have by default a pipe/file based std handles. Which+ -- means the cooked behaviour is best when used in a native Windows+ -- terminal such as cmd, powershell or ConEmu.+ case cooked of+ False -> do+ debugIO "consoleRead :: un-cooked I/O read."+ -- eotControl allows us to handle control characters like EOL+ -- without needing a newline, which would sort of defeat the point+ -- of an EOL.+ res_code <- with eotControl $ \p_eotControl ->+ c_read_console (toHANDLE hwnd) w_ptr (fromIntegral reqBytes) res+ p_eotControl++ -- Restore a quirk of the POSIX read call, which only returns a fail+ -- when the handle is invalid, e.g. closed or not a handle. It how-+ -- ever returns 0 when the handle is valid but unreadable, such as+ -- passing a handle with no GENERIC_READ permission, like /dev/null+ err <- getLastError+ when (not res_code) $+ case () of+ _ | err == #{const ERROR_INVALID_FUNCTION} -> return ()+ | otherwise -> failWith "GHC.IO.Handle.consoleRead" err+ b_read <- fromIntegral <$> peek res+ if b_read /= 1+ then return b_read+ else do w_first <- peekElemOff w_ptr 0+ case () of+ -- Handle Ctrl+Z which is the actual EOL sequence on+ -- windows, but also handle Ctrl+D which is what the+ -- ASCII standard defines as EOL.+ _ | w_first == fromIntegral acCtrlD -> return 0+ | w_first == fromIntegral acCtrlZ -> return 0+ | otherwise -> return b_read+ True -> do+ debugIO "consoleRead :: cooked I/O read."+ -- Input is cooked, don't wait till a line return and consume all+ -- characters as they are. Technically this function can handle any+ -- console event. Including mouse, window and virtual key events+ -- but for now I'm only interested in key presses.+ let entries = fromIntegral $ reqBytes `div` (#size INPUT_RECORD)+ allocaBytes entries $ \p_inputs ->+ readEvent p_inputs entries res w_ptr++ where readEvent p_inputs entries res w_ptr = do+ failIfFalse_ "GHC.IO.Handle.consoleRead" $+ c_read_console_input (toHANDLE hwnd) p_inputs+ (fromIntegral entries) res++ b_read <- fromIntegral <$> peek res+ read <- cobble b_read w_ptr p_inputs+ if read > 0+ then return $ fromIntegral read+ else readEvent p_inputs entries res w_ptr++ -- Dereference and read console input records. We only read the bare+ -- minimum required to know which key/sequences were pressed. To do+ -- this and prevent having to fully port the PINPUT_RECORD structure+ -- in Haskell we use some GCC builtins to find the correct offsets.+ cobble :: Int -> Ptr Word16 -> PINPUT_RECORD -> IO Int+ cobble 0 _ _ = do debugIO "cobble: done."+ return 0+ cobble n w_ptr p_inputs =+ do eventType <- peekByteOff p_inputs 0 :: IO WORD+ debugIO $ "cobble: Length=" ++ show n+ debugIO $ "cobble: Type=" ++ show eventType+ let ni_offset = #size INPUT_RECORD+ let event = #{const __builtin_offsetof (INPUT_RECORD, Event)}+ let char_offset = event + #{const __builtin_offsetof (KEY_EVENT_RECORD, uChar)}+ let btnDown_offset = event + #{const __builtin_offsetof (KEY_EVENT_RECORD, bKeyDown)}+ let repeat_offset = event + #{const __builtin_offsetof (KEY_EVENT_RECORD, wRepeatCount)}+ let n' = n - 1+ let p_inputs' = p_inputs `plusPtr` ni_offset+ btnDown <- peekByteOff p_inputs btnDown_offset+ repeated <- fromIntegral <$> (peekByteOff p_inputs repeat_offset :: IO WORD)+ debugIO $ "cobble: BtnDown=" ++ show btnDown+ -- Handle the key only on button down and not on button up.+ if eventType == #{const KEY_EVENT} && btnDown+ then do debugIO $ "cobble: read-char."+ char <- peekByteOff p_inputs char_offset+ let w_ptr' = w_ptr `plusPtr` 1+ debugIO $ "cobble: offset - " ++ show char_offset+ debugIO $ "cobble: show > " ++ show char+ debugIO $ "cobble: repeat: " ++ show repeated+ pokeArray w_ptr $ replicate repeated char+ (+1) <$> cobble n' w_ptr' p_inputs'+ else do debugIO $ "cobble: skip event."+ cobble n' w_ptr p_inputs'+++consoleReadNonBlocking :: Io ConsoleHandle -> Ptr Word8 -> Word64 -> Int+ -> IO (Maybe Int)+consoleReadNonBlocking hwnd ptr offset bytes+ = Just <$> consoleRead hwnd ptr offset bytes++-- -----------------------------------------------------------------------------+-- Operations on file handles++handle_ready :: RawHandle a => a -> Bool -> Int -> IO Bool+handle_ready hwnd write msecs = do+ r <- throwErrnoIfMinus1Retry "GHC.IO.Windows.Handle.handle_ready" $+ c_handle_ready (toHANDLE hwnd) write (fromIntegral msecs)+ return (toEnum (fromIntegral r))++handle_is_console :: RawHandle a => a -> IO Bool+handle_is_console = c_is_console . toHANDLE++handle_close :: RawHandle a => a -> IO ()+handle_close h = do release h+ failIfFalse_ "handle_close" $ c_close_handle (toHANDLE h)++handle_dev_type :: RawHandle a => a -> IO IODeviceType+handle_dev_type hwnd = do _type <- c_handle_type $ toHANDLE hwnd+ return $ case _type of+ _ | _type == 3 -> Stream+ | _type == 5 -> RawDevice+ | otherwise -> RegularFile++handle_is_seekable :: RawHandle a => a -> IO Bool+handle_is_seekable hwnd = do+ t <- handle_dev_type hwnd+ return (t == RegularFile || t == RawDevice)++handle_seek :: RawHandle a => a -> SeekMode -> Integer -> IO Integer+handle_seek hwnd mode off =+ with 0 $ \off_rel -> do+ failIfFalse_ "GHC.IO.Handle.handle_seek" $+ c_set_file_pointer (toHANDLE hwnd) (fromIntegral off) seektype off_rel+ fromIntegral <$> peek off_rel+ where+ seektype :: DWORD+ seektype = case mode of+ AbsoluteSeek -> #{const FILE_BEGIN}+ RelativeSeek -> #{const FILE_CURRENT}+ SeekFromEnd -> #{const FILE_END}++handle_tell :: RawHandle a => a -> IO Integer+handle_tell hwnd =+ fromIntegral `fmap`+ (throwErrnoIfMinus1Retry "GHC.IO.Handle.handle_tell" $+ c_get_file_pointer (toHANDLE hwnd))++handle_set_size :: RawHandle a => a -> Integer -> IO ()+handle_set_size hwnd size =+ failIfFalse_ "GHC.IO.Handle.handle_set_size" $+ c_set_file_size (toHANDLE hwnd) (fromIntegral size)++handle_get_size :: RawHandle a => a -> IO Integer+handle_get_size hwnd =+ fromIntegral `fmap`+ (throwErrnoIfMinus1Retry "GHC.IO.Handle.handle_set_size" $+ c_get_file_size (toHANDLE hwnd))++handle_set_echo :: RawHandle a => a -> Bool -> IO ()+handle_set_echo hwnd value =+ failIfFalse_ "GHC.IO.Handle.handle_set_echo" $+ c_set_console_echo (toHANDLE hwnd) value++handle_get_echo :: RawHandle a => a -> IO Bool+handle_get_echo = c_get_console_echo . toHANDLE++handle_duplicate :: RawHandle a => a -> IO a+handle_duplicate hwnd = alloca $ \ptr -> do+ failIfFalse_ "GHC.IO.Handle.handle_duplicate" $+ c_duplicate_handle (toHANDLE hwnd) ptr+ fromHANDLE <$> peek ptr++console_set_buffering :: Io ConsoleHandle -> Bool -> IO ()+console_set_buffering hwnd value = setCooked hwnd value >> return ()++handle_set_buffering :: RawHandle a => a -> Bool -> IO ()+handle_set_buffering hwnd value =+ failIfFalse_ "GHC.IO.Handle.handle_set_buffering" $+ c_set_console_buffering (toHANDLE hwnd) value++handle_console_seek :: RawHandle a => a -> SeekMode -> Integer -> IO Integer+handle_console_seek hwnd mode off =+ with 0 $ \loc_ptr -> do+ failIfFalse_ "GHC.IO.Handle.handle_console_seek" $+ c_set_console_pointer (toHANDLE hwnd) (fromIntegral off) seektype loc_ptr+ fromIntegral <$> peek loc_ptr+ where+ seektype :: DWORD+ seektype = case mode of+ AbsoluteSeek -> #{const FILE_BEGIN}+ RelativeSeek -> #{const FILE_CURRENT}+ SeekFromEnd -> #{const FILE_END}++handle_console_tell :: RawHandle a => a -> IO Integer+handle_console_tell hwnd =+ fromIntegral `fmap`+ (throwErrnoIfMinus1Retry "GHC.IO.Handle.handle_console_tell" $+ c_get_console_pointer (toHANDLE hwnd))++handle_set_console_size :: RawHandle a => a -> Integer -> IO ()+handle_set_console_size hwnd size =+ failIfFalse_ "GHC.IO.Handle.handle_set_console_size" $+ c_set_console_buffer_size (toHANDLE hwnd) (fromIntegral size)++handle_get_console_size :: RawHandle a => a -> IO Integer+handle_get_console_size hwnd =+ fromIntegral `fmap`+ (throwErrnoIfMinus1Retry "GHC.IO.Handle.handle_get_console_size" $+ c_get_console_buffer_size (toHANDLE hwnd))++-- -----------------------------------------------------------------------------+-- opening files++-- | Describes if and which temp file flags to use.+data TempFileOptions = NoTemp | TempNonExcl | TempExcl deriving Eq++-- | Open a file and make an 'NativeHandle' for it. Truncates the file to zero+-- size when the `IOMode` is `WriteMode`.+openFile+ :: FilePath -- ^ file to open+ -> IOMode -- ^ mode in which to open the file+ -> Bool -- ^ open the file in non-blocking mode?+ -> IO (Io NativeHandle, IODeviceType)+openFile filepath iomode non_blocking = openFile' filepath iomode non_blocking NoTemp++-- | Open a file as a temporary file and make an 'NativeHandle' for it.+-- Truncates the file to zero size when the `IOMode` is `WriteMode`.+openFileAsTemp+ :: FilePath -- ^ file to open+ -> Bool -- ^ open the file in non-blocking mode?+ -> Bool -- ^ Exclusive mode+ -> IO (Io NativeHandle, IODeviceType)+openFileAsTemp filepath non_blocking excl+ = openFile' filepath ReadWriteMode non_blocking (if excl then TempExcl else TempNonExcl)++-- | Open a file and make an 'NativeHandle' for it. Truncates the file to zero+-- size when the `IOMode` is `WriteMode`.+openFile'+ :: FilePath -- ^ file to open+ -> IOMode -- ^ mode in which to open the file+ -> Bool -- ^ open the file in non-blocking mode?+ -> TempFileOptions+ -> IO (Io NativeHandle, IODeviceType)+openFile' filepath iomode non_blocking tmp_opts =+ do devicepath <- getDevicePath filepath+ h <- createFile devicepath+ -- Attach the handle to the I/O manager's CompletionPort. This allows the+ -- I/O manager to service requests for this Handle.+ Mgr.associateHandle' h+ let hwnd = fromHANDLE h+ _type <- devType hwnd++ -- Use the rts to enforce any file locking we may need.+ let write_lock = iomode /= ReadMode++ case _type of+ -- Regular files need to be locked.+ -- See also Note [RTS File locking]+ RegularFile -> do+ optimizeFileAccess h -- Set a few optimization flags on file handles.+ (unique_dev, unique_ino) <- getUniqueFileInfo hwnd+ r <- lockFile (fromIntegral $ ptrToWordPtr h) unique_dev unique_ino+ (fromBool write_lock)+ when (r == -1) $+ ioException (IOError Nothing ResourceBusy "openFile"+ "file is locked" Nothing Nothing)++ -- I don't see a reason for blocking directories. So unlike the FD+ -- implementation I'll allow it.+ _ -> return ()++ -- We want to truncate() if this is an open in WriteMode, but only+ -- if the target is a RegularFile. but TRUNCATE_EXISTING would fail if+ -- the file didn't exit. So just set the size afterwards.+ when (iomode == WriteMode && _type == RegularFile) $+ setSize hwnd 0++ return (hwnd, _type)+ where+ flagIf p f2+ | p = f2+ | otherwise = 0+ -- We have to use in-process locking (e.g. use the locking mechanism+ -- in the rts) so we're consistent with the linux behavior and the+ -- rts knows about the lock. See #4363 for more.+ file_share_mode = #{const FILE_SHARE_READ}+ .|. #{const FILE_SHARE_DELETE}+ -- Don't support shared writing for temp files.+ .|. (flagIf (tmp_opts == NoTemp)+ #{const FILE_SHARE_WRITE})++ file_access_mode =+ case iomode of+ ReadMode -> #{const GENERIC_READ}+ WriteMode -> #{const GENERIC_WRITE}+ ReadWriteMode -> #{const GENERIC_READ}+ .|. #{const GENERIC_WRITE}+ AppendMode -> #{const GENERIC_WRITE}+ .|. #{const FILE_APPEND_DATA}++ file_open_mode =+ case iomode of+ ReadMode -> #{const OPEN_EXISTING} -- O_RDONLY+ WriteMode -> #{const OPEN_ALWAYS} -- O_CREAT | O_WRONLY | O_TRUNC+ ReadWriteMode ->+ case tmp_opts of+ NoTemp -> #{const OPEN_ALWAYS} -- O_CREAT | O_RDWR+ TempNonExcl -> #{const CREATE_ALWAYS} -- O_CREAT | O_RDWR+ TempExcl -> #{const CREATE_NEW} -- O_CREAT | O_RDWR | O_EXCL+ AppendMode -> #{const OPEN_ALWAYS} -- O_APPEND++ file_create_flags =+ if non_blocking+ -- On Windows, the choice of whether an operation completes+ -- asynchronously or not depends on how the Handle was created+ -- and not on the operation called. As in, the behaviour of+ -- ReadFile and WriteFile depends on the flags used to open the+ -- handle. For WinIO we always use FILE_FLAG_OVERLAPPED, which+ -- means we always issue asynchronous file operation using an+ -- OVERLAPPED structure. All blocking, if required must be done+ -- on the Haskell side by using existing mechanisms such as MVar+ -- or IOPorts.+ then #{const FILE_FLAG_OVERLAPPED}+ -- I beleive most haskell programs do sequential scans, so+ -- optimize for the common case. Though ideally, this would+ -- be parameterized by openFile. This will absolutely trash+ -- the cache on reverse scans.+ --+ -- TODO: make a parameter to openFile and specify only for+ -- operations we know are sequential. This parameter should+ -- be usable by madvise too.+ .|. #{const FILE_FLAG_SEQUENTIAL_SCAN}+ .|. (flagIf (tmp_opts /= NoTemp)+ -- Hold data in cache for as long as possible+ #{const FILE_ATTRIBUTE_TEMPORARY} )+ else #{const FILE_ATTRIBUTE_NORMAL}+ .|. (flagIf (tmp_opts /= NoTemp)+ -- Hold data in cache for as long as possible+ #{const FILE_ATTRIBUTE_TEMPORARY} )++ createFile devicepath =+ withCWString devicepath $ \fp ->+ failIf (== iNVALID_HANDLE_VALUE) "CreateFile" $+ c_CreateFile fp file_access_mode+ file_share_mode+ nullPtr+ file_open_mode+ file_create_flags+ nullPtr++-- Tell the OS that we support skipping the request Queue if the+-- IRQ can be handled immediately, e.g. if the data is in the cache.+optimizeFileAccess :: HANDLE -> IO ()+optimizeFileAccess handle =+ failIfFalse_ "SetFileCompletionNotificationModes" $+ c_SetFileCompletionNotificationModes handle+ ( #{const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS}+ .|. #{const FILE_SKIP_SET_EVENT_ON_HANDLE})++-- Reconstruct an I/O mode from an open HANDLE+handleToMode :: HANDLE -> IO IOMode+handleToMode hwnd = do+ mask <- c_get_handle_access_mask hwnd+ let hasFlag flag = (flag .&. mask) == flag+ case () of+ () | hasFlag (#{const FILE_APPEND_DATA}) -> return AppendMode+ | hasFlag (#{const GENERIC_WRITE} .|. #{const GENERIC_READ}) -> return ReadWriteMode+ | hasFlag (#{const GENERIC_READ}) -> return ReadMode+ | hasFlag (#{const GENERIC_WRITE}) -> return WriteMode+ | otherwise -> error "unknown access mask in handleToMode."++foreign import ccall unsafe "__get_handle_access_mask"+ c_get_handle_access_mask :: HANDLE -> IO DWORD++release :: RawHandle a => a -> IO ()+release h = if isLockable h+ then do let handle = fromIntegral $ ptrToWordPtr $ toHANDLE h+ _ <- unlockFile handle+ return ()+ else return ()++-- -----------------------------------------------------------------------------+-- Locking/unlocking++foreign import ccall unsafe "lockFile"+ lockFile :: CUIntPtr -> Word64 -> Word64 -> CInt -> IO CInt++foreign import ccall unsafe "unlockFile"+ unlockFile :: CUIntPtr -> IO CInt++-- | Returns -1 on error. Otherwise writes two values representing+-- the file into the given ptrs.+foreign import ccall unsafe "get_unique_file_info_hwnd"+ c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()++-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo+-- succeeds.+getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)+getUniqueFileInfo handle = do+ with 0 $ \devptr -> do+ with 0 $ \inoptr -> do+ c_getUniqueFileInfo (toHANDLE handle) devptr inoptr+ liftM2 (,) (peek devptr) (peek inoptr)
+ GHC/IO/Windows/Paths.hs view
@@ -0,0 +1,49 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE CPP #-}+-- Whether there are identities depends on the platform+{-# OPTIONS_HADDOCK hide #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IO.Windows.Paths+-- Copyright : (c) The University of Glasgow, 2017+-- License : see libraries/base/LICENSE+--+-- Maintainer : libraries@haskell.org+-- Stability : internal+-- Portability : non-portable+--+-- Windows FilePath handling utility for GHC code.+--+-----------------------------------------------------------------------------++module GHC.IO.Windows.Paths+ (getDevicePath+ ) where++#include "windows_cconv.h"++import GHC.Base+import GHC.IO++import Foreign.C.String+import Foreign.Marshal.Alloc (free)++foreign import WINDOWS_CCONV safe "__hs_create_device_name"+ c_GetDevicePath :: CWString -> IO CWString++-- | This function converts Windows paths between namespaces. More specifically+-- It converts an explorer style path into a NT or Win32 namespace.+-- This has several caveats but they are caviats that are native to Windows and+-- not POSIX. See+-- https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx.+-- Anything else such as raw device paths we leave untouched. The main benefit+-- of doing any of this is that we can break the MAX_PATH restriction and also+-- access raw handles that we couldn't before.+getDevicePath :: FilePath -> IO FilePath+getDevicePath path+ = do str <- withCWString path c_GetDevicePath+ newPath <- peekCWString str+ free str+ return newPath
+ GHC/IOPort.hs view
@@ -0,0 +1,122 @@+{-# LANGUAGE Unsafe #-}+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}+{-# OPTIONS_GHC -funbox-strict-fields #-}+{-# OPTIONS_HADDOCK hide #-}++-----------------------------------------------------------------------------+-- |+-- Module : GHC.IOPort+-- Copyright : (c) Tamar Christina 2019+-- License : see libraries/base/LICENSE+--+-- Maintainer : cvs-ghc@haskell.org+-- Stability : internal+-- Portability : non-portable (GHC Extensions)+--+-- The IOPort type. This is a facility used by the Windows IO subsystem.+-- We have strict rules with an I/O Port:+-- * writing more than once is an error+-- * reading more than once is an error+--+-- It gives us the ability to have one thread to block, wait for a result from+-- another thread and then being woken up. *Nothing* more.+--+-- This type is very much GHC internal. It might be changed or removed without+-- notice in future releases.+--+-----------------------------------------------------------------------------++module GHC.IOPort (+ -- * IOPorts+ IOPort(..)+ , newIOPort+ , newEmptyIOPort+ , readIOPort+ , writeIOPort+ , doubleReadException+ ) where++import GHC.Base+import GHC.Exception+import Text.Show++data IOPortException = IOPortException deriving Show++instance Exception IOPortException where+ displayException IOPortException = "IOPortException"+++doubleReadException :: SomeException+doubleReadException = toException IOPortException++data IOPort a = IOPort (IOPort# RealWorld a)+{- ^+An 'IOPort' is a synchronising variable, used+for communication between concurrent threads, where one of the threads is+controlled by an external state. e.g. by an I/O action that is serviced by the+runtime. It can be thought of as a box, which may be empty or full.++It is mostly similar to the behavior of 'Control.Concurrent.MVar.MVar'+except 'writeIOPort' doesn't block if the variable is full and the GC+won't forcibly release the lock if it thinks+there's a deadlock.++The properties of IOPorts are:+* Writing to an empty IOPort will not block.+* Writing to an full IOPort will not block. It might throw an exception.+* Reading from an IOPort for the second time might throw an exception.+* Reading from a full IOPort will not block, return the value and empty the port.+* Reading from an empty IOPort will block until a write.+* Reusing an IOPort (that is, reading or writing twice) is not supported+ and might throw an exception. Even if reads and writes are+ interleaved.++This type is very much GHC internal. It might be changed or removed without+notice in future releases.++-}++-- | @since 4.1.0.0+instance Eq (IOPort a) where+ (IOPort ioport1#) == (IOPort ioport2#) =+ isTrue# (sameIOPort# ioport1# ioport2#)++++-- |Create an 'IOPort' which is initially empty.+newEmptyIOPort :: IO (IOPort a)+newEmptyIOPort = IO $ \ s# ->+ case newIOPort# s# of+ (# s2#, svar# #) -> (# s2#, IOPort svar# #)++-- |Create an 'IOPort' which contains the supplied value.+newIOPort :: a -> IO (IOPort a)+newIOPort value =+ newEmptyIOPort >>= \ ioport ->+ writeIOPort ioport value >>+ return ioport++-- |Atomically read the the contents of the 'IOPort'. If the 'IOPort' is+-- currently empty, 'readIOPort' will wait until it is full. After a+-- 'readIOPort', the 'IOPort' is left empty.+--+-- There is one important property of 'readIOPort':+--+-- * Only a single threads can be blocked on an 'IOPort'.+--+readIOPort :: IOPort a -> IO a+readIOPort (IOPort ioport#) = IO $ \ s# -> readIOPort# ioport# s#++-- |Put a value into an 'IOPort'. If the 'IOPort' is currently full,+-- 'writeIOPort' will throw an exception.+--+-- There is one important property of 'writeIOPort':+--+-- * Only a single thread can be blocked on an 'IOPort'.+--+writeIOPort :: IOPort a -> a -> IO Bool+writeIOPort (IOPort ioport#) x = IO $ \ s# ->+ case writeIOPort# ioport# x s# of+ (# s, 0# #) -> (# s, False #)+ (# s, _ #) -> (# s, True #)+
GHC/Int.hs view
@@ -101,7 +101,7 @@ signum x | x > 0 = 1 signum 0 = 0 signum _ = -1- fromInteger i = I8# (narrow8Int# (integerToInt i))+ fromInteger i = I8# (narrow8Int# (integerToInt# i)) -- | @since 2.01 instance Real Int8 where@@ -155,7 +155,7 @@ (# d, m #) -> (I8# (narrow8Int# d), I8# (narrow8Int# m))- toInteger (I8# x#) = smallInteger x#+ toInteger (I8# x#) = IS x# -- | @since 2.01 instance Bounded Int8 where@@ -179,10 +179,10 @@ {-# INLINE testBit #-} {-# INLINE popCount #-} - (I8# x#) .&. (I8# y#) = I8# (word2Int# (int2Word# x# `and#` int2Word# y#))- (I8# x#) .|. (I8# y#) = I8# (word2Int# (int2Word# x# `or#` int2Word# y#))- (I8# x#) `xor` (I8# y#) = I8# (word2Int# (int2Word# x# `xor#` int2Word# y#))- complement (I8# x#) = I8# (word2Int# (not# (int2Word# x#)))+ (I8# x#) .&. (I8# y#) = I8# (x# `andI#` y#)+ (I8# x#) .|. (I8# y#) = I8# (x# `orI#` y#)+ (I8# x#) `xor` (I8# y#) = I8# (x# `xorI#` y#)+ complement (I8# x#) = I8# (notI# x#) (I8# x#) `shift` (I# i#) | isTrue# (i# >=# 0#) = I8# (narrow8Int# (x# `iShiftL#` i#)) | otherwise = I8# (x# `iShiftRA#` negateInt# i#)@@ -308,7 +308,7 @@ signum x | x > 0 = 1 signum 0 = 0 signum _ = -1- fromInteger i = I16# (narrow16Int# (integerToInt i))+ fromInteger i = I16# (narrow16Int# (integerToInt# i)) -- | @since 2.01 instance Real Int16 where@@ -362,7 +362,7 @@ (# d, m #) -> (I16# (narrow16Int# d), I16# (narrow16Int# m))- toInteger (I16# x#) = smallInteger x#+ toInteger (I16# x#) = IS x# -- | @since 2.01 instance Bounded Int16 where@@ -386,10 +386,10 @@ {-# INLINE testBit #-} {-# INLINE popCount #-} - (I16# x#) .&. (I16# y#) = I16# (word2Int# (int2Word# x# `and#` int2Word# y#))- (I16# x#) .|. (I16# y#) = I16# (word2Int# (int2Word# x# `or#` int2Word# y#))- (I16# x#) `xor` (I16# y#) = I16# (word2Int# (int2Word# x# `xor#` int2Word# y#))- complement (I16# x#) = I16# (word2Int# (not# (int2Word# x#)))+ (I16# x#) .&. (I16# y#) = I16# (x# `andI#` y#)+ (I16# x#) .|. (I16# y#) = I16# (x# `orI#` y#)+ (I16# x#) `xor` (I16# y#) = I16# (x# `xorI#` y#)+ complement (I16# x#) = I16# (notI# x#) (I16# x#) `shift` (I# i#) | isTrue# (i# >=# 0#) = I16# (narrow16Int# (x# `iShiftL#` i#)) | otherwise = I16# (x# `iShiftRA#` negateInt# i#)@@ -520,7 +520,7 @@ signum x | x > 0 = 1 signum 0 = 0 signum _ = -1- fromInteger i = I32# (narrow32Int# (integerToInt i))+ fromInteger i = I32# (narrow32Int# (integerToInt# i)) -- | @since 2.01 instance Enum Int32 where@@ -582,7 +582,7 @@ (# d, m #) -> (I32# (narrow32Int# d), I32# (narrow32Int# m))- toInteger (I32# x#) = smallInteger x#+ toInteger (I32# x#) = IS x# -- | @since 2.01 instance Read Int32 where@@ -595,10 +595,10 @@ {-# INLINE testBit #-} {-# INLINE popCount #-} - (I32# x#) .&. (I32# y#) = I32# (word2Int# (int2Word# x# `and#` int2Word# y#))- (I32# x#) .|. (I32# y#) = I32# (word2Int# (int2Word# x# `or#` int2Word# y#))- (I32# x#) `xor` (I32# y#) = I32# (word2Int# (int2Word# x# `xor#` int2Word# y#))- complement (I32# x#) = I32# (word2Int# (not# (int2Word# x#)))+ (I32# x#) .&. (I32# y#) = I32# (x# `andI#` y#)+ (I32# x#) .|. (I32# y#) = I32# (x# `orI#` y#)+ (I32# x#) `xor` (I32# y#) = I32# (x# `xorI#` y#)+ complement (I32# x#) = I32# (notI# x#) (I32# x#) `shift` (I# i#) | isTrue# (i# >=# 0#) = I32# (narrow32Int# (x# `iShiftL#` i#)) | otherwise = I32# (x# `iShiftRA#` negateInt# i#)@@ -743,7 +743,7 @@ signum x | x > 0 = 1 signum 0 = 0 signum _ = -1- fromInteger i = I64# (integerToInt64 i)+ fromInteger i = I64# (integerToInt64# i) -- | @since 2.01 instance Enum Int64 where@@ -799,7 +799,7 @@ | y == (-1) && x == minBound = (overflowError, 0) | otherwise = (I64# (x# `divInt64#` y#), I64# (x# `modInt64#` y#))- toInteger (I64# x) = int64ToInteger x+ toInteger (I64# x) = integerFromInt64# x divInt64#, modInt64# :: Int64# -> Int64# -> Int64#@@ -948,7 +948,7 @@ signum x | x > 0 = 1 signum 0 = 0 signum _ = -1- fromInteger i = I64# (integerToInt i)+ fromInteger i = I64# (integerToInt# i) -- | @since 2.01 instance Enum Int64 where@@ -1001,7 +1001,7 @@ | otherwise = case x# `divModInt#` y# of (# d, m #) -> (I64# d, I64# m)- toInteger (I64# x#) = smallInteger x#+ toInteger (I64# x#) = IS x# -- | @since 2.01 instance Read Int64 where@@ -1014,10 +1014,10 @@ {-# INLINE testBit #-} {-# INLINE popCount #-} - (I64# x#) .&. (I64# y#) = I64# (word2Int# (int2Word# x# `and#` int2Word# y#))- (I64# x#) .|. (I64# y#) = I64# (word2Int# (int2Word# x# `or#` int2Word# y#))- (I64# x#) `xor` (I64# y#) = I64# (word2Int# (int2Word# x# `xor#` int2Word# y#))- complement (I64# x#) = I64# (word2Int# (int2Word# x# `xor#` int2Word# (-1#)))+ (I64# x#) .&. (I64# y#) = I64# (x# `andI#` y#)+ (I64# x#) .|. (I64# y#) = I64# (x# `orI#` y#)+ (I64# x#) `xor` (I64# y#) = I64# (x# `xorI#` y#)+ complement (I64# x#) = I64# (notI# x#) (I64# x#) `shift` (I# i#) | isTrue# (i# >=# 0#) = I64# (x# `iShiftL#` i#) | otherwise = I64# (x# `iShiftRA#` negateInt# i#)@@ -1119,29 +1119,29 @@ {-# RULES "fromIntegral/Natural->Int8"- fromIntegral = (fromIntegral :: Int -> Int8) . naturalToInt+ fromIntegral = (fromIntegral :: Int -> Int8) . fromIntegral . naturalToWord "fromIntegral/Natural->Int16"- fromIntegral = (fromIntegral :: Int -> Int16) . naturalToInt+ fromIntegral = (fromIntegral :: Int -> Int16) . fromIntegral . naturalToWord "fromIntegral/Natural->Int32"- fromIntegral = (fromIntegral :: Int -> Int32) . naturalToInt+ fromIntegral = (fromIntegral :: Int -> Int32) . fromIntegral . naturalToWord #-} {-# RULES "fromIntegral/Int8->Natural"- fromIntegral = intToNatural . (fromIntegral :: Int8 -> Int)+ fromIntegral = naturalFromWord . fromIntegral . (fromIntegral :: Int8 -> Int) "fromIntegral/Int16->Natural"- fromIntegral = intToNatural . (fromIntegral :: Int16 -> Int)+ fromIntegral = naturalFromWord . fromIntegral . (fromIntegral :: Int16 -> Int) "fromIntegral/Int32->Natural"- fromIntegral = intToNatural . (fromIntegral :: Int32 -> Int)+ fromIntegral = naturalFromWord . fromIntegral . (fromIntegral :: Int32 -> Int) #-} #if WORD_SIZE_IN_BITS == 64 -- these RULES are valid for Word==Word64 & Int==Int64 {-# RULES "fromIntegral/Natural->Int64"- fromIntegral = (fromIntegral :: Int -> Int64) . naturalToInt+ fromIntegral = (fromIntegral :: Int -> Int64) . fromIntegral . naturalToWord "fromIntegral/Int64->Natural"- fromIntegral = intToNatural . (fromIntegral :: Int64 -> Int)+ fromIntegral = naturalFromWord . fromIntegral . (fromIntegral :: Int64 -> Int) #-} #endif
+ GHC/Integer.hs view
@@ -0,0 +1,219 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE MagicHash #-}+{-# LANGUAGE UnboxedTuples #-}+{-# LANGUAGE NoImplicitPrelude #-}++{-# OPTIONS_HADDOCK not-home #-}++#include "MachDeps.h"++-- | Compatibility module for pre ghc-bignum code.+module GHC.Integer (+ Integer,++ -- * Construct 'Integer's+ smallInteger, wordToInteger,+#if WORD_SIZE_IN_BITS < 64+ word64ToInteger, int64ToInteger,+#endif+ -- * Conversion to other integral types+ integerToWord, integerToInt,+#if WORD_SIZE_IN_BITS < 64+ integerToWord64, integerToInt64,+#endif++ -- * Helpers for 'RealFloat' type-class operations+ encodeFloatInteger, floatFromInteger,+ encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger,++ -- * Arithmetic operations+ plusInteger, minusInteger, timesInteger, negateInteger,+ absInteger, signumInteger,++ divModInteger, divInteger, modInteger,+ quotRemInteger, quotInteger, remInteger,++ -- * Comparison predicates+ eqInteger, neqInteger, leInteger, gtInteger, ltInteger, geInteger,+ compareInteger,++ -- ** 'Int#'-boolean valued versions of comparison predicates+ --+ -- | These operations return @0#@ and @1#@ instead of 'False' and+ -- 'True' respectively. See+ -- <https://gitlab.haskell.org/ghc/ghc/wikis/prim-bool PrimBool wiki-page>+ -- for more details+ eqInteger#, neqInteger#, leInteger#, gtInteger#, ltInteger#, geInteger#,+++ -- * Bit-operations+ andInteger, orInteger, xorInteger,++ complementInteger,+ shiftLInteger, shiftRInteger, testBitInteger,++ popCountInteger, bitInteger,++ -- * Hashing+ hashInteger,+ ) where++import GHC.Num.Integer (Integer)+import qualified GHC.Num.Integer as I+import GHC.Prim+import GHC.Types++smallInteger :: Int# -> Integer+smallInteger = I.integerFromInt#++integerToInt :: Integer -> Int#+integerToInt = I.integerToInt#++wordToInteger :: Word# -> Integer+wordToInteger = I.integerFromWord#++integerToWord :: Integer -> Word#+integerToWord = I.integerToWord#++#if WORD_SIZE_IN_BITS < 64++word64ToInteger :: Word64# -> Integer+word64ToInteger = I.integerFromWord64#++integerToWord64 :: Integer -> Word64#+integerToWord64 = I.integerToWord64#++int64ToInteger :: Int64# -> Integer+int64ToInteger = I.integerFromInt64#++integerToInt64 :: Integer -> Int64#+integerToInt64 = I.integerToInt64#++#endif+++encodeFloatInteger :: Integer -> Int# -> Float#+encodeFloatInteger = I.integerEncodeFloat#++floatFromInteger :: Integer -> Float#+floatFromInteger = I.integerToFloat#++encodeDoubleInteger :: Integer -> Int# -> Double#+encodeDoubleInteger = I.integerEncodeDouble#++doubleFromInteger :: Integer -> Double#+doubleFromInteger = I.integerToDouble#++decodeDoubleInteger :: Double# -> (# Integer, Int# #)+decodeDoubleInteger = I.integerDecodeDouble#+++plusInteger :: Integer -> Integer -> Integer+plusInteger = I.integerAdd++minusInteger :: Integer -> Integer -> Integer+minusInteger = I.integerSub++timesInteger :: Integer -> Integer -> Integer+timesInteger = I.integerMul++negateInteger :: Integer -> Integer+negateInteger = I.integerNegate++absInteger :: Integer -> Integer+absInteger = I.integerAbs++signumInteger :: Integer -> Integer+signumInteger = I.integerSignum++divModInteger :: Integer -> Integer -> (# Integer, Integer #)+divModInteger = I.integerDivMod#++divInteger :: Integer -> Integer -> Integer+divInteger = I.integerDiv++modInteger :: Integer -> Integer -> Integer+modInteger = I.integerMod++quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)+quotRemInteger = I.integerQuotRem#++quotInteger :: Integer -> Integer -> Integer+quotInteger = I.integerQuot++remInteger :: Integer -> Integer -> Integer+remInteger = I.integerRem+++eqInteger :: Integer -> Integer -> Bool+eqInteger = I.integerEq++neqInteger :: Integer -> Integer -> Bool+neqInteger = I.integerNe++leInteger :: Integer -> Integer -> Bool+leInteger = I.integerLe++gtInteger :: Integer -> Integer -> Bool+gtInteger = I.integerGt++ltInteger :: Integer -> Integer -> Bool+ltInteger = I.integerLt++geInteger :: Integer -> Integer -> Bool+geInteger = I.integerGe++compareInteger :: Integer -> Integer -> Ordering+compareInteger = I.integerCompare++++eqInteger# :: Integer -> Integer -> Int#+eqInteger# = I.integerEq#++neqInteger# :: Integer -> Integer -> Int#+neqInteger# = I.integerNe#++leInteger# :: Integer -> Integer -> Int#+leInteger# = I.integerLe#++gtInteger# :: Integer -> Integer -> Int#+gtInteger# = I.integerGt#++ltInteger# :: Integer -> Integer -> Int#+ltInteger# = I.integerLt#++geInteger# :: Integer -> Integer -> Int#+geInteger# = I.integerGe#+++andInteger :: Integer -> Integer -> Integer+andInteger = I.integerAnd++orInteger :: Integer -> Integer -> Integer+orInteger = I.integerOr++xorInteger :: Integer -> Integer -> Integer+xorInteger = I.integerXor++complementInteger :: Integer -> Integer+complementInteger = I.integerComplement++shiftLInteger :: Integer -> Int# -> Integer+shiftLInteger n i = I.integerShiftL# n (int2Word# i)++shiftRInteger :: Integer -> Int# -> Integer+shiftRInteger n i = I.integerShiftR# n (int2Word# i)++testBitInteger :: Integer -> Int# -> Bool+testBitInteger n i = isTrue# (I.integerTestBit# n (int2Word# i))++hashInteger :: Integer -> Int#+hashInteger = I.integerToInt#++bitInteger :: Int# -> Integer+bitInteger i = I.integerBit# (int2Word# i)++popCountInteger :: Integer -> Int#+popCountInteger = I.integerPopCount#+
+ GHC/Integer/Logarithms.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE MagicHash #-}++-- | Compatibility module for pre ghc-bignum code.+module GHC.Integer.Logarithms+ ( wordLog2#+ , integerLog2#+ , integerLogBase#+ )+where++import qualified GHC.Num.Primitives as N+import qualified GHC.Num.Integer as N+import GHC.Num.Integer (Integer)+import GHC.Prim++wordLog2# :: Word# -> Int#+wordLog2# i = word2Int# (N.wordLog2# i)++integerLog2# :: Integer -> Int#+integerLog2# i = word2Int# (N.integerLog2# i)++integerLogBase# :: Integer -> Integer -> Int#+integerLogBase# x y = word2Int# (N.integerLogBase# x y)
GHC/Ix.hs view
@@ -16,7 +16,7 @@ ----------------------------------------------------------------------------- module GHC.Ix (- Ix(..)+ Ix(..), indexError ) where import GHC.Enum@@ -324,6 +324,8 @@ inRange (l3,u3) i3 && inRange (l4,u4) i4 -- Default method for index++---------------------------------------------------------------------- -- | @since 2.01 instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1,a2,a3,a4,a5) where range ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) =@@ -344,5 +346,430 @@ inRange (l1,u1) i1 && inRange (l2,u2) i2 && inRange (l3,u3) i3 && inRange (l4,u4) i4 && inRange (l5,u5) i5++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6) =>+ Ix (a1,a2,a3,a4,a5,a6) where+ range ((l1,l2,l3,l4,l5,l6),(u1,u2,u3,u4,u5,u6)) =+ [(i1,i2,i3,i4,i5,i6) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6),(u1,u2,u3,u4,u5,u6)) (i1,i2,i3,i4,i5,i6) =+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1)))))++ inRange ((l1,l2,l3,l4,l5,l6),(u1,u2,u3,u4,u5,u6)) (i1,i2,i3,i4,i5,i6) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7) =>+ Ix (a1,a2,a3,a4,a5,a6,a7) where+ range ((l1,l2,l3,l4,l5,l6,l7),(u1,u2,u3,u4,u5,u6,u7)) =+ [(i1,i2,i3,i4,i5,i6,i7) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7),(u1,u2,u3,u4,u5,u6,u7))+ (i1,i2,i3,i4,i5,i6,i7) =+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7),(u1,u2,u3,u4,u5,u6,u7))+ (i1,i2,i3,i4,i5,i6,i7) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8),(u1,u2,u3,u4,u5,u6,u7,u8)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8),(u1,u2,u3,u4,u5,u6,u7,u8))+ (i1,i2,i3,i4,i5,i6,i7,i8) =+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1)))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8),(u1,u2,u3,u4,u5,u6,u7,u8))+ (i1,i2,i3,i4,i5,i6,i7,i8) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9),(u1,u2,u3,u4,u5,u6,u7,u8,u9)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9),(u1,u2,u3,u4,u5,u6,u7,u8,u9))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9) =+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9),(u1,u2,u3,u4,u5,u6,u7,u8,u9))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA),(u1,u2,u3,u4,u5,u6,u7,u8,u9,uA)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA) =+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1)))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA),(u1,u2,u3,u4,u5,u6,u7,u8,u9,uA))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA, Ix aB) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA),+ iB <- range (lB,uB)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB) =+ unsafeIndex (lB,uB) iB + unsafeRangeSize (lB,uB) * (+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1))))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA &&+ inRange (lB,uB) iB++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA, Ix aB, Ix aC) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA),+ iB <- range (lB,uB),+ iC <- range (lC,uC)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC) =+ unsafeIndex (lC,uC) iC + unsafeRangeSize (lC,uC) * (+ unsafeIndex (lB,uB) iB + unsafeRangeSize (lB,uB) * (+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1)))))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA &&+ inRange (lB,uB) iB && inRange (lC,uC) iC++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA, Ix aB, Ix aC, Ix aD) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA),+ iB <- range (lB,uB),+ iC <- range (lC,uC),+ iD <- range (lD,uD)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD) =+ unsafeIndex (lD,uD) iD + unsafeRangeSize (lD,uD) * (+ unsafeIndex (lC,uC) iC + unsafeRangeSize (lC,uC) * (+ unsafeIndex (lB,uB) iB + unsafeRangeSize (lB,uB) * (+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1))))))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA &&+ inRange (lB,uB) iB && inRange (lC,uC) iC &&+ inRange (lD,uD) iD++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA, Ix aB, Ix aC, Ix aD, Ix aE) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD,aE) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA),+ iB <- range (lB,uB),+ iC <- range (lC,uC),+ iD <- range (lD,uD),+ iE <- range (lE,uE)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE) =+ unsafeIndex (lE,uE) iE + unsafeRangeSize (lE,uE) * (+ unsafeIndex (lD,uD) iD + unsafeRangeSize (lD,uD) * (+ unsafeIndex (lC,uC) iC + unsafeRangeSize (lC,uC) * (+ unsafeIndex (lB,uB) iB + unsafeRangeSize (lB,uB) * (+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1)))))))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA &&+ inRange (lB,uB) iB && inRange (lC,uC) iC &&+ inRange (lD,uD) iD && inRange (lE,uE) iE++ -- Default method for index++----------------------------------------------------------------------+-- | @since 4.15.0.0+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,+ Ix aA, Ix aB, Ix aC, Ix aD, Ix aE, Ix aF) =>+ Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD,aE,aF) where+ range ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE,lF),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE,uF)) =+ [(i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE,iF) | i1 <- range (l1,u1),+ i2 <- range (l2,u2),+ i3 <- range (l3,u3),+ i4 <- range (l4,u4),+ i5 <- range (l5,u5),+ i6 <- range (l6,u6),+ i7 <- range (l7,u7),+ i8 <- range (l8,u8),+ i9 <- range (l9,u9),+ iA <- range (lA,uA),+ iB <- range (lB,uB),+ iC <- range (lC,uC),+ iD <- range (lD,uD),+ iE <- range (lE,uE),+ iF <- range (lF,uF)]++ unsafeIndex ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE,lF),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE,uF))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE,iF) =+ unsafeIndex (lF,uF) iF + unsafeRangeSize (lF,uF) * (+ unsafeIndex (lE,uE) iE + unsafeRangeSize (lE,uE) * (+ unsafeIndex (lD,uD) iD + unsafeRangeSize (lD,uD) * (+ unsafeIndex (lC,uC) iC + unsafeRangeSize (lC,uC) * (+ unsafeIndex (lB,uB) iB + unsafeRangeSize (lB,uB) * (+ unsafeIndex (lA,uA) iA + unsafeRangeSize (lA,uA) * (+ unsafeIndex (l9,u9) i9 + unsafeRangeSize (l9,u9) * (+ unsafeIndex (l8,u8) i8 + unsafeRangeSize (l8,u8) * (+ unsafeIndex (l7,u7) i7 + unsafeRangeSize (l7,u7) * (+ unsafeIndex (l6,u6) i6 + unsafeRangeSize (l6,u6) * (+ unsafeIndex (l5,u5) i5 + unsafeRangeSize (l5,u5) * (+ unsafeIndex (l4,u4) i4 + unsafeRangeSize (l4,u4) * (+ unsafeIndex (l3,u3) i3 + unsafeRangeSize (l3,u3) * (+ unsafeIndex (l2,u2) i2 + unsafeRangeSize (l2,u2) * (+ unsafeIndex (l1,u1) i1))))))))))))))++ inRange ((l1,l2,l3,l4,l5,l6,l7,l8,l9,lA,lB,lC,lD,lE,lF),+ (u1,u2,u3,u4,u5,u6,u7,u8,u9,uA,uB,uC,uD,uE,uF))+ (i1,i2,i3,i4,i5,i6,i7,i8,i9,iA,iB,iC,iD,iE,iF) =+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&+ inRange (l3,u3) i3 && inRange (l4,u4) i4 &&+ inRange (l5,u5) i5 && inRange (l6,u6) i6 &&+ inRange (l7,u7) i7 && inRange (l8,u8) i8 &&+ inRange (l9,u9) i9 && inRange (lA,uA) iA &&+ inRange (lB,uB) iB && inRange (lC,uC) iC &&+ inRange (lD,uD) iD && inRange (lE,uE) iE &&+ inRange (lF,uF) iF -- Default method for index
GHC/List.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, ScopedTypeVariables, MagicHash #-} {-# LANGUAGE BangPatterns #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} ----------------------------------------------------------------------------- -- |@@ -35,16 +36,34 @@ import Data.Maybe import GHC.Base import GHC.Num (Num(..))-import GHC.Integer (Integer)+import GHC.Num.Integer (Integer) infixl 9 !! infix 4 `elem`, `notElem` +-- $setup+-- >>> import GHC.Base+-- >>> import Prelude (Num (..), Ord (..), Int, Double, odd, not, undefined)+-- >>> import Control.DeepSeq (force)+--+-- -- compiled versions are uninterruptible.+-- https://gitlab.haskell.org/ghc/ghc/-/issues/367+--+-- >>> let or = foldr (||) False+-- >>> let and = foldr (&&) True+ -------------------------------------------------------------- -- List-manipulation functions -------------------------------------------------------------- -- | \(\mathcal{O}(1)\). Extract the first element of a list, which must be non-empty.+--+-- >>> head [1, 2, 3]+-- 1+-- >>> head [1..]+-- 1+-- >>> head []+-- Exception: Prelude.head: empty list head :: [a] -> a head (x:_) = x head [] = badHead@@ -62,23 +81,46 @@ head (augment g xs) = g (\x _ -> x) (head xs) #-} --- | \(\mathcal{O}(1)\). Decompose a list into its head and tail. If the list is--- empty, returns 'Nothing'. If the list is non-empty, returns @'Just' (x, xs)@,+-- | \(\mathcal{O}(1)\). Decompose a list into its head and tail.+--+-- * If the list is empty, returns 'Nothing'.+-- * If the list is non-empty, returns @'Just' (x, xs)@, -- where @x@ is the head of the list and @xs@ its tail. -- -- @since 4.8.0.0+--+-- >>> uncons []+-- Nothing+-- >>> uncons [1]+-- Just (1,[])+-- >>> uncons [1, 2, 3]+-- Just (1,[2,3]) uncons :: [a] -> Maybe (a, [a]) uncons [] = Nothing uncons (x:xs) = Just (x, xs) -- | \(\mathcal{O}(1)\). Extract the elements after the head of a list, which -- must be non-empty.+--+-- >>> tail [1, 2, 3]+-- [2,3]+-- >>> tail [1]+-- []+-- >>> tail []+-- Exception: Prelude.tail: empty list tail :: [a] -> [a] tail (_:xs) = xs tail [] = errorEmptyList "tail" -- | \(\mathcal{O}(n)\). Extract the last element of a list, which must be -- finite and non-empty.+--+-- >>> last [1, 2, 3]+-- 3+-- >>> last [1..]+-- * Hangs forever *+-- >>> last []+-- Exception: Prelude.last: empty list last :: [a] -> a #if defined(USE_REPORT_PRELUDE) last [x] = x@@ -87,7 +129,7 @@ #else -- Use foldl to make last a good consumer. -- This will compile to good code for the actual GHC.List.last.--- (At least as long it is eta-expaned, otherwise it does not, #10260.)+-- (At least as long it is eta-expanded, otherwise it does not, #10260.) last xs = foldl (\_ x -> x) lastError xs {-# INLINE last #-} -- The inline pragma is required to make GHC remember the implementation via@@ -98,6 +140,13 @@ -- | \(\mathcal{O}(n)\). Return all the elements of a list except the last one. -- The list must be non-empty.+--+-- >>> init [1, 2, 3]+-- [1,2]+-- >>> init [1]+-- []+-- >>> init []+-- Exception: Prelude.init: empty list init :: [a] -> [a] #if defined(USE_REPORT_PRELUDE) init [x] = []@@ -112,6 +161,13 @@ #endif -- | \(\mathcal{O}(1)\). Test whether a list is empty.+--+-- >>> null []+-- True+-- >>> null [1]+-- False+-- >>> null [1..]+-- False null :: [a] -> Bool null [] = True null (_:_) = False@@ -119,6 +175,13 @@ -- | \(\mathcal{O}(n)\). 'length' returns the length of a finite list as an -- 'Int'. It is an instance of the more general 'Data.List.genericLength', the -- result type of which may be any kind of number.+--+-- >>> length []+-- 0+-- >>> length ['a', 'b', 'c']+-- 3+-- >>> length [1..]+-- * Hangs forever * {-# NOINLINE [1] length #-} length :: [a] -> Int length xs = lenAcc xs 0@@ -149,7 +212,6 @@ -- -- >>> filter odd [1, 2, 3] -- [1,3]- {-# NOINLINE [1] filter #-} filter :: (a -> Bool) -> [a] -> [a] filter _pred [] = []@@ -185,7 +247,17 @@ -- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn -- -- The list must be finite.-+--+-- >>> foldl (+) 0 [1..4]+-- 10+-- >>> foldl (+) 42 []+-- 42+-- >>> foldl (-) 100 [1..4]+-- 90+-- >>> foldl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']+-- "dcbafoo"+-- >>> foldl (+) 0 [1..]+-- * Hangs forever * foldl :: forall a b. (b -> a -> b) -> b -> [a] -> b {-# INLINE foldl #-} foldl k z0 xs =@@ -216,10 +288,10 @@ FB functions because their names usually end with 'FB'. It's a good idea to inline FB functions because: -* They are higher-order functions and therefore benefits from inlining.+* They are higher-order functions and therefore benefit from inlining. * When the final consumer is a left fold, inlining the FB functions is the only- way to make arity expansion to happen. See Note [Left fold via right fold].+ way to make arity expansion happen. See Note [Left fold via right fold]. For this reason we mark all FB functions INLINE [0]. The [0] phase-specifier ensures that calls to FB functions can be written back to the original form@@ -239,12 +311,25 @@ -- See Note [Left folds via right fold] -- | 'foldl1' is a variant of 'foldl' that has no starting value argument,--- and thus must be applied to non-empty lists.+-- and thus must be applied to non-empty lists. Note that unlike 'foldl', the accumulated value must be of the same type as the list elements.+--+-- >>> foldl1 (+) [1..4]+-- 10+-- >>> foldl1 (+) []+-- Exception: Prelude.foldl1: empty list+-- >>> foldl1 (-) [1..4]+-- -8+-- >>> foldl1 (&&) [True, False, True, True]+-- False+-- >>> foldl1 (||) [False, False, True, True]+-- True+-- >>> foldl1 (+) [1..]+-- * Hangs forever * foldl1 :: (a -> a -> a) -> [a] -> a foldl1 f (x:xs) = foldl f x xs foldl1 _ [] = errorEmptyList "foldl1" --- | A strict version of 'foldl1'+-- | A strict version of 'foldl1'. foldl1' :: (a -> a -> a) -> [a] -> a foldl1' f (x:xs) = foldl' f x xs foldl1' _ [] = errorEmptyList "foldl1'"@@ -253,11 +338,33 @@ -- List sum and product -- | The 'sum' function computes the sum of a finite list of numbers.+--+-- >>> sum []+-- 0+-- >>> sum [42]+-- 42+-- >>> sum [1..10]+-- 55+-- >>> sum [4.1, 2.0, 1.7]+-- 7.8+-- >>> sum [1..]+-- * Hangs forever * sum :: (Num a) => [a] -> a {-# INLINE sum #-} sum = foldl (+) 0 -- | The 'product' function computes the product of a finite list of numbers.+--+-- >>> product []+-- 1+-- >>> product [42]+-- 42+-- >>> product [1..10]+-- 3628800+-- >>> product [4.1, 2.0, 1.7]+-- 13.939999999999998+-- >>> product [1..]+-- * Hangs forever * product :: (Num a) => [a] -> a {-# INLINE product #-} product = foldl (*) 1@@ -269,7 +376,18 @@ -- -- Note that ----- > last (scanl f z xs) == foldl f z xs.+-- > last (scanl f z xs) == foldl f z xs+--+-- >>> scanl (+) 0 [1..4]+-- [0,1,3,6,10]+-- >>> scanl (+) 42 []+-- [42]+-- >>> scanl (-) 100 [1..4]+-- [100,99,97,94,90]+-- >>> scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']+-- ["foo","afoo","bafoo","cbafoo","dcbafoo"]+-- >>> scanl (+) 0 [1..]+-- * Hangs forever * -- This peculiar arrangement is necessary to prevent scanl being rewritten in -- its own right-hand side.@@ -304,12 +422,24 @@ -- value argument: -- -- > scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]-+--+-- >>> scanl1 (+) [1..4]+-- [1,3,6,10]+-- >>> scanl1 (+) []+-- []+-- >>> scanl1 (-) [1..4]+-- [1,-1,-4,-8]+-- >>> scanl1 (&&) [True, False, True, True]+-- [True,False,False,False]+-- >>> scanl1 (||) [False, False, True, True]+-- [False,False,True,True]+-- >>> scanl1 (+) [1..]+-- * Hangs forever * scanl1 :: (a -> a -> a) -> [a] -> [a] scanl1 f (x:xs) = scanl f x xs scanl1 _ [] = [] --- | \(\mathcal{O}(n)\). A strictly accumulating version of 'scanl'+-- | \(\mathcal{O}(n)\). A strict version of 'scanl'. {-# NOINLINE [1] scanl' #-} scanl' :: (b -> a -> b) -> b -> [a] -> [b] -- This peculiar form is needed to prevent scanl' from being rewritten@@ -372,8 +502,20 @@ -- above functions. -- | 'foldr1' is a variant of 'foldr' that has no starting value argument,--- and thus must be applied to non-empty lists.-+-- and thus must be applied to non-empty lists. Note that unlike 'foldr', the accumulated value must be of the same type as the list elements.+--+-- >>> foldr1 (+) [1..4]+-- 10+-- >>> foldr1 (+) []+-- Exception: Prelude.foldr1: empty list+-- >>> foldr1 (-) [1..4]+-- -2+-- >>> foldr1 (&&) [True, False, True, True]+-- False+-- >>> foldr1 (||) [False, False, True, True]+-- True+-- >>> force $ foldr1 (+) [1..]+-- *** Exception: stack overflow foldr1 :: (a -> a -> a) -> [a] -> a foldr1 f = go where go [x] = x@@ -381,10 +523,21 @@ go [] = errorEmptyList "foldr1" {-# INLINE [0] foldr1 #-} --- | \(\mathcal{O}(n)\). 'scanr' is the right-to-left dual of 'scanl'.--- Note that+-- | \(\mathcal{O}(n)\). 'scanr' is the right-to-left dual of 'scanl'. Note that the order of parameters on the accumulating function are reversed compared to 'scanl'.+-- Also note that -- -- > head (scanr f z xs) == foldr f z xs.+--+-- >>> scanr (+) 0 [1..4]+-- [10,9,7,4,0]+-- >>> scanr (+) 42 []+-- [42]+-- >>> scanr (-) 100 [1..4]+-- [98,-97,99,-96,100]+-- >>> scanr (\nextChar reversedString -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']+-- ["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]+-- >>> force $ scanr (+) 0 [1..]+-- *** Exception: stack overflow {-# NOINLINE [1] scanr #-} scanr :: (a -> b -> b) -> b -> [a] -> [b] scanr _ q0 [] = [q0]@@ -400,7 +553,7 @@ scanrFB :: (a -> b -> b) -> (b -> c -> c) -> a -> (b, c) -> (b, c) scanrFB f c = \x ~(r, est) -> (f x r, r `c` est) -- This lazy pattern match on the tuple is necessary to prevent--- an infinite loop when scanr recieves a fusable infinite list,+-- an infinite loop when scanr receives a fusable infinite list, -- which was the reason for #16943. -- See Note [scanrFB and evaluation] below @@ -425,7 +578,7 @@ Either the tuple is returned (trivial), or scanrFB is called: g (scanrFB f c) (q0,n) = scanrFB ... (g' (scanrFB f c) (q0,n)) Notice that thanks to the strictness of scanrFB, the expression-g' (scanrFB f c) (q0,n) gets evaluated aswell. In particular, if g' is a+g' (scanrFB f c) (q0,n) gets evaluated as well. In particular, if g' is a recursive case of g, parametricity applies again and we will again have a possible call to scanrFB. In short, g (scanrFB f c) (q0,n) will end up being completely evaluated. This is resource consuming for large lists and if the@@ -437,6 +590,19 @@ -- | \(\mathcal{O}(n)\). 'scanr1' is a variant of 'scanr' that has no starting -- value argument.+--+-- >>> scanr1 (+) [1..4]+-- [10,9,7,4]+-- >>> scanr1 (+) []+-- []+-- >>> scanr1 (-) [1..4]+-- [-2,3,-1,4]+-- >>> scanr1 (&&) [True, False, True, True]+-- [False,False,True,True]+-- >>> scanr1 (||) [True, True, False, False]+-- [True,True,False,False]+-- >>> force $ scanr1 (+) [1..]+-- *** Exception: stack overflow scanr1 :: (a -> a -> a) -> [a] -> [a] scanr1 _ [] = [] scanr1 _ [x] = [x]@@ -447,6 +613,15 @@ -- which must be non-empty, finite, and of an ordered type. -- It is a special case of 'Data.List.maximumBy', which allows the -- programmer to supply their own comparison function.+--+-- >>> maximum []+-- Exception: Prelude.maximum: empty list+-- >>> maximum [42]+-- 42+-- >>> maximum [55, -12, 7, 0, -89]+-- 55+-- >>> maximum [1..]+-- * Hangs forever * maximum :: (Ord a) => [a] -> a {-# INLINABLE maximum #-} maximum [] = errorEmptyList "maximum"@@ -462,6 +637,15 @@ -- which must be non-empty, finite, and of an ordered type. -- It is a special case of 'Data.List.minimumBy', which allows the -- programmer to supply their own comparison function.+--+-- >>> minimum []+-- Exception: Prelude.minimum: empty list+-- >>> minimum [42]+-- 42+-- >>> minimum [55, -12, 7, 0, -89]+-- -89+-- >>> minimum [1..]+-- * Hangs forever * minimum :: (Ord a) => [a] -> a {-# INLINABLE minimum #-} minimum [] = errorEmptyList "minimum"@@ -479,6 +663,11 @@ -- Note that 'iterate' is lazy, potentially leading to thunk build-up if -- the consumer doesn't force each iterate. See 'iterate'' for a strict -- variant of this function.+--+-- >>> take 10 $ iterate not True+-- [True,False,True,False...+-- >>> take 10 $ iterate (+3) 42+-- [42,45,48,51,54,57,60,63... {-# NOINLINE [1] iterate #-} iterate :: (a -> a) -> a -> [a] iterate f x = x : iterate f (f x)@@ -496,8 +685,9 @@ -- | 'iterate'' is the strict version of 'iterate'. ----- It ensures that the result of each application of force to weak head normal--- form before proceeding.+-- It forces the result of each application of the function to weak head normal+-- form (WHNF)+-- before proceeding. {-# NOINLINE [1] iterate' #-} iterate' :: (a -> a) -> a -> [a] iterate' f x =@@ -518,6 +708,9 @@ -- | 'repeat' @x@ is an infinite list, with @x@ the value of every element.+--+-- >>> take 20 $ repeat 17+--[17,17,17,17,17,17,17,17,17... repeat :: a -> [a] {-# INLINE [0] repeat #-} -- The pragma just gives the rules more chance to fire@@ -537,6 +730,13 @@ -- every element. -- It is an instance of the more general 'Data.List.genericReplicate', -- in which @n@ may be of any integral type.+--+-- >>> replicate 0 True+-- []+-- >>> replicate (-1) True+-- []+-- >>> replicate 4 True+-- [True,True,True,True] {-# INLINE replicate #-} replicate :: Int -> a -> [a] replicate n x = take n (repeat x)@@ -544,19 +744,26 @@ -- | 'cycle' ties a finite list into a circular one, or equivalently, -- the infinite repetition of the original list. It is the identity -- on infinite lists.-+--+-- >>> cycle []+-- *** Exception: Prelude.cycle: empty list+-- >>> take 20 $ cycle [42]+-- [42,42,42,42,42,42,42,42,42,42...+-- >>> take 20 $ cycle [2, 5, 7]+-- [2,5,7,2,5,7,2,5,7,2,5,7... cycle :: [a] -> [a] cycle [] = errorEmptyList "cycle" cycle xs = xs' where xs' = xs ++ xs' -- | 'takeWhile', applied to a predicate @p@ and a list @xs@, returns the--- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@:------ > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]--- > takeWhile (< 9) [1,2,3] == [1,2,3]--- > takeWhile (< 0) [1,2,3] == []+-- longest prefix (possibly empty) of @xs@ of elements that satisfy @p@. ---+-- >>> takeWhile (< 3) [1,2,3,4,1,2,3,4]+-- [1,2]+-- >>> takeWhile (< 9) [1,2,3]+-- [1,2,3]+-- >>> takeWhile (< 0) [1,2,3]+-- [] {-# NOINLINE [1] takeWhile #-} takeWhile :: (a -> Bool) -> [a] -> [a] takeWhile _ [] = []@@ -583,13 +790,14 @@ takeWhileFB (\x -> q x && p x) c n #-} --- | 'dropWhile' @p xs@ returns the suffix remaining after 'takeWhile' @p xs@:------ > dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]--- > dropWhile (< 9) [1,2,3] == []--- > dropWhile (< 0) [1,2,3] == [1,2,3]+-- | 'dropWhile' @p xs@ returns the suffix remaining after 'takeWhile' @p xs@. ---+-- >>> dropWhile (< 3) [1,2,3,4,5,1,2,3]+-- [3,4,5,1,2,3]+-- >>> dropWhile (< 9) [1,2,3]+-- []+-- >>> dropWhile (< 0) [1,2,3]+-- [1,2,3] dropWhile :: (a -> Bool) -> [a] -> [a] dropWhile _ [] = [] dropWhile p xs@(x:xs')@@ -597,14 +805,20 @@ | otherwise = xs -- | 'take' @n@, applied to a list @xs@, returns the prefix of @xs@--- of length @n@, or @xs@ itself if @n > 'length' xs@:+-- of length @n@, or @xs@ itself if @n > 'length' xs@. ----- > take 5 "Hello World!" == "Hello"--- > take 3 [1,2,3,4,5] == [1,2,3]--- > take 3 [1,2] == [1,2]--- > take 3 [] == []--- > take (-1) [1,2] == []--- > take 0 [1,2] == []+-- >>> take 5 "Hello World!"+-- "Hello"+-- >>> take 3 [1,2,3,4,5]+-- [1,2,3]+-- >>> take 3 [1,2]+-- [1,2]+-- >>> take 3 []+-- []+-- >>> take (-1) [1,2]+-- []+-- >>> take 0 [1,2]+-- [] -- -- It is an instance of the more general 'Data.List.genericTake', -- in which @n@ may be of any integral type.@@ -664,14 +878,20 @@ #endif -- | 'drop' @n xs@ returns the suffix of @xs@--- after the first @n@ elements, or @[]@ if @n > 'length' xs@:+-- after the first @n@ elements, or @[]@ if @n > 'length' xs@. ----- > drop 6 "Hello World!" == "World!"--- > drop 3 [1,2,3,4,5] == [4,5]--- > drop 3 [1,2] == []--- > drop 3 [] == []--- > drop (-1) [1,2] == [1,2]--- > drop 0 [1,2] == [1,2]+-- >>> drop 6 "Hello World!"+-- "World!"+-- >>> drop 3 [1,2,3,4,5]+-- [4,5]+-- >>> drop 3 [1,2]+-- []+-- >>> drop 3 []+-- []+-- >>> drop (-1) [1,2]+-- [1,2]+-- >>> drop 0 [1,2]+-- [1,2] -- -- It is an instance of the more general 'Data.List.genericDrop', -- in which @n@ may be of any integral type.@@ -697,13 +917,20 @@ -- | 'splitAt' @n xs@ returns a tuple where first element is @xs@ prefix of -- length @n@ and second element is the remainder of the list: ----- > splitAt 6 "Hello World!" == ("Hello ","World!")--- > splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])--- > splitAt 1 [1,2,3] == ([1],[2,3])--- > splitAt 3 [1,2,3] == ([1,2,3],[])--- > splitAt 4 [1,2,3] == ([1,2,3],[])--- > splitAt 0 [1,2,3] == ([],[1,2,3])--- > splitAt (-1) [1,2,3] == ([],[1,2,3])+-- >>> splitAt 6 "Hello World!"+-- ("Hello ","World!")+-- >>> splitAt 3 [1,2,3,4,5]+-- ([1,2,3],[4,5])+-- >>> splitAt 1 [1,2,3]+-- ([1],[2,3])+-- >>> splitAt 3 [1,2,3]+-- ([1,2,3],[])+-- >>> splitAt 4 [1,2,3]+-- ([1,2,3],[])+-- >>> splitAt 0 [1,2,3]+-- ([],[1,2,3])+-- >>> splitAt (-1) [1,2,3]+-- ([],[1,2,3]) -- -- It is equivalent to @('take' n xs, 'drop' n xs)@ when @n@ is not @_|_@ -- (@splitAt _|_ xs = _|_@).@@ -730,12 +957,14 @@ -- first element is longest prefix (possibly empty) of @xs@ of elements that -- satisfy @p@ and second element is the remainder of the list: ----- > span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])--- > span (< 9) [1,2,3] == ([1,2,3],[])--- > span (< 0) [1,2,3] == ([],[1,2,3])+-- >>> span (< 3) [1,2,3,4,1,2,3,4]+-- ([1,2],[3,4,1,2,3,4])+-- >>> span (< 9) [1,2,3]+-- ([1,2,3],[])+-- >>> span (< 0) [1,2,3]+-- ([],[1,2,3]) -- -- 'span' @p xs@ is equivalent to @('takeWhile' p xs, 'dropWhile' p xs)@- span :: (a -> Bool) -> [a] -> ([a],[a]) span _ xs@[] = (xs, xs) span p xs@(x:xs')@@ -746,12 +975,14 @@ -- first element is longest prefix (possibly empty) of @xs@ of elements that -- /do not satisfy/ @p@ and second element is the remainder of the list: ----- > break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])--- > break (< 9) [1,2,3] == ([],[1,2,3])--- > break (> 9) [1,2,3] == ([1,2,3],[])+-- >>> break (> 3) [1,2,3,4,1,2,3,4]+-- ([1,2,3],[4,1,2,3,4])+-- >>> break (< 9) [1,2,3]+-- ([],[1,2,3])+-- >>> break (> 9) [1,2,3]+-- ([1,2,3],[]) -- -- 'break' @p@ is equivalent to @'span' ('not' . p)@.- break :: (a -> Bool) -> [a] -> ([a],[a]) #if defined(USE_REPORT_PRELUDE) break p = span (not . p)@@ -765,6 +996,15 @@ -- | 'reverse' @xs@ returns the elements of @xs@ in reverse order. -- @xs@ must be finite.+--+-- >>> reverse []+-- []+-- >>> reverse [42]+-- [42]+-- >>> reverse [2,5,7]+-- [7,5,2]+-- >>> reverse [1..]+-- * Hangs forever * reverse :: [a] -> [a] #if defined(USE_REPORT_PRELUDE) reverse = foldl (flip (:)) []@@ -775,9 +1015,22 @@ rev (x:xs) a = rev xs (x:a) #endif --- | 'and' returns the conjunction of a Boolean list. For the result to be+-- | 'and' returns the conjunction of a Boolean list. For the result to be -- 'True', the list must be finite; 'False', however, results from a 'False' -- value at a finite index of a finite or infinite list.+--+-- >>> and []+-- True+-- >>> and [True]+-- True+-- >>> and [False]+-- False+-- >>> and [True, True, False]+-- False+-- >>> and (False : repeat True) -- Infinite list [False,True,True,True,True,True,True...+-- False+-- >>> and (repeat True)+-- * Hangs forever * and :: [Bool] -> Bool #if defined(USE_REPORT_PRELUDE) and = foldr (&&) True@@ -792,9 +1045,22 @@ #-} #endif --- | 'or' returns the disjunction of a Boolean list. For the result to be+-- | 'or' returns the disjunction of a Boolean list. For the result to be -- 'False', the list must be finite; 'True', however, results from a 'True' -- value at a finite index of a finite or infinite list.+--+-- >>> or []+-- False+-- >>> or [True]+-- True+-- >>> or [False]+-- False+-- >>> or [True, True, False]+-- True+-- >>> or (True : repeat False) -- Infinite list [True,False,False,False,False,False,False...+-- True+-- >>> or (repeat False)+-- * Hangs forever * or :: [Bool] -> Bool #if defined(USE_REPORT_PRELUDE) or = foldr (||) False@@ -810,11 +1076,22 @@ #endif -- | Applied to a predicate and a list, 'any' determines if any element--- of the list satisfies the predicate. For the result to be+-- of the list satisfies the predicate. For the result to be -- 'False', the list must be finite; 'True', however, results from a 'True'--- value for the predicate applied to an element at a finite index of a finite or infinite list.+-- value for the predicate applied to an element at a finite index of a finite+-- or infinite list.+--+-- >>> any (> 3) []+-- False+-- >>> any (> 3) [1,2]+-- False+-- >>> any (> 3) [1,2,3,4,5]+-- True+-- >>> any (> 3) [1..]+-- True+-- >>> any (> 3) [0, -1..]+-- * Hangs forever * any :: (a -> Bool) -> [a] -> Bool- #if defined(USE_REPORT_PRELUDE) any p = or . map p #else@@ -832,7 +1109,19 @@ -- | Applied to a predicate and a list, 'all' determines if all elements -- of the list satisfy the predicate. For the result to be -- 'True', the list must be finite; 'False', however, results from a 'False'--- value for the predicate applied to an element at a finite index of a finite or infinite list.+-- value for the predicate applied to an element at a finite index of a finite+-- or infinite list.+--+-- >>> all (> 3) []+-- True+-- >>> all (> 3) [1,2]+-- False+-- >>> all (> 3) [1,2,3,4,5]+-- False+-- >>> all (> 3) [1..]+-- False+-- >>> all (> 3) [4..]+-- * Hangs forever * all :: (a -> Bool) -> [a] -> Bool #if defined(USE_REPORT_PRELUDE) all p = and . map p@@ -852,6 +1141,17 @@ -- e.g., @x \`elem\` xs@. For the result to be -- 'False', the list must be finite; 'True', however, results from an element -- equal to @x@ found at a finite index of a finite or infinite list.+--+-- >>> 3 `elem` []+-- False+-- >>> 3 `elem` [1,2]+-- False+-- >>> 3 `elem` [1,2,3,4,5]+-- True+-- >>> 3 `elem` [1..]+-- True+-- >>> 3 `elem` [4..]+-- * Hangs forever * elem :: (Eq a) => a -> [a] -> Bool #if defined(USE_REPORT_PRELUDE) elem x = any (== x)@@ -860,12 +1160,23 @@ elem x (y:ys) = x==y || elem x ys {-# NOINLINE [1] elem #-} {-# RULES-"elem/build" forall x (g :: forall b . Eq a => (a -> b -> b) -> b -> b)+"elem/build" forall x (g :: forall b . (a -> b -> b) -> b -> b) . elem x (build g) = g (\ y r -> (x == y) || r) False #-} #endif -- | 'notElem' is the negation of 'elem'.+--+-- >>> 3 `notElem` []+-- True+-- >>> 3 `notElem` [1,2]+-- True+-- >>> 3 `notElem` [1,2,3,4,5]+-- False+-- >>> 3 `notElem` [1..]+-- False+-- >>> 3 `notElem` [4..]+-- * Hangs forever * notElem :: (Eq a) => a -> [a] -> Bool #if defined(USE_REPORT_PRELUDE) notElem x = all (/= x)@@ -874,7 +1185,7 @@ notElem x (y:ys)= x /= y && notElem x ys {-# NOINLINE [1] notElem #-} {-# RULES-"notElem/build" forall x (g :: forall b . Eq a => (a -> b -> b) -> b -> b)+"notElem/build" forall x (g :: forall b . (a -> b -> b) -> b -> b) . notElem x (build g) = g (\ y r -> (x /= y) && r) True #-} #endif@@ -882,6 +1193,10 @@ -- | \(\mathcal{O}(n)\). 'lookup' @key assocs@ looks up a key in an association -- list. --+-- >>> lookup 2 []+-- Nothing+-- >>> lookup 2 [(1, "first")]+-- Nothing -- >>> lookup 2 [(1, "first"), (2, "second"), (3, "third")] -- Just "second" lookup :: (Eq a) => a -> [(a,b)] -> Maybe b@@ -890,7 +1205,15 @@ | key == x = Just y | otherwise = lookup key xys --- | Map a function over a list and concatenate the results.+-- | Map a function returning a list over a list and concatenate the results.+-- 'concatMap' can be seen as the composition of 'concat' and 'map'.+--+-- > concatMap f xs == (concat . map f) xs+--+-- >>> concatMap (\i -> [-i,i]) []+-- []+-- >>> concatMap (\i -> [-i,i]) [1,2,3]+-- [-1,1,-2,2,-3,3] concatMap :: (a -> [b]) -> [a] -> [b] concatMap f = foldr ((++) . f) [] @@ -903,6 +1226,13 @@ -- | Concatenate a list of lists.+--+-- >>> concat []+-- []+-- >>> concat [[42]]+-- [42]+-- >>> concat [[1,2,3], [4,5], [6], []]+-- [1,2,3,4,5,6] concat :: [[a]] -> [a] concat = foldr (++) [] @@ -917,6 +1247,15 @@ -- | List index (subscript) operator, starting from 0. -- It is an instance of the more general 'Data.List.genericIndex', -- which takes an index of any integral type.+--+-- >>> ['a', 'b', 'c'] !! 0+-- 'a'+-- >>> ['a', 'b', 'c'] !! 2+-- 'c'+-- >>> ['a', 'b', 'c'] !! 3+-- Exception: Prelude.!!: index too large+-- >>> ['a', 'b', 'c'] !! (-1)+-- Exception: Prelude.!!: negative index (!!) :: [a] -> Int -> a #if defined(USE_REPORT_PRELUDE) xs !! n | n < 0 = errorWithoutStackTrace "Prelude.!!: negative index"@@ -1043,18 +1382,27 @@ -- | \(\mathcal{O}(\min(m,n))\). 'zip' takes two lists and returns a list of -- corresponding pairs. ----- > zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]+-- >>> zip [1, 2] ['a', 'b']+-- [(1, 'a'), (2, 'b')] ----- If one input list is short, excess elements of the longer list are--- discarded:+-- If one input list is shorter than the other, excess elements of the longer+-- list are discarded, even if one of the lists is infinite: ----- > zip [1] ['a', 'b'] = [(1, 'a')]--- > zip [1, 2] ['a'] = [(1, 'a')]+-- >>> zip [1] ['a', 'b']+-- [(1, 'a')]+-- >>> zip [1, 2] ['a']+-- [(1, 'a')]+-- >>> zip [] [1..]+-- []+-- >>> zip [1..] []+-- [] -- -- 'zip' is right-lazy: ----- > zip [] _|_ = []--- > zip _|_ [] = _|_+-- >>> zip [] _|_+-- []+-- >>> zip _|_ []+-- _|_ -- -- 'zip' is capable of list fusion, but it is restricted to its -- first list argument and its resulting list.@@ -1099,8 +1447,12 @@ ---------------------------------------------- -- | \(\mathcal{O}(\min(m,n))\). 'zipWith' generalises 'zip' by zipping with the--- function given as the first argument, instead of a tupling function. For--- example, @'zipWith' (+)@ is applied to two lists to produce the list of+-- function given as the first argument, instead of a tupling function.+--+-- > zipWith (,) xs ys == zip xs ys+-- > zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]+--+-- For example, @'zipWith' (+)@ is applied to two lists to produce the list of -- corresponding sums: -- -- >>> zipWith (+) [1, 2, 3] [4, 5, 6]@@ -1108,7 +1460,8 @@ -- -- 'zipWith' is right-lazy: ----- > zipWith f [] _|_ = []+-- >>> zipWith f [] _|_+-- [] -- -- 'zipWith' is capable of list fusion, but it is restricted to its -- first list argument and its resulting list.@@ -1132,10 +1485,13 @@ #-} -- | The 'zipWith3' function takes a function which combines three--- elements, as well as three lists and returns a list of their point-wise--- combination, analogous to 'zipWith'.+-- elements, as well as three lists and returns a list of the function applied+-- to corresponding elements, analogous to 'zipWith'. -- It is capable of list fusion, but it is restricted to its -- first list argument and its resulting list.+--+-- > zipWith3 (,,) xs ys zs == zip3 xs ys zs+-- > zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..] {-# NOINLINE [1] zipWith3 #-} zipWith3 :: (a->b->c->d) -> [a]->[b]->[c]->[d] zipWith3 z = go@@ -1154,6 +1510,11 @@ -- | 'unzip' transforms a list of pairs into a list of first components -- and a list of second components.+--+-- >>> unzip []+-- ([],[])+-- >>> unzip [(1, 'a'), (2, 'b')]+-- ([1,2],"ab") unzip :: [(a,b)] -> ([a],[b]) {-# INLINE unzip #-} -- Inline so that fusion `foldr` has an opportunity to fire.@@ -1162,6 +1523,11 @@ -- | The 'unzip3' function takes a list of triples and returns three -- lists, analogous to 'unzip'.+--+-- >>> unzip3 []+-- ([],[],[])+-- >>> unzip3 [(1, 'a', True), (2, 'b', False)]+-- ([1,2],"ab",[True,False]) unzip3 :: [(a,b,c)] -> ([a],[b],[c]) {-# INLINE unzip3 #-} -- Inline so that fusion `foldr` has an opportunity to fire.
GHC/Maybe.hs view
@@ -7,7 +7,7 @@ ) where -import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base import GHC.Classes default ()
GHC/Natural.hs view
@@ -1,152 +1,79 @@+{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-}-{-# LANGUAGE UnboxedTuples #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE UnboxedSums #-} --------------------------------------------------------------------------------- |--- Module : GHC.Natural--- Copyright : (C) 2014 Herbert Valerio Riedel,--- (C) 2011 Edward Kmett--- License : see libraries/base/LICENSE------ Maintainer : libraries@haskell.org--- Stability : internal--- Portability : non-portable (GHC Extensions)------ The arbitrary-precision 'Natural' number type.------ __Note__: This is an internal GHC module with an API subject to--- change. It's recommended use the "Numeric.Natural" module to import--- the 'Natural' type.------ @since 4.8.0.0-------------------------------------------------------------------------------module GHC.Natural- ( -- * The 'Natural' number type- --- -- | __Warning__: The internal implementation of 'Natural'- -- (i.e. which constructors are available) depends on the- -- 'Integer' backend used!- Natural(..)- , mkNatural- , isValidNatural- -- * Arithmetic- , plusNatural- , minusNatural- , minusNaturalMaybe- , timesNatural- , negateNatural- , signumNatural- , quotRemNatural- , quotNatural- , remNatural- , gcdNatural- , lcmNatural- -- * Bits- , andNatural- , orNatural- , xorNatural- , bitNatural- , testBitNatural- , popCountNatural- , shiftLNatural- , shiftRNatural- -- * Conversions- , naturalToInteger- , naturalToWord- , naturalToInt- , naturalFromInteger- , wordToNatural- , intToNatural- , naturalToWordMaybe- , wordToNatural#- , wordToNaturalBase- -- * Modular arithmetic- , powModNatural- ) where+{-# OPTIONS_HADDOCK not-home #-} -#include "MachDeps.h"+-- | Compatibility module for pre ghc-bignum code.+module GHC.Natural+ ( Natural (NatS#, NatJ#)+ , B.BigNat (..)+ , mkNatural+ , isValidNatural+ -- * Arithmetic+ , plusNatural+ , minusNatural+ , minusNaturalMaybe+ , timesNatural+ , negateNatural+ , signumNatural+ , quotRemNatural+ , quotNatural+ , remNatural+ , gcdNatural+ , lcmNatural+ -- * Bits+ , andNatural+ , orNatural+ , xorNatural+ , bitNatural+ , testBitNatural+ , popCountNatural+ , shiftLNatural+ , shiftRNatural+ -- * Conversions+ , naturalToInteger+ , naturalToWord+ , naturalToWordMaybe+ , wordToNatural+ , wordToNatural#+ , naturalFromInteger+ -- * Modular arithmetic+ , powModNatural+ )+where -import GHC.Classes-import GHC.Maybe-import GHC.Types import GHC.Prim-import {-# SOURCE #-} GHC.Exception.Type (underflowException, divZeroException)-#if defined(MIN_VERSION_integer_gmp)-import GHC.Integer.GMP.Internals-#else-import GHC.Integer-#endif--default ()---- Most high-level operations need to be marked `NOINLINE` as--- otherwise GHC doesn't recognize them and fails to apply constant--- folding to `Natural`-typed expression.------ To this end, the CPP hack below allows to write the pseudo-pragma------ {-# CONSTANT_FOLDED plusNatural #-}------ which is simply expanded into a------ {-# NOINLINE plusNatural #-}--------- TODO: Note that some functions have commented CONSTANT_FOLDED annotations,--- that's because the Integer counter-parts of these functions do actually have--- a builtinRule in PrelRules, where the Natural functions do not. The plan is--- to eventually also add builtin rules for those functions on Natural.-#define CONSTANT_FOLDED NOINLINE------------------------------------------------------------------------------------ Arithmetic underflow------------------------------------------------------------------------------------ We put them here because they are needed relatively early--- in the libraries before the Exception type has been defined yet.+import GHC.Types+import GHC.Maybe+import GHC.Num.Natural (Natural)+import GHC.Num.Integer (Integer)+import qualified GHC.Num.BigNat as B+import qualified GHC.Num.Natural as N+import qualified GHC.Num.Integer as I -{-# NOINLINE underflowError #-}-underflowError :: a-underflowError = raise# underflowException+{-# COMPLETE NatS#, NatJ# #-} -{-# NOINLINE divZeroError #-}-divZeroError :: a-divZeroError = raise# divZeroException+pattern NatS# :: Word# -> Natural+pattern NatS# w = N.NS w ----------------------------------------------------------------------------------- Natural type--------------------------------------------------------------------------------+pattern NatJ# :: B.BigNat -> Natural+pattern NatJ# b <- N.NB (B.BN# -> b)+ where+ NatJ# b = N.NB (B.unBigNat b) -#if defined(MIN_VERSION_integer_gmp)--- TODO: if saturated arithmetic is to used, replace 'underflowError' by '0'+int2Word :: Int -> Word+int2Word (I# i) = W# (int2Word# i) --- | Type representing arbitrary-precision non-negative integers.------ >>> 2^100 :: Natural--- 1267650600228229401496703205376------ Operations whose result would be negative @'Control.Exception.throw'--- ('Control.Exception.Underflow' :: 'Control.Exception.ArithException')@,------ >>> -1 :: Natural--- *** Exception: arithmetic underflow------ @since 4.8.0.0-data Natural = NatS# GmpLimb# -- ^ in @[0, maxBound::Word]@- | NatJ# {-# UNPACK #-} !BigNat -- ^ in @]maxBound::Word, +inf[@- --- -- __Invariant__: 'NatJ#' is used- -- /iff/ value doesn't fit in- -- 'NatS#' constructor.- -- NB: Order of constructors *must*- -- coincide with 'Ord' relation- deriving ( Eq -- ^ @since 4.8.0.0- , Ord -- ^ @since 4.8.0.0- )+word2Int :: Word -> Int+word2Int (W# w) = I# (word2Int# w) +-- | Construct 'Natural' value from list of 'Word's.+mkNatural :: [Word] -> Natural+mkNatural = N.naturalFromWordList -- | Test whether all internal invariants are satisfied by 'Natural' value --@@ -155,470 +82,108 @@ -- -- @since 4.8.0.0 isValidNatural :: Natural -> Bool-isValidNatural (NatS# _) = True-isValidNatural (NatJ# bn) = isTrue# (isValidBigNat# bn)- -- A 1-limb BigNat could fit into a NatS#, so we- -- require at least 2 limbs.- && isTrue# (sizeofBigNat# bn ># 1#)--signumNatural :: Natural -> Natural-signumNatural (NatS# 0##) = NatS# 0##-signumNatural _ = NatS# 1##--- {-# CONSTANT_FOLDED signumNatural #-}--negateNatural :: Natural -> Natural-negateNatural (NatS# 0##) = NatS# 0##-negateNatural _ = underflowError--- {-# CONSTANT_FOLDED negateNatural #-}---- | @since 4.10.0.0-naturalFromInteger :: Integer -> Natural-naturalFromInteger (S# i#)- | isTrue# (i# >=# 0#) = NatS# (int2Word# i#)-naturalFromInteger (Jp# bn) = bigNatToNatural bn-naturalFromInteger _ = underflowError-{-# CONSTANT_FOLDED naturalFromInteger #-}---- | Compute greatest common divisor.-gcdNatural :: Natural -> Natural -> Natural-gcdNatural (NatS# 0##) y = y-gcdNatural x (NatS# 0##) = x-gcdNatural (NatS# 1##) _ = NatS# 1##-gcdNatural _ (NatS# 1##) = NatS# 1##-gcdNatural (NatJ# x) (NatJ# y) = bigNatToNatural (gcdBigNat x y)-gcdNatural (NatJ# x) (NatS# y) = NatS# (gcdBigNatWord x y)-gcdNatural (NatS# x) (NatJ# y) = NatS# (gcdBigNatWord y x)-gcdNatural (NatS# x) (NatS# y) = NatS# (gcdWord x y)---- | Compute least common multiple.-lcmNatural :: Natural -> Natural -> Natural-lcmNatural (NatS# 0##) _ = NatS# 0##-lcmNatural _ (NatS# 0##) = NatS# 0##-lcmNatural (NatS# 1##) y = y-lcmNatural x (NatS# 1##) = x-lcmNatural x y = (x `quotNatural` (gcdNatural x y)) `timesNatural` y--------------------------------------------------------------------------------quotRemNatural :: Natural -> Natural -> (Natural, Natural)-quotRemNatural _ (NatS# 0##) = divZeroError-quotRemNatural n (NatS# 1##) = (n,NatS# 0##)-quotRemNatural n@(NatS# _) (NatJ# _) = (NatS# 0##, n)-quotRemNatural (NatS# n) (NatS# d) = case quotRemWord# n d of- (# q, r #) -> (NatS# q, NatS# r)-quotRemNatural (NatJ# n) (NatS# d) = case quotRemBigNatWord n d of- (# q, r #) -> (bigNatToNatural q, NatS# r)-quotRemNatural (NatJ# n) (NatJ# d) = case quotRemBigNat n d of- (# q, r #) -> (bigNatToNatural q, bigNatToNatural r)--- {-# CONSTANT_FOLDED quotRemNatural #-}--quotNatural :: Natural -> Natural -> Natural-quotNatural _ (NatS# 0##) = divZeroError-quotNatural n (NatS# 1##) = n-quotNatural (NatS# _) (NatJ# _) = NatS# 0##-quotNatural (NatS# n) (NatS# d) = NatS# (quotWord# n d)-quotNatural (NatJ# n) (NatS# d) = bigNatToNatural (quotBigNatWord n d)-quotNatural (NatJ# n) (NatJ# d) = bigNatToNatural (quotBigNat n d)--- {-# CONSTANT_FOLDED quotNatural #-}--remNatural :: Natural -> Natural -> Natural-remNatural _ (NatS# 0##) = divZeroError-remNatural _ (NatS# 1##) = NatS# 0##-remNatural n@(NatS# _) (NatJ# _) = n-remNatural (NatS# n) (NatS# d) = NatS# (remWord# n d)-remNatural (NatJ# n) (NatS# d) = NatS# (remBigNatWord n d)-remNatural (NatJ# n) (NatJ# d) = bigNatToNatural (remBigNat n d)--- {-# CONSTANT_FOLDED remNatural #-}---- | @since 4.X.0.0-naturalToInteger :: Natural -> Integer-naturalToInteger (NatS# w) = wordToInteger w-naturalToInteger (NatJ# bn) = Jp# bn-{-# CONSTANT_FOLDED naturalToInteger #-}--andNatural :: Natural -> Natural -> Natural-andNatural (NatS# n) (NatS# m) = NatS# (n `and#` m)-andNatural (NatS# n) (NatJ# m) = NatS# (n `and#` bigNatToWord m)-andNatural (NatJ# n) (NatS# m) = NatS# (bigNatToWord n `and#` m)-andNatural (NatJ# n) (NatJ# m) = bigNatToNatural (andBigNat n m)--- {-# CONSTANT_FOLDED andNatural #-}--orNatural :: Natural -> Natural -> Natural-orNatural (NatS# n) (NatS# m) = NatS# (n `or#` m)-orNatural (NatS# n) (NatJ# m) = NatJ# (orBigNat (wordToBigNat n) m)-orNatural (NatJ# n) (NatS# m) = NatJ# (orBigNat n (wordToBigNat m))-orNatural (NatJ# n) (NatJ# m) = NatJ# (orBigNat n m)--- {-# CONSTANT_FOLDED orNatural #-}--xorNatural :: Natural -> Natural -> Natural-xorNatural (NatS# n) (NatS# m) = NatS# (n `xor#` m)-xorNatural (NatS# n) (NatJ# m) = NatJ# (xorBigNat (wordToBigNat n) m)-xorNatural (NatJ# n) (NatS# m) = NatJ# (xorBigNat n (wordToBigNat m))-xorNatural (NatJ# n) (NatJ# m) = bigNatToNatural (xorBigNat n m)--- {-# CONSTANT_FOLDED xorNatural #-}--bitNatural :: Int# -> Natural-bitNatural i#- | isTrue# (i# <# WORD_SIZE_IN_BITS#) = NatS# (1## `uncheckedShiftL#` i#)- | True = NatJ# (bitBigNat i#)--- {-# CONSTANT_FOLDED bitNatural #-}--testBitNatural :: Natural -> Int -> Bool-testBitNatural (NatS# w) (I# i#)- | isTrue# (i# <# WORD_SIZE_IN_BITS#) =- isTrue# ((w `and#` (1## `uncheckedShiftL#` i#)) `neWord#` 0##)- | True = False-testBitNatural (NatJ# bn) (I# i#) = testBitBigNat bn i#--- {-# CONSTANT_FOLDED testBitNatural #-}--popCountNatural :: Natural -> Int-popCountNatural (NatS# w) = I# (word2Int# (popCnt# w))-popCountNatural (NatJ# bn) = I# (popCountBigNat bn)--- {-# CONSTANT_FOLDED popCountNatural #-}--shiftLNatural :: Natural -> Int -> Natural-shiftLNatural n (I# 0#) = n-shiftLNatural (NatS# 0##) _ = NatS# 0##-shiftLNatural (NatS# 1##) (I# i#) = bitNatural i#-shiftLNatural (NatS# w) (I# i#)- = bigNatToNatural (shiftLBigNat (wordToBigNat w) i#)-shiftLNatural (NatJ# bn) (I# i#)- = bigNatToNatural (shiftLBigNat bn i#)--- {-# CONSTANT_FOLDED shiftLNatural #-}--shiftRNatural :: Natural -> Int -> Natural-shiftRNatural n (I# 0#) = n-shiftRNatural (NatS# w) (I# i#)- | isTrue# (i# >=# WORD_SIZE_IN_BITS#) = NatS# 0##- | True = NatS# (w `uncheckedShiftRL#` i#)-shiftRNatural (NatJ# bn) (I# i#) = bigNatToNatural (shiftRBigNat bn i#)--- {-# CONSTANT_FOLDED shiftRNatural #-}------------------------------------------------------------------------------+isValidNatural = N.naturalCheck -- | 'Natural' Addition plusNatural :: Natural -> Natural -> Natural-plusNatural (NatS# 0##) y = y-plusNatural x (NatS# 0##) = x-plusNatural (NatS# x) (NatS# y)- = case plusWord2# x y of- (# 0##, l #) -> NatS# l- (# h, l #) -> NatJ# (wordToBigNat2 h l)-plusNatural (NatS# x) (NatJ# y) = NatJ# (plusBigNatWord y x)-plusNatural (NatJ# x) (NatS# y) = NatJ# (plusBigNatWord x y)-plusNatural (NatJ# x) (NatJ# y) = NatJ# (plusBigNat x y)-{-# CONSTANT_FOLDED plusNatural #-}---- | 'Natural' multiplication-timesNatural :: Natural -> Natural -> Natural-timesNatural _ (NatS# 0##) = NatS# 0##-timesNatural (NatS# 0##) _ = NatS# 0##-timesNatural x (NatS# 1##) = x-timesNatural (NatS# 1##) y = y-timesNatural (NatS# x) (NatS# y) = case timesWord2# x y of- (# 0##, 0## #) -> NatS# 0##- (# 0##, xy #) -> NatS# xy- (# h , l #) -> NatJ# (wordToBigNat2 h l)-timesNatural (NatS# x) (NatJ# y) = NatJ# (timesBigNatWord y x)-timesNatural (NatJ# x) (NatS# y) = NatJ# (timesBigNatWord x y)-timesNatural (NatJ# x) (NatJ# y) = NatJ# (timesBigNat x y)-{-# CONSTANT_FOLDED timesNatural #-}+plusNatural = N.naturalAdd -- | 'Natural' subtraction. May @'Control.Exception.throw' -- 'Control.Exception.Underflow'@. minusNatural :: Natural -> Natural -> Natural-minusNatural x (NatS# 0##) = x-minusNatural (NatS# x) (NatS# y) = case subWordC# x y of- (# l, 0# #) -> NatS# l- _ -> underflowError-minusNatural (NatS# _) (NatJ# _) = underflowError-minusNatural (NatJ# x) (NatS# y)- = bigNatToNatural (minusBigNatWord x y)-minusNatural (NatJ# x) (NatJ# y)- = bigNatToNatural (minusBigNat x y)-{-# CONSTANT_FOLDED minusNatural #-}+minusNatural = N.naturalSubThrow -- | 'Natural' subtraction. Returns 'Nothing's for non-positive results. -- -- @since 4.8.0.0 minusNaturalMaybe :: Natural -> Natural -> Maybe Natural-minusNaturalMaybe x (NatS# 0##) = Just x-minusNaturalMaybe (NatS# x) (NatS# y) = case subWordC# x y of- (# l, 0# #) -> Just (NatS# l)- _ -> Nothing-minusNaturalMaybe (NatS# _) (NatJ# _) = Nothing-minusNaturalMaybe (NatJ# x) (NatS# y)- = Just (bigNatToNatural (minusBigNatWord x y))-minusNaturalMaybe (NatJ# x) (NatJ# y)- | isTrue# (isNullBigNat# res) = Nothing- | True = Just (bigNatToNatural res)- where- res = minusBigNat x y---- | Convert 'BigNat' to 'Natural'.--- Throws 'Control.Exception.Underflow' if passed a 'nullBigNat'.-bigNatToNatural :: BigNat -> Natural-bigNatToNatural bn- | isTrue# (sizeofBigNat# bn ==# 1#) = NatS# (bigNatToWord bn)- | isTrue# (isNullBigNat# bn) = underflowError- | True = NatJ# bn--naturalToBigNat :: Natural -> BigNat-naturalToBigNat (NatS# w#) = wordToBigNat w#-naturalToBigNat (NatJ# bn) = bn--naturalToWord :: Natural -> Word-naturalToWord (NatS# w#) = W# w#-naturalToWord (NatJ# bn) = W# (bigNatToWord bn)--naturalToInt :: Natural -> Int-naturalToInt (NatS# w#) = I# (word2Int# w#)-naturalToInt (NatJ# bn) = I# (bigNatToInt bn)---------------------------------------------------------------------------------- | Convert a Word# into a Natural------ Built-in rule ensures that applications of this function to literal Word# are--- lifted into Natural literals.-wordToNatural# :: Word# -> Natural-wordToNatural# w# = NatS# w#-{-# CONSTANT_FOLDED wordToNatural# #-}---- | Convert a Word# into a Natural------ In base we can't use wordToNatural# as built-in rules transform some of them--- into Natural literals. Use this function instead.-wordToNaturalBase :: Word# -> Natural-wordToNaturalBase w# = NatS# w#--#else /* !defined(MIN_VERSION_integer_gmp) */-------------------------------------------------------------------------------- Use wrapped 'Integer' as fallback; taken from Edward Kmett's nats package---- | Type representing arbitrary-precision non-negative integers.------ Operations whose result would be negative @'Control.Exception.throw'--- ('Control.Exception.Underflow' :: 'Control.Exception.ArithException')@.------ @since 4.8.0.0-newtype Natural = Natural Integer -- ^ __Invariant__: non-negative 'Integer'- deriving (Eq,Ord)+minusNaturalMaybe x y = case N.naturalSub x y of+ (# _ | #) -> Nothing+ (# | n #) -> Just n +-- | 'Natural' multiplication+timesNatural :: Natural -> Natural -> Natural+timesNatural = N.naturalMul --- | Test whether all internal invariants are satisfied by 'Natural' value------ This operation is mostly useful for test-suites and/or code which--- constructs 'Natural' values directly.------ @since 4.8.0.0-isValidNatural :: Natural -> Bool-isValidNatural (Natural i) = i >= wordToInteger 0##+negateNatural :: Natural -> Natural+negateNatural = N.naturalNegate --- | Convert a 'Word#' into a 'Natural'------ Built-in rule ensures that applications of this function to literal 'Word#'--- are lifted into 'Natural' literals.-wordToNatural# :: Word# -> Natural-wordToNatural# w## = Natural (wordToInteger w##)-{-# CONSTANT_FOLDED wordToNatural# #-}+signumNatural :: Natural -> Natural+signumNatural = N.naturalSignum --- | Convert a 'Word#' into a Natural------ In base we can't use wordToNatural# as built-in rules transform some of them--- into Natural literals. Use this function instead.-wordToNaturalBase :: Word# -> Natural-wordToNaturalBase w## = Natural (wordToInteger w##)+quotRemNatural :: Natural -> Natural -> (Natural, Natural)+quotRemNatural = N.naturalQuotRem --- | @since 4.10.0.0-naturalFromInteger :: Integer -> Natural-naturalFromInteger n- | n >= wordToInteger 0## = Natural n- | True = underflowError-{-# INLINE naturalFromInteger #-}+remNatural :: Natural -> Natural -> Natural+remNatural = N.naturalRem +quotNatural :: Natural -> Natural -> Natural+quotNatural = N.naturalQuot -- | Compute greatest common divisor. gcdNatural :: Natural -> Natural -> Natural-gcdNatural (Natural n) (Natural m) = Natural (n `gcdInteger` m)+gcdNatural = N.naturalGcd --- | Compute lowest common multiple.+-- | Compute least common multiple. lcmNatural :: Natural -> Natural -> Natural-lcmNatural (Natural n) (Natural m) = Natural (n `lcmInteger` m)---- | 'Natural' subtraction. Returns 'Nothing's for non-positive results.------ @since 4.8.0.0-minusNaturalMaybe :: Natural -> Natural -> Maybe Natural-minusNaturalMaybe (Natural x) (Natural y)- | x >= y = Just (Natural (x `minusInteger` y))- | True = Nothing--shiftLNatural :: Natural -> Int -> Natural-shiftLNatural (Natural n) (I# i) = Natural (n `shiftLInteger` i)--- {-# CONSTANT_FOLDED shiftLNatural #-}--shiftRNatural :: Natural -> Int -> Natural-shiftRNatural (Natural n) (I# i) = Natural (n `shiftRInteger` i)--- {-# CONSTANT_FOLDED shiftRNatural #-}--plusNatural :: Natural -> Natural -> Natural-plusNatural (Natural x) (Natural y) = Natural (x `plusInteger` y)-{-# CONSTANT_FOLDED plusNatural #-}--minusNatural :: Natural -> Natural -> Natural-minusNatural (Natural x) (Natural y)- = if z `ltInteger` wordToInteger 0## then underflowError else Natural z- where z = x `minusInteger` y-{-# CONSTANT_FOLDED minusNatural #-}+lcmNatural = N.naturalLcm -timesNatural :: Natural -> Natural -> Natural-timesNatural (Natural x) (Natural y) = Natural (x `timesInteger` y)-{-# CONSTANT_FOLDED timesNatural #-}+andNatural :: Natural -> Natural -> Natural+andNatural = N.naturalAnd orNatural :: Natural -> Natural -> Natural-orNatural (Natural x) (Natural y) = Natural (x `orInteger` y)--- {-# CONSTANT_FOLDED orNatural #-}+orNatural = N.naturalOr xorNatural :: Natural -> Natural -> Natural-xorNatural (Natural x) (Natural y) = Natural (x `xorInteger` y)--- {-# CONSTANT_FOLDED xorNatural #-}--andNatural :: Natural -> Natural -> Natural-andNatural (Natural x) (Natural y) = Natural (x `andInteger` y)--- {-# CONSTANT_FOLDED andNatural #-}--naturalToInt :: Natural -> Int-naturalToInt (Natural i) = I# (integerToInt i)--naturalToWord :: Natural -> Word-naturalToWord (Natural i) = W# (integerToWord i)+xorNatural = N.naturalXor -naturalToInteger :: Natural -> Integer-naturalToInteger (Natural i) = i-{-# CONSTANT_FOLDED naturalToInteger #-}+bitNatural :: Int# -> Natural+bitNatural i = N.naturalBit# (int2Word# i) testBitNatural :: Natural -> Int -> Bool-testBitNatural (Natural n) (I# i) = testBitInteger n i--- {-# CONSTANT_FOLDED testBitNatural #-}+testBitNatural n i = N.naturalTestBit n (int2Word i) popCountNatural :: Natural -> Int-popCountNatural (Natural n) = I# (popCountInteger n)--bitNatural :: Int# -> Natural-bitNatural i#- | isTrue# (i# <# WORD_SIZE_IN_BITS#) = wordToNaturalBase (1## `uncheckedShiftL#` i#)- | True = Natural (1 `shiftLInteger` i#)--- {-# CONSTANT_FOLDED bitNatural #-}--quotNatural :: Natural -> Natural -> Natural-quotNatural n@(Natural x) (Natural y)- | y == wordToInteger 0## = divZeroError- | y == wordToInteger 1## = n- | True = Natural (x `quotInteger` y)--- {-# CONSTANT_FOLDED quotNatural #-}+popCountNatural n = word2Int (N.naturalPopCount n) -remNatural :: Natural -> Natural -> Natural-remNatural (Natural x) (Natural y)- | y == wordToInteger 0## = divZeroError- | y == wordToInteger 1## = wordToNaturalBase 0##- | True = Natural (x `remInteger` y)--- {-# CONSTANT_FOLDED remNatural #-}+shiftLNatural :: Natural -> Int -> Natural+shiftLNatural n i = N.naturalShiftL n (int2Word i) -quotRemNatural :: Natural -> Natural -> (Natural, Natural)-quotRemNatural n@(Natural x) (Natural y)- | y == wordToInteger 0## = divZeroError- | y == wordToInteger 1## = (n,wordToNaturalBase 0##)- | True = case quotRemInteger x y of- (# k, r #) -> (Natural k, Natural r)--- {-# CONSTANT_FOLDED quotRemNatural #-}+shiftRNatural :: Natural -> Int -> Natural+shiftRNatural n i = N.naturalShiftR n (int2Word i) -signumNatural :: Natural -> Natural-signumNatural (Natural x)- | x == wordToInteger 0## = wordToNaturalBase 0##- | True = wordToNaturalBase 1##--- {-# CONSTANT_FOLDED signumNatural #-}+-- | @since 4.12.0.0+naturalToInteger :: Natural -> Integer+naturalToInteger = I.integerFromNatural -negateNatural :: Natural -> Natural-negateNatural (Natural x)- | x == wordToInteger 0## = wordToNaturalBase 0##- | True = underflowError--- {-# CONSTANT_FOLDED negateNatural #-}+naturalToWord :: Natural -> Word+naturalToWord = N.naturalToWord -#endif+-- | @since 4.10.0.0+naturalFromInteger :: Integer -> Natural+naturalFromInteger = I.integerToNatural -- | Construct 'Natural' from 'Word' value. -- -- @since 4.8.0.0 wordToNatural :: Word -> Natural-wordToNatural (W# w#) = wordToNatural# w#+wordToNatural = N.naturalFromWord -- | Try downcasting 'Natural' to 'Word' value. -- Returns 'Nothing' if value doesn't fit in 'Word'. -- -- @since 4.8.0.0 naturalToWordMaybe :: Natural -> Maybe Word-#if defined(MIN_VERSION_integer_gmp)-naturalToWordMaybe (NatS# w#) = Just (W# w#)-naturalToWordMaybe (NatJ# _) = Nothing-#else-naturalToWordMaybe (Natural i)- | i < maxw = Just (W# (integerToWord i))- | True = Nothing- where- maxw = 1 `shiftLInteger` WORD_SIZE_IN_BITS#-#endif+naturalToWordMaybe n = case N.naturalToWordMaybe# n of+ (# | w #) -> Just (W# w)+ (# (# #) | #) -> Nothing +wordToNatural# :: Word -> Natural+wordToNatural# = N.naturalFromWord+ -- | \"@'powModNatural' /b/ /e/ /m/@\" computes base @/b/@ raised to -- exponent @/e/@ modulo @/m/@. -- -- @since 4.8.0.0 powModNatural :: Natural -> Natural -> Natural -> Natural-#if defined(MIN_VERSION_integer_gmp)-powModNatural _ _ (NatS# 0##) = divZeroError-powModNatural _ _ (NatS# 1##) = NatS# 0##-powModNatural _ (NatS# 0##) _ = NatS# 1##-powModNatural (NatS# 0##) _ _ = NatS# 0##-powModNatural (NatS# 1##) _ _ = NatS# 1##-powModNatural (NatS# b) (NatS# e) (NatS# m) = NatS# (powModWord b e m)-powModNatural b e (NatS# m)- = NatS# (powModBigNatWord (naturalToBigNat b) (naturalToBigNat e) m)-powModNatural b e (NatJ# m)- = bigNatToNatural (powModBigNat (naturalToBigNat b) (naturalToBigNat e) m)-#else--- Portable reference fallback implementation-powModNatural (Natural b0) (Natural e0) (Natural m)- | m == wordToInteger 0## = divZeroError- | m == wordToInteger 1## = wordToNaturalBase 0##- | e0 == wordToInteger 0## = wordToNaturalBase 1##- | b0 == wordToInteger 0## = wordToNaturalBase 0##- | b0 == wordToInteger 1## = wordToNaturalBase 1##- | True = go b0 e0 (wordToInteger 1##)- where- go !b e !r- | e `testBitInteger` 0# = go b' e' ((r `timesInteger` b) `modInteger` m)- | e == wordToInteger 0## = naturalFromInteger r- | True = go b' e' r- where- b' = (b `timesInteger` b) `modInteger` m- e' = e `shiftRInteger` 1# -- slightly faster than "e `div` 2"-#endif----- | Construct 'Natural' value from list of 'Word's.------ This function is used by GHC for constructing 'Natural' literals.-mkNatural :: [Word] -- ^ value expressed in 32 bit chunks, least- -- significant first- -> Natural-mkNatural [] = wordToNaturalBase 0##-mkNatural (W# i : is') = wordToNaturalBase (i `and#` 0xffffffff##) `orNatural`- shiftLNatural (mkNatural is') 32-{-# CONSTANT_FOLDED mkNatural #-}---- | Convert 'Int' to 'Natural'.--- Throws 'Control.Exception.Underflow' when passed a negative 'Int'.-intToNatural :: Int -> Natural-intToNatural (I# i#)- | isTrue# (i# <# 0#) = underflowError- | True = wordToNaturalBase (int2Word# i#)+powModNatural = N.naturalPowMod
GHC/Num.hs view
@@ -17,13 +17,24 @@ ----------------------------------------------------------------------------- -module GHC.Num (module GHC.Num, module GHC.Integer, module GHC.Natural) where+module GHC.Num+ ( module GHC.Num+ , module GHC.Num.Integer+ , module GHC.Num.Natural+ -- reexported for backward compatibility+ , module GHC.Natural+ , module GHC.Integer+ )+where #include "MachDeps.h" +import qualified GHC.Natural+import qualified GHC.Integer+ import GHC.Base-import GHC.Integer-import GHC.Natural+import GHC.Num.Integer+import GHC.Num.Natural infixl 7 * infixl 6 +, -@@ -98,7 +109,7 @@ | otherwise = 1 {-# INLINE fromInteger #-} -- Just to be sure!- fromInteger i = I# (integerToInt i)+ fromInteger i = integerToInt i -- | @since 2.01 instance Num Word where@@ -109,30 +120,33 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W# (integerToWord i)+ fromInteger i = integerToWord i -- | @since 2.01 instance Num Integer where- (+) = plusInteger- (-) = minusInteger- (*) = timesInteger- negate = negateInteger- fromInteger x = x+ (+) = integerAdd+ (-) = integerSub+ (*) = integerMul+ negate = integerNegate+ fromInteger x = x - abs = absInteger- signum = signumInteger+ abs = integerAbs+ signum = integerSignum -- | Note that `Natural`'s 'Num' instance isn't a ring: no element but 0 has an -- additive inverse. It is a semiring though. -- -- @since 4.8.0.0 instance Num Natural where- (+) = plusNatural- (-) = minusNatural- (*) = timesNatural- negate = negateNatural- fromInteger = naturalFromInteger+ (+) = naturalAdd+ (-) = naturalSubThrow+ (*) = naturalMul+ negate = naturalNegate+ fromInteger = integerToNaturalThrow+ abs = id+ signum = naturalSignum - abs = id- signum = signumNatural+{-# DEPRECATED quotRemInteger "Use integerQuotRem# instead" #-}+quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)+quotRemInteger = integerQuotRem#
GHC/OverloadedLabels.hs view
@@ -17,7 +17,7 @@ -- Stability : internal -- Portability : non-portable (GHC extensions) ----- This module defines the 'IsLabel' class is used by the+-- This module defines the 'IsLabel' class used by the -- @OverloadedLabels@ extension. See the -- <https://gitlab.haskell.org/ghc/ghc/wikis/records/overloaded-record-fields/overloaded-labels wiki page> -- for more details.@@ -42,7 +42,7 @@ -- optional id for the 'fromLabel' function to use (if -- RebindableSyntax is enabled) . The type-checker transforms it into -- a call to 'fromLabel'. See Note [Type-checking overloaded labels]--- in TcExpr for more details in how type-checking works.+-- in GHC.Tc.Gen.Expr for more details in how type-checking works. module GHC.OverloadedLabels ( IsLabel(..)
GHC/Ptr.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE Unsafe #-} {-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, RoleAnnotations #-}+{-# LANGUAGE UnboxedTuples #-} {-# OPTIONS_HADDOCK not-home #-} -----------------------------------------------------------------------------@@ -22,7 +23,8 @@ nullFunPtr, castFunPtr, -- * Unsafe functions- castFunPtrToPtr, castPtrToFunPtr+ castFunPtrToPtr, castPtrToFunPtr,+ ) where import GHC.Base@@ -89,9 +91,7 @@ ------------------------------------------------------------------------ -- Function pointers for the default calling convention. --- 'FunPtr' has a phantom role for similar reasons to 'Ptr'. Note--- that 'FunPtr's role cannot become nominal without changes elsewhere--- in GHC. See Note [FFI type roles] in TcForeign.+-- 'FunPtr' has a phantom role for similar reasons to 'Ptr'. type role FunPtr phantom data FunPtr a = FunPtr Addr# deriving (Eq, Ord) -- ^ A value of type @'FunPtr' a@ is a pointer to a function callable@@ -162,13 +162,12 @@ castPtrToFunPtr :: Ptr a -> FunPtr b castPtrToFunPtr (Ptr addr) = FunPtr addr - ------------------------------------------------------------------------ -- Show instances for Ptr and FunPtr -- | @since 2.01 instance Show (Ptr a) where- showsPrec _ (Ptr a) rs = pad_out (showHex (wordToInteger(int2Word#(addr2Int# a))) "")+ showsPrec _ (Ptr a) rs = pad_out (showHex (integerFromWord#(int2Word#(addr2Int# a))) "") where -- want 0s prefixed to pad it out to a fixed length. pad_out ls =
GHC/RTS/Flags.hsc view
@@ -1,3 +1,4 @@+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RecordWildCards #-} @@ -24,10 +25,12 @@ , TraceFlags (..) , TickyFlags (..) , ParFlags (..)+ , IoSubSystem (..) , getRTSFlags , getGCFlags , getConcFlags , getMiscFlags+ , getIoManagerFlag , getDebugFlags , getCCFlags , getProfFlags@@ -39,14 +42,14 @@ #include "Rts.h" #include "rts/Flags.h" -import Control.Applicative-import Control.Monad+import Data.Functor ((<$>)) import Foreign import Foreign.C import GHC.Base import GHC.Enum+import GHC.Generics (Generic) import GHC.IO import GHC.Real import GHC.Show@@ -67,6 +70,7 @@ | SummaryGCStats | VerboseGCStats deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | @since 4.8.0.0@@ -84,6 +88,32 @@ toEnum #{const VERBOSE_GC_STATS} = VerboseGCStats toEnum e = errorWithoutStackTrace ("invalid enum for GiveGCStats: " ++ show e) +-- | The I/O SubSystem to use in the program.+--+-- @since 4.9.0.0+data IoSubSystem+ = IoPOSIX -- ^ Use a POSIX I/O Sub-System+ | IoNative -- ^ Use platform native Sub-System. For unix OSes this is the+ -- same as IoPOSIX, but on Windows this means use the Windows+ -- native APIs for I/O, including IOCP and RIO.+ deriving (Eq, Show)++-- | @since 4.9.0.0+instance Enum IoSubSystem where+ fromEnum IoPOSIX = #{const IO_MNGR_POSIX}+ fromEnum IoNative = #{const IO_MNGR_NATIVE}++ toEnum #{const IO_MNGR_POSIX} = IoPOSIX+ toEnum #{const IO_MNGR_NATIVE} = IoNative+ toEnum e = errorWithoutStackTrace ("invalid enum for IoSubSystem: " ++ show e)++-- | @since 4.9.0.0+instance Storable IoSubSystem where+ sizeOf = sizeOf . fromEnum+ alignment = sizeOf . fromEnum+ peek ptr = fmap toEnum $ peek (castPtr ptr)+ poke ptr v = poke (castPtr ptr) (fromEnum v)+ -- | Parameters of the garbage collector. -- -- @since 4.8.0.0@@ -117,6 +147,7 @@ , numa :: Bool , numaMask :: Word } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Parameters concerning context switching@@ -126,6 +157,7 @@ { ctxtSwitchTime :: RtsTime , ctxtSwitchTicks :: Int } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Miscellaneous parameters@@ -143,7 +175,10 @@ , linkerAlwaysPic :: Bool , linkerMemBase :: Word -- ^ address to ask the OS for memory for the linker, 0 ==> off+ , ioManager :: IoSubSystem+ , numIoWorkerThreads :: Word32 } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Flags to control debugging output & extra checking in various@@ -168,6 +203,7 @@ , hpc :: Bool -- ^ @c@ coverage , sparks :: Bool -- ^ @r@ } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Should the RTS produce a cost-center summary?@@ -180,6 +216,7 @@ | CostCentresAll | CostCentresJSON deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | @since 4.8.0.0@@ -205,6 +242,7 @@ , profilerTicks :: Int , msecsPerTick :: Int } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | What sort of heap profile are we collecting?@@ -220,6 +258,7 @@ | HeapByLDV | HeapByClosureType deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | @since 4.8.0.0@@ -262,6 +301,7 @@ , retainerSelector :: Maybe String , bioSelector :: Maybe String } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Is event tracing enabled?@@ -272,6 +312,7 @@ | TraceEventLog -- ^ send tracing events to the event log | TraceStderr -- ^ send tracing events to @stderr@ deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | @since 4.8.0.0@@ -299,6 +340,7 @@ , sparksFull :: Bool -- ^ trace spark events 100% accurately , user :: Bool -- ^ trace user events (emitted from Haskell code) } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Parameters pertaining to ticky-ticky profiler@@ -308,6 +350,7 @@ { showTickyStats :: Bool , tickyFile :: Maybe FilePath } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Parameters pertaining to parallelism@@ -326,6 +369,7 @@ , setAffinity :: Bool } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Parameters of the runtime system@@ -342,6 +386,7 @@ , tickyFlags :: TickyFlags , parFlags :: ParFlags } deriving ( Show -- ^ @since 4.8.0.0+ , Generic -- ^ @since 4.15.0.0 ) foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr RTSFlags@@ -433,6 +478,7 @@ ConcFlags <$> #{peek CONCURRENT_FLAGS, ctxtSwitchTime} ptr <*> #{peek CONCURRENT_FLAGS, ctxtSwitchTicks} ptr +{-# INLINEABLE getMiscFlags #-} getMiscFlags :: IO MiscFlags getMiscFlags = do let ptr = (#ptr RTS_FLAGS, MiscFlags) rtsFlagsPtr@@ -454,6 +500,40 @@ <*> (toBool <$> (#{peek MISC_FLAGS, linkerAlwaysPic} ptr :: IO CBool)) <*> #{peek MISC_FLAGS, linkerMemBase} ptr+ <*> (toEnum . fromIntegral+ <$> (#{peek MISC_FLAGS, ioManager} ptr :: IO Word32))+ <*> (fromIntegral+ <$> (#{peek MISC_FLAGS, numIoWorkerThreads} ptr :: IO Word32))++{- Note [The need for getIoManagerFlag]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++ GHC supports both the new WINIO manager+ as well as the old MIO one. In order to+ decide which code path to take we often+ have to inspect what the user selected at+ RTS startup.++ We could use getMiscFlags but then we end up with core containing+ reads for all MiscFlags. These won't be eliminated at the core level+ even if it's obvious we will only look at the ioManager part of the+ ADT.++ We could add a INLINE pragma, but that just means whatever we inline+ into is likely to be inlined. So rather than adding a dozen pragmas+ we expose a lean way to query this particular flag. It's not satisfying+ but it works well enough and allows these checks to be inlined nicely.++-}++{-# INLINE getIoManagerFlag #-}+-- | Needed to optimize support for different IO Managers on Windows.+-- See Note [The need for getIoManagerFlag]+getIoManagerFlag :: IO IoSubSystem+getIoManagerFlag = do+ let ptr = (#ptr RTS_FLAGS, MiscFlags) rtsFlagsPtr+ mgrFlag <- (#{peek MISC_FLAGS, ioManager} ptr :: IO Word32)+ return $ (toEnum . fromIntegral) mgrFlag getDebugFlags :: IO DebugFlags getDebugFlags = do
GHC/Read.hs view
@@ -73,6 +73,7 @@ import GHC.Arr import GHC.Word import GHC.List (filter)+import GHC.Tuple (Solo (..)) -- | @'readParen' 'True' p@ parses what @p@ parses, but surrounded with@@ -411,10 +412,10 @@ -- Note [Why readField] -- -- Previously, the code for automatically deriving Read instance (in--- typecheck/TcGenDeriv.hs) would generate inline code for parsing fields;+-- typecheck/GHC.Tc.Deriv.Generate.hs) would generate inline code for parsing fields; -- this, however, turned out to produce massive amounts of intermediate code, -- and produced a considerable performance hit in the code generator.--- Since Read instances are not generally supposed to be perfomance critical,+-- Since Read instances are not generally supposed to be performance critical, -- the readField and readSymField functions have been factored out, and the -- code generator now just generates calls rather than manually inlining the -- parsers. For large record types (e.g. 500 fields), this produces a@@ -666,6 +667,9 @@ readListPrec = readListPrecDefault readList = readListDefault++-- | @since 4.15+deriving instance Read a => Read (Solo a) -- | @since 2.01 instance (Read a, Read b) => Read (a,b) where
GHC/Real.hs view
@@ -31,9 +31,7 @@ , underflowException , ratioZeroDenomException ) -#if defined(MIN_VERSION_integer_gmp)-import GHC.Integer.GMP.Internals-#endif+import GHC.Num.BigNat (gcdInt,gcdWord) infixr 8 ^, ^^ infixl 7 /, `quot`, `rem`, `div`, `mod`@@ -326,7 +324,7 @@ -- | @since 2.0.1 instance Integral Int where- toInteger (I# i) = smallInteger i+ toInteger (I# i) = IS i a `quot` b | b == 0 = divZeroError@@ -334,11 +332,8 @@ -- in GHC.Int | otherwise = a `quotInt` b - a `rem` b+ !a `rem` b -- See Note [Special case of mod and rem is lazy] | b == 0 = divZeroError- -- The quotRem CPU instruction fails for minBound `quotRem` -1,- -- but minBound `rem` -1 is well-defined (0). We therefore- -- special-case it. | b == (-1) = 0 | otherwise = a `remInt` b @@ -348,11 +343,8 @@ -- in GHC.Int | otherwise = a `divInt` b - a `mod` b+ !a `mod` b -- See Note [Special case of mod and rem is lazy] | b == 0 = divZeroError- -- The divMod CPU instruction fails for minBound `divMod` -1,- -- but minBound `mod` -1 is well-defined (0). We therefore- -- special-case it. | b == (-1) = 0 | otherwise = a `modInt` b @@ -368,6 +360,15 @@ | b == (-1) && a == minBound = (overflowError, 0) | otherwise = a `divModInt` b +{- Note [Special case of mod and rem is lazy]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+The `quotRem`/`divMod` CPU instruction fails for minBound `quotRem` -1, but+minBound `rem` -1 is well-defined (0). We therefore special-case for `b == -1`,+but not for `a == minBound` because of Note [Order of tests] in GHC.Int. But+now we have to make sure the function stays strict in a, to guarantee unboxing.+Hence the bang on a, see #18187.+-}+ -------------------------------------------------------------- -- Instances for @Word@ --------------------------------------------------------------@@ -398,7 +399,7 @@ divMod (W# x#) y@(W# y#) | y /= 0 = (W# (x# `quotWord#` y#), W# (x# `remWord#` y#)) | otherwise = divZeroError- toInteger (W# x#) = wordToInteger x#+ toInteger (W# x#) = integerFromWord# x# -------------------------------------------------------------- -- Instances for Integer@@ -410,62 +411,76 @@ -- | @since 4.8.0.0 instance Real Natural where- toRational n = naturalToInteger n :% 1+ toRational n = integerFromNatural n :% 1 -- Note [Integer division constant folding] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----- Constant folding of quot, rem, div, mod, divMod and quotRem for--- Integer arguments depends crucially on inlining. Constant folding--- rules defined in compiler/prelude/PrelRules.hs trigger for--- quotInteger, remInteger and so on. So if calls to quot, rem and so on--- were not inlined the rules would not fire. The rules would also not--- fire if calls to quotInteger and so on were inlined, but this does not--- happen because they are all marked with NOINLINE pragma - see documentation--- of integer-gmp or integer-simple.+-- Constant folding of quot, rem, div, mod, divMod and quotRem for Integer+-- arguments depends crucially on inlining. Constant folding rules defined in+-- GHC.Core.Opt.ConstantFold trigger for integerQuot, integerRem and so on.+-- So if calls to quot, rem and so on were not inlined the rules would not fire.+--+-- The rules would also not fire if calls to integerQuot and so on were inlined,+-- but this does not happen because they are all marked with NOINLINE pragma. + -- | @since 2.0.1 instance Integral Integer where toInteger n = n {-# INLINE quot #-} _ `quot` 0 = divZeroError- n `quot` d = n `quotInteger` d+ n `quot` d = n `integerQuot` d {-# INLINE rem #-} _ `rem` 0 = divZeroError- n `rem` d = n `remInteger` d+ n `rem` d = n `integerRem` d {-# INLINE div #-} _ `div` 0 = divZeroError- n `div` d = n `divInteger` d+ n `div` d = n `integerDiv` d {-# INLINE mod #-} _ `mod` 0 = divZeroError- n `mod` d = n `modInteger` d+ n `mod` d = n `integerMod` d {-# INLINE divMod #-} _ `divMod` 0 = divZeroError- n `divMod` d = case n `divModInteger` d of- (# x, y #) -> (x, y)+ n `divMod` d = n `integerDivMod` d {-# INLINE quotRem #-} _ `quotRem` 0 = divZeroError- n `quotRem` d = case n `quotRemInteger` d of- (# q, r #) -> (q, r)+ n `quotRem` d = n `integerQuotRem` d -- | @since 4.8.0.0 instance Integral Natural where- toInteger = naturalToInteger+ toInteger = integerFromNatural - divMod = quotRemNatural- div = quotNatural- mod = remNatural+ {-# INLINE quot #-}+ _ `quot` 0 = divZeroError+ n `quot` d = n `naturalQuot` d - quotRem = quotRemNatural- quot = quotNatural- rem = remNatural+ {-# INLINE rem #-}+ _ `rem` 0 = divZeroError+ n `rem` d = n `naturalRem` d + {-# INLINE div #-}+ _ `div` 0 = divZeroError+ n `div` d = n `naturalQuot` d++ {-# INLINE mod #-}+ _ `mod` 0 = divZeroError+ n `mod` d = n `naturalRem` d++ {-# INLINE divMod #-}+ _ `divMod` 0 = divZeroError+ n `divMod` d = n `naturalQuotRem` d++ {-# INLINE quotRem #-}+ _ `quotRem` 0 = divZeroError+ n `quotRem` d = n `naturalQuotRem` d+ -------------------------------------------------------------- -- Instances for @Ratio@ --------------------------------------------------------------@@ -565,14 +580,25 @@ #-} {-# RULES-"fromIntegral/Natural->Natural" fromIntegral = id :: Natural -> Natural-"fromIntegral/Natural->Integer" fromIntegral = toInteger :: Natural->Integer-"fromIntegral/Natural->Word" fromIntegral = naturalToWord+"fromIntegral/Natural->Natural" fromIntegral = id :: Natural -> Natural+"fromIntegral/Natural->Integer" fromIntegral = toInteger :: Natural -> Integer+"fromIntegral/Natural->Word" fromIntegral = naturalToWord :: Natural -> Word #-} +-- Don't forget the type signatures in the following rules! Without a type+-- signature we end up with the rule:+--+-- "fromIntegral/Int->Natural" forall a (d::Integral a).+-- fromIntegral @a @Natural = naturalFromWord . fromIntegral @a d+--+-- but this rule is certainly not valid for every Integral type a!+--+-- This rule wraps any Integral input into Word's range. As a consequence,+-- (2^64 :: Integer) was incorrectly wrapped to (0 :: Natural), see #19345.+ {-# RULES-"fromIntegral/Word->Natural" fromIntegral = wordToNatural-"fromIntegral/Int->Natural" fromIntegral = intToNatural+"fromIntegral/Word->Natural" fromIntegral = naturalFromWord :: Word -> Natural+"fromIntegral/Int->Natural" fromIntegral = naturalFromWord . fromIntegral :: Int -> Natural #-} -- | general coercion to fractional types@@ -763,27 +789,16 @@ lcm x y = abs ((x `quot` (gcd x y)) * y) {-# RULES-"gcd/Integer->Integer->Integer" gcd = gcdInteger-"lcm/Integer->Integer->Integer" lcm = lcmInteger-"gcd/Natural->Natural->Natural" gcd = gcdNatural-"lcm/Natural->Natural->Natural" lcm = lcmNatural+"gcd/Integer->Integer->Integer" gcd = integerGcd+"lcm/Integer->Integer->Integer" lcm = integerLcm+"gcd/Natural->Natural->Natural" gcd = naturalGcd+"lcm/Natural->Natural->Natural" lcm = naturalLcm #-} -#if defined(MIN_VERSION_integer_gmp)--- GMP defines a more efficient Int# and Word# GCD--gcdInt' :: Int -> Int -> Int-gcdInt' (I# x) (I# y) = I# (gcdInt x y)--gcdWord' :: Word -> Word -> Word-gcdWord' (W# x) (W# y) = W# (gcdWord x y)- {-# RULES-"gcd/Int->Int->Int" gcd = gcdInt'-"gcd/Word->Word->Word" gcd = gcdWord'+"gcd/Int->Int->Int" gcd = gcdInt+"gcd/Word->Word->Word" gcd = gcdWord #-}--#endif integralEnumFrom :: (Integral a, Bounded a) => a -> [a] integralEnumFrom n = map fromInteger [toInteger n .. toInteger (maxBound `asTypeOf` n)]
GHC/ST.hs view
@@ -26,7 +26,7 @@ import GHC.Base import GHC.Show-import qualified Control.Monad.Fail as Fail+import Control.Monad.Fail default () @@ -79,7 +79,7 @@ (k2 new_s) }}) -- | @since 4.11.0.0-instance Fail.MonadFail (ST s) where+instance MonadFail (ST s) where fail s = errorWithoutStackTrace s -- | @since 4.11.0.0
GHC/Show.hs view
@@ -53,6 +53,7 @@ import GHC.List ((!!), foldr1, break) import GHC.Num import GHC.Stack.Types+import GHC.Tuple (Solo (..)) -- | The @shows@ functions return a function that prepends the@@ -167,6 +168,9 @@ -- | @since 2.01 deriving instance Show () +-- | @since 4.15+deriving instance Show a => Show (Solo a)+ -- | @since 2.01 instance Show a => Show [a] where {-# SPECIALISE instance Show [String] #-}@@ -470,6 +474,7 @@ -- | @since 2.01 instance Show Integer where+ showsPrec p (IS i) r = showsPrec p (I# i) r showsPrec p n r | p > 6 && n < 0 = '(' : integerToString n (')' : r) -- Minor point: testing p first gives better code@@ -480,10 +485,8 @@ -- | @since 4.8.0.0 instance Show Natural where-#if defined(MIN_VERSION_integer_gmp)- showsPrec p (NatS# w#) = showsPrec p (W# w#)-#endif- showsPrec p i = showsPrec p (naturalToInteger i)+ showsPrec p (NS w) = showsPrec p (W# w)+ showsPrec p n = showsPrec p (integerFromNatural n) -- Divide and conquer implementation of string conversion integerToString :: Integer -> String -> String@@ -508,7 +511,7 @@ jsplith :: Integer -> [Integer] -> [Integer] jsplith p (n:ns) =- case n `quotRemInteger` p of+ case n `integerQuotRem#` p of (# q, r #) -> if q > 0 then q : r : jsplitb p ns else r : jsplitb p ns@@ -516,7 +519,7 @@ jsplitb :: Integer -> [Integer] -> [Integer] jsplitb _ [] = []- jsplitb p (n:ns) = case n `quotRemInteger` p of+ jsplitb p (n:ns) = case n `integerQuotRem#` p of (# q, r #) -> q : r : jsplitb p ns @@ -525,7 +528,7 @@ -- that all fit into a machine word. jprinth :: [Integer] -> String -> String jprinth (n:ns) cs =- case n `quotRemInteger` BASE of+ case n `integerQuotRem#` BASE of (# q', r' #) -> let q = fromInteger q' r = fromInteger r'@@ -535,7 +538,7 @@ jprintb :: [Integer] -> String -> String jprintb [] cs = cs- jprintb (n:ns) cs = case n `quotRemInteger` BASE of+ jprintb (n:ns) cs = case n `integerQuotRem#` BASE of (# q', r' #) -> let q = fromInteger q' r = fromInteger r'
GHC/Stable.hs view
@@ -31,6 +31,8 @@ import GHC.Ptr import GHC.Base +import Unsafe.Coerce ( unsafeCoerceAddr )+ ----------------------------------------------------------------------------- -- Stable Pointers @@ -85,7 +87,7 @@ -- undefined behaviour. -- castStablePtrToPtr :: StablePtr a -> Ptr ()-castStablePtrToPtr (StablePtr s) = Ptr (unsafeCoerce# s)+castStablePtrToPtr (StablePtr s) = Ptr (unsafeCoerceAddr s) -- |@@ -99,7 +101,7 @@ -- 'castStablePtrToPtr'. -- castPtrToStablePtr :: Ptr () -> StablePtr a-castPtrToStablePtr (Ptr a) = StablePtr (unsafeCoerce# a)+castPtrToStablePtr (Ptr a) = StablePtr (unsafeCoerceAddr a) -- | @since 2.01 instance Eq (StablePtr a) where
GHC/Stack/Types.hs view
@@ -51,9 +51,8 @@ import GHC.Types (Char, Int) -- Make implicit dependency known to build system-import GHC.Tuple () -- See Note [Depend on GHC.Tuple] in GHC.Base-import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base-import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base+import GHC.Tuple () -- See Note [Depend on GHC.Tuple] in GHC.Base+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base ---------------------------------------------------------------------- -- Explicit call-stacks built via ImplicitParams
GHC/StaticPtr.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.StaticPtr@@ -48,7 +49,7 @@ ) where import Foreign.C.Types (CInt(..))-import Foreign.Marshal (allocaArray, peekArray)+import Foreign.Marshal (allocaArray, peekArray, withArray) import GHC.Ptr (Ptr(..), nullPtr) import GHC.Fingerprint (Fingerprint(..)) import GHC.Prim@@ -87,13 +88,13 @@ -- unsafeLookupStaticPtr :: StaticKey -> IO (Maybe (StaticPtr a)) unsafeLookupStaticPtr (Fingerprint w1 w2) = do- ptr@(Ptr addr) <- hs_spt_lookup w1 w2+ ptr@(Ptr addr) <- withArray [w1, w2] hs_spt_lookup if (ptr == nullPtr) then return Nothing else case addrToAny# addr of (# spe #) -> return (Just spe) -foreign import ccall unsafe hs_spt_lookup :: Word64 -> Word64 -> IO (Ptr a)+foreign import ccall unsafe hs_spt_lookup :: Ptr Word64 -> IO (Ptr a) -- | A class for things buildable from static pointers. class IsStatic p where@@ -103,7 +104,7 @@ instance IsStatic StaticPtr where fromStaticPtr = id --- | Miscelaneous information available for debugging purposes.+-- | Miscellaneous information available for debugging purposes. data StaticPtrInfo = StaticPtrInfo { -- | Package key of the package where the static pointer is defined spInfoUnitId :: String
GHC/Stats.hsc view
@@ -1,3 +1,4 @@+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RecordWildCards #-}@@ -24,6 +25,7 @@ import Data.Int import Data.Word import GHC.Base+import GHC.Generics (Generic) import GHC.Read ( Read ) import GHC.Show ( Show ) import GHC.IO.Exception@@ -126,6 +128,7 @@ , gc :: GCDetails } deriving ( Read -- ^ @since 4.10.0.0 , Show -- ^ @since 4.10.0.0+ , Generic -- ^ @since 4.15.0.0 ) --@@ -174,6 +177,7 @@ , gcdetails_nonmoving_gc_sync_elapsed_ns :: RtsTime } deriving ( Read -- ^ @since 4.10.0.0 , Show -- ^ @since 4.10.0.0+ , Generic -- ^ @since 4.15.0.0 ) -- | Time values from the RTS, using a fixed resolution of nanoseconds.
GHC/TopHandler.hs view
@@ -40,8 +40,8 @@ import GHC.Conc hiding (throwTo) import GHC.Real import GHC.IO-import GHC.IO.Handle.FD import GHC.IO.Handle+import GHC.IO.StdHandles import GHC.IO.Exception import GHC.Weak
GHC/TypeLits.hs view
@@ -203,7 +203,7 @@ -- -- @since 4.7.0.0 sameSymbol :: (KnownSymbol a, KnownSymbol b) =>- Proxy a -> Proxy b -> Maybe (a :~: b)+ proxy1 a -> proxy2 b -> Maybe (a :~: b) sameSymbol x y | symbolVal x == symbolVal y = Just (unsafeCoerce Refl) | otherwise = Nothing
GHC/TypeNats.hs view
@@ -40,7 +40,7 @@ import GHC.Base(Eq(..), Ord(..), Bool(True), Ordering(..), otherwise) import GHC.Types( Nat )-import GHC.Natural(Natural)+import GHC.Num.Natural(Natural) import GHC.Show(Show(..)) import GHC.Read(Read(..)) import GHC.Prim(magicDict, Proxy#)@@ -113,7 +113,7 @@ `KnownNat` is the constructor for dictionaries for the class `KnownNat`. See Note [magicDictId magic] in "basicType/MkId.hs" for details on how-we actually construct the dictionry.+we actually construct the dictionary. Note that using `Any Nat` is not really correct, as multilple calls to `someNatVal` would violate coherence:@@ -223,7 +223,7 @@ -- -- @since 4.7.0.0 sameNat :: (KnownNat a, KnownNat b) =>- Proxy a -> Proxy b -> Maybe (a :~: b)+ proxy1 a -> proxy2 b -> Maybe (a :~: b) sameNat x y | natVal x == natVal y = Just (unsafeCoerce Refl) | otherwise = Nothing
GHC/Unicode.hs view
@@ -19,6 +19,7 @@ ----------------------------------------------------------------------------- module GHC.Unicode (+ unicodeVersion, GeneralCategory (..), generalCategory, isAscii, isLatin1, isControl, isAsciiUpper, isAsciiLower,@@ -36,12 +37,18 @@ import GHC.Enum ( Enum (..), Bounded (..) ) import GHC.Ix ( Ix (..) ) import GHC.Num+import {-# SOURCE #-} Data.Version -- Data.Char.chr already imports this and we need to define a Show instance -- for GeneralCategory import GHC.Show ( Show ) #include "HsBaseConfig.h"+#include "UnicodeVersion.h"++-- | Version of Unicode standard used by @base@.+unicodeVersion :: Version+unicodeVersion = makeVersion UNICODE_VERSION_NUMS -- | Unicode General Categories (column 2 of the UnicodeData table) in -- the order they are listed in the Unicode standard (the Unicode
GHC/Windows.hs view
@@ -26,11 +26,22 @@ LPBOOL, BYTE, DWORD,+ DDWORD, UINT,+ ULONG, ErrCode, HANDLE, LPWSTR, LPTSTR,+ LPCTSTR,+ LPVOID,+ LPDWORD,+ LPSTR,+ LPCSTR,+ LPCWSTR,+ WORD,+ UCHAR,+ NTSTATUS, -- * Constants iNFINITE,@@ -56,40 +67,68 @@ -- $errno c_maperrno, c_maperrno_func,++ -- * Misc+ ddwordToDwords,+ dwordsToDdword,+ nullHANDLE, ) where +import Data.Bits (shiftL, shiftR, (.|.), (.&.)) import Data.Char import Data.OldList import Data.Maybe import Data.Word+import Data.Int import Foreign.C.Error import Foreign.C.String import Foreign.C.Types import Foreign.Ptr import GHC.Base+import GHC.Enum (maxBound) import GHC.IO import GHC.Num+import GHC.Real (fromIntegral) import System.IO.Error import qualified Numeric -#if defined(i386_HOST_ARCH)-# define WINDOWS_CCONV stdcall-#elif defined(x86_64_HOST_ARCH)-# define WINDOWS_CCONV ccall+#if MIN_VERSION_base(4,7,0)+import Data.Bits (finiteBitSize) #else-# error Unknown mingw32 arch+import Data.Bits (Bits, bitSize)++finiteBitSize :: (Bits a) => a -> Int+finiteBitSize = bitSize #endif -type BOOL = Bool-type LPBOOL = Ptr BOOL-type BYTE = Word8-type DWORD = Word32-type UINT = Word32-type ErrCode = DWORD-type HANDLE = Ptr ()-type LPWSTR = Ptr CWchar+#include "windows_cconv.h" +type BOOL = Bool+type LPBOOL = Ptr BOOL+type BYTE = Word8+type DWORD = Word32+type UINT = Word32+type ULONG = Word32+type ErrCode = DWORD+type HANDLE = Ptr ()+type LPWSTR = Ptr CWchar+type LPCTSTR = LPTSTR+type LPVOID = Ptr ()+type LPDWORD = Ptr DWORD+type LPSTR = Ptr CChar+type LPCSTR = LPSTR+type LPCWSTR = LPWSTR+type WORD = Word16+type UCHAR = Word8+type NTSTATUS = Int32++nullHANDLE :: HANDLE+nullHANDLE = nullPtr++-- Not really a basic type, but used in many places+type DDWORD = Word64+ -- | Be careful with this. LPTSTR can mean either WCHAR* or CHAR*, depending -- on whether the UNICODE macro is defined in the corresponding C code. -- Consider using LPWSTR instead.@@ -194,3 +233,15 @@ -- | Get the last system error produced in the current thread. foreign import WINDOWS_CCONV unsafe "windows.h GetLastError" getLastError :: IO ErrCode++----------------------------------------------------------------+-- Misc helpers+----------------------------------------------------------------++ddwordToDwords :: DDWORD -> (DWORD,DWORD)+ddwordToDwords n =+ (fromIntegral (n `shiftR` finiteBitSize (undefined :: DWORD))+ ,fromIntegral (n .&. fromIntegral (maxBound :: DWORD)))++dwordsToDdword:: (DWORD,DWORD) -> DDWORD+dwordsToDdword (hi,low) = (fromIntegral low) .|. (fromIntegral hi `shiftL` finiteBitSize hi)
GHC/Word.hs view
@@ -112,7 +112,7 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W8# (narrow8Word# (integerToWord i))+ fromInteger i = W8# (narrow8Word# (integerToWord# i)) -- | @since 2.01 instance Real Word8 where@@ -156,7 +156,7 @@ divMod (W8# x#) y@(W8# y#) | y /= 0 = (W8# (x# `quotWord#` y#), W8# (x# `remWord#` y#)) | otherwise = divZeroError- toInteger (W8# x#) = smallInteger (word2Int# x#)+ toInteger (W8# x#) = IS (word2Int# x#) -- | @since 2.01 instance Bounded Word8 where@@ -303,7 +303,7 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W16# (narrow16Word# (integerToWord i))+ fromInteger i = W16# (narrow16Word# (integerToWord# i)) -- | @since 2.01 instance Real Word16 where@@ -347,7 +347,7 @@ divMod (W16# x#) y@(W16# y#) | y /= 0 = (W16# (x# `quotWord#` y#), W16# (x# `remWord#` y#)) | otherwise = divZeroError- toInteger (W16# x#) = smallInteger (word2Int# x#)+ toInteger (W16# x#) = IS (word2Int# x#) -- | @since 2.01 instance Bounded Word16 where@@ -533,7 +533,7 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W32# (narrow32Word# (integerToWord i))+ fromInteger i = W32# (narrow32Word# (integerToWord# i)) -- | @since 2.01 instance Enum Word32 where@@ -589,12 +589,12 @@ | otherwise = divZeroError toInteger (W32# x#) #if WORD_SIZE_IN_BITS == 32- | isTrue# (i# >=# 0#) = smallInteger i#- | otherwise = wordToInteger x#+ | isTrue# (i# >=# 0#) = IS i#+ | otherwise = integerFromWord# x# where !i# = word2Int# x# #else- = smallInteger (word2Int# x#)+ = IS (word2Int# x#) #endif -- | @since 2.01@@ -728,7 +728,7 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W64# (integerToWord64 i)+ fromInteger i = W64# (integerToWord64# i) -- | @since 2.01 instance Enum Word64 where@@ -770,7 +770,7 @@ divMod (W64# x#) y@(W64# y#) | y /= 0 = (W64# (x# `quotWord64#` y#), W64# (x# `remWord64#` y#)) | otherwise = divZeroError- toInteger (W64# x#) = word64ToInteger x#+ toInteger (W64# x#) = integerFromWord64# x# -- | @since 2.01 instance Bits Word64 where@@ -875,7 +875,7 @@ abs x = x signum 0 = 0 signum _ = 1- fromInteger i = W64# (integerToWord i)+ fromInteger i = W64# (integerToWord# i) -- | @since 2.01 instance Enum Word64 where@@ -892,11 +892,45 @@ | x <= fromIntegral (maxBound::Int) = I# (word2Int# x#) | otherwise = fromEnumError "Word64" x- enumFrom = integralEnumFrom- enumFromThen = integralEnumFromThen- enumFromTo = integralEnumFromTo- enumFromThenTo = integralEnumFromThenTo +#if WORD_SIZE_IN_BITS < 64+ enumFrom = integralEnumFrom+ enumFromThen = integralEnumFromThen+ enumFromTo = integralEnumFromTo+ enumFromThenTo = integralEnumFromThenTo+#else+ -- See Note [Stable Unfolding for list producers] in GHC.Enum+ {-# INLINABLE enumFrom #-}+ enumFrom w+ = map wordToWord64+ $ enumFrom (word64ToWord w)++ -- See Note [Stable Unfolding for list producers] in GHC.Enum+ {-# INLINABLE enumFromThen #-}+ enumFromThen w s+ = map wordToWord64+ $ enumFromThen (word64ToWord w) (word64ToWord s)++ -- See Note [Stable Unfolding for list producers] in GHC.Enum+ {-# INLINABLE enumFromTo #-}+ enumFromTo w1 w2+ = map wordToWord64+ $ enumFromTo (word64ToWord w1) (word64ToWord w2)++ -- See Note [Stable Unfolding for list producers] in GHC.Enum+ {-# INLINABLE enumFromThenTo #-}+ enumFromThenTo w1 s w2+ = map wordToWord64+ $ enumFromThenTo (word64ToWord w1) (word64ToWord s) (word64ToWord w2)++word64ToWord :: Word64 -> Word+word64ToWord (W64# w#) = (W# w#)++wordToWord64 :: Word -> Word64+wordToWord64 (W# w#) = (W64# w#)+#endif++ -- | @since 2.01 instance Integral Word64 where quot (W64# x#) y@(W64# y#)@@ -920,8 +954,8 @@ | y /= 0 = (W64# (x# `quotWord#` y#), W64# (x# `remWord#` y#)) | otherwise = divZeroError toInteger (W64# x#)- | isTrue# (i# >=# 0#) = smallInteger i#- | otherwise = wordToInteger x#+ | isTrue# (i# >=# 0#) = IS i#+ | otherwise = integerFromWord# x# where !i# = word2Int# x# @@ -1054,11 +1088,11 @@ {-# RULES "fromIntegral/Word8->Natural"- fromIntegral = wordToNatural . (fromIntegral :: Word8 -> Word)+ fromIntegral = naturalFromWord . (fromIntegral :: Word8 -> Word) "fromIntegral/Word16->Natural"- fromIntegral = wordToNatural . (fromIntegral :: Word16 -> Word)+ fromIntegral = naturalFromWord . (fromIntegral :: Word16 -> Word) "fromIntegral/Word32->Natural"- fromIntegral = wordToNatural . (fromIntegral :: Word32 -> Word)+ fromIntegral = naturalFromWord . (fromIntegral :: Word32 -> Word) #-} #if WORD_SIZE_IN_BITS == 64@@ -1067,6 +1101,6 @@ "fromIntegral/Natural->Word64" fromIntegral = (fromIntegral :: Word -> Word64) . naturalToWord "fromIntegral/Word64->Natural"- fromIntegral = wordToNatural . (fromIntegral :: Word64 -> Word)+ fromIntegral = naturalFromWord . (fromIntegral :: Word64 -> Word) #-} #endif
Numeric.hs view
@@ -70,6 +70,8 @@ import Text.ParserCombinators.ReadP( ReadP, readP_to_S, pfail ) import qualified Text.Read.Lex as L +-- $setup+-- >>> import Prelude -- ----------------------------------------------------------------------------- -- Reading
Numeric/Natural.hs view
@@ -21,4 +21,4 @@ ( Natural ) where -import GHC.Natural+import GHC.Num.Natural
System/CPUTime.hsc view
@@ -40,7 +40,7 @@ #elif defined(HAVE_GETRUSAGE) && ! solaris2_HOST_OS import qualified System.CPUTime.Posix.RUsage as I --- @getrusage()@ is right royal pain to deal with when targetting multiple+-- @getrusage()@ is right royal pain to deal with when targeting multiple -- versions of Solaris, since some versions supply it in libc (2.3 and 2.5), -- while 2.4 has got it in libucb (I wouldn't be too surprised if it was back -- again in libucb in 2.6..)
System/IO.hs view
@@ -60,6 +60,7 @@ -- | These functions are also exported by the "Prelude". readFile,+ readFile', writeFile, appendFile, @@ -123,6 +124,7 @@ hGetLine, hLookAhead, hGetContents,+ hGetContents', -- ** Text output @@ -143,6 +145,7 @@ getChar, getLine, getContents,+ getContents', readIO, readLn, @@ -202,7 +205,7 @@ -- as @\'\\r\\n\'@. -- -- A text-mode 'Handle' has an associated 'NewlineMode' that- -- specifies how to transate newline characters. The+ -- specifies how to translate newline characters. The -- 'NewlineMode' specifies the input and output translation -- separately, so that for instance you can translate @\'\\r\\n\'@ -- to @\'\\n\'@ on input, but leave newlines as @\'\\n\'@ on output.@@ -229,6 +232,12 @@ import Foreign.Ptr import Foreign.Marshal.Alloc import Foreign.Storable+import GHC.IO.SubSystem+import GHC.IO.Windows.Handle (openFileAsTemp)+import GHC.IO.Handle.Windows (mkHandleFromHANDLE)+import GHC.IO.Device as IODevice+import GHC.Real (fromIntegral)+import Foreign.Marshal.Utils (new) #endif import Foreign.C.Types import System.Posix.Internals@@ -242,13 +251,14 @@ import GHC.Num import GHC.IO hiding ( bracket, onException ) import GHC.IO.IOMode-import GHC.IO.Handle.FD import qualified GHC.IO.FD as FD import GHC.IO.Handle+import qualified GHC.IO.Handle.FD as POSIX import GHC.IO.Handle.Text ( hGetBufSome, hPutStrLn ) import GHC.IO.Exception ( userError ) import GHC.IO.Encoding import Text.Read+import GHC.IO.StdHandles import GHC.Show import GHC.MVar @@ -305,6 +315,15 @@ getContents :: IO String getContents = hGetContents stdin +-- | The 'getContents'' operation returns all user input as a single string,+-- which is fully read before being returned+-- (same as 'hGetContents'' 'stdin').+--+-- @since 4.15.0.0++getContents' :: IO String+getContents' = hGetContents' stdin+ -- | The 'interact' function takes a function of type @String->String@ -- as its argument. The entire input from the standard input device is -- passed to this function as its argument, and the resulting string is@@ -321,6 +340,15 @@ readFile :: FilePath -> IO String readFile name = openFile name ReadMode >>= hGetContents +-- | The 'readFile'' function reads a file and+-- returns the contents of the file as a string.+-- The file is fully read before being returned, as with 'getContents''.+--+-- @since 4.15.0.0++readFile' :: FilePath -> IO String+readFile' name = openFile name ReadMode >>= hGetContents'+ -- | The computation 'writeFile' @file str@ function writes the string @str@, -- to the file @file@. writeFile :: FilePath -> String -> IO ()@@ -419,7 +447,10 @@ putMVar m result return result --- NOTE: we do our own explicit black holing here, because GHC's lazy+-- Note [Blackholing in fixIO]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~+--+-- We do our own explicit black holing here, because GHC's lazy -- blackholing isn't enough. In an infinite loop, GHC may run the IO -- computation a few times before it notices the loop, which is wrong. --@@ -505,13 +536,29 @@ -- beginning with '.' as the second component. _ -> errorWithoutStackTrace "bug in System.IO.openTempFile" #if defined(mingw32_HOST_OS)- findTempName = do+ findTempName = findTempNamePosix <!> findTempNameWinIO++ findTempNameWinIO = do let label = if null prefix then "ghc" else prefix withCWString tmp_dir $ \c_tmp_dir -> withCWString label $ \c_template ->+ withCWString suffix $ \c_suffix -> do+ c_ptr <- new nullPtr+ res <- c_createUUIDTempFileErrNo c_tmp_dir c_template c_suffix+ c_ptr+ if not res+ then do errno <- getErrno+ ioError (errnoToIOError loc errno Nothing (Just tmp_dir))+ else do c_p <- peek c_ptr+ filename <- peekCWString c_p+ free c_p+ handleResultsWinIO filename ((fromIntegral mode .&. o_EXCL) == o_EXCL)++ findTempNamePosix = do+ let label = if null prefix then "ghc" else prefix+ withCWString tmp_dir $ \c_tmp_dir ->+ withCWString label $ \c_template -> withCWString suffix $ \c_suffix ->- -- NOTE: revisit this when new I/O manager in place and use a UUID- -- based one when we are no longer MAX_PATH bound. allocaBytes (sizeOf (undefined :: CWchar) * 260) $ \c_str -> do res <- c_getTempFileNameErrorNo c_tmp_dir c_template c_suffix 0 c_str@@ -519,9 +566,9 @@ then do errno <- getErrno ioError (errnoToIOError loc errno Nothing (Just tmp_dir)) else do filename <- peekCWString c_str- handleResults filename+ handleResultsPosix filename - handleResults filename = do+ handleResultsPosix filename = do let oflags1 = rw_flags .|. o_EXCL binary_flags | binary = o_BINARY@@ -537,14 +584,26 @@ True{-is_nonblock-} enc <- getLocaleEncoding- h <- mkHandleFromFD fD fd_type filename ReadWriteMode+ h <- POSIX.mkHandleFromFD fD fd_type filename ReadWriteMode False{-set non-block-} (Just enc) return (filename, h) + handleResultsWinIO filename excl = do+ (hwnd, hwnd_type) <- openFileAsTemp filename True excl+ mb_codec <- if binary then return Nothing else fmap Just getLocaleEncoding++ -- then use it to make a Handle+ h <- mkHandleFromHANDLE hwnd hwnd_type filename ReadWriteMode mb_codec+ `onException` IODevice.close hwnd+ return (filename, h)+ foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo :: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool +foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo+ :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool+ pathSeparator :: String -> Bool pathSeparator template = any (\x-> x == '/' || x == '\\') template @@ -564,7 +623,7 @@ True{-is_nonblock-} enc <- getLocaleEncoding- h <- mkHandleFromFD fD fd_type filepath ReadWriteMode False{-set non-block-} (Just enc)+ h <- POSIX.mkHandleFromFD fD fd_type filepath ReadWriteMode False{-set non-block-} (Just enc) return (filepath, h)
System/Info.hs view
@@ -1,49 +1,108 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-}-{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : System.Info -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : libraries@haskell.org -- Stability : experimental -- Portability : portable ----- Information about the characteristics of the host +-- Information about the characteristics of the host -- system lucky enough to run your program. --+-- For a comprehensive listing of supported platforms, please refer to+-- https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms ----------------------------------------------------------------------------- module System.Info- (- os,- arch,- compilerName,- compilerVersion- ) where+ ( os+ , arch+ , compilerName+ , compilerVersion+ , fullCompilerVersion+ ) where -import Data.Version+import Data.Version (Version (..)) -- | The version of 'compilerName' with which the program was compiled -- or is being interpreted.+--+-- ==== __Example__+-- > ghci> compilerVersion+-- > Version {versionBranch = [8,8], versionTags = []} compilerVersion :: Version compilerVersion = Version [major, minor] [] where (major, minor) = compilerVersionRaw `divMod` 100 +-- | The full version of 'compilerName' with which the program was compiled+-- or is being interpreted. It includes the major, minor, revision and an additional+-- identifier, generally in the form "<year><month><day>".+fullCompilerVersion :: Version+fullCompilerVersion = Version version []+ where+ version :: [Int]+ version = fmap read $ splitVersion __GLASGOW_HASKELL_FULL_VERSION__++splitVersion :: String -> [String]+splitVersion s =+ case dropWhile (== '.') s of+ "" -> []+ s' -> let (w, s'') = break (== '.') s'+ in w : splitVersion s''+ #include "ghcplatform.h" -- | The operating system on which the program is running.+-- Common values include:+--+-- * "darwin" — macOS+-- * "freebsd"+-- * "linux"+-- * "linux-android"+-- * "mingw32" — Windows+-- * "netbsd"+-- * "openbsd" os :: String os = HOST_OS -- | The machine architecture on which the program is running.+-- Common values include:+--+-- * "aarch64"+-- * "alpha"+-- * "arm"+-- * "hppa"+-- * "hppa1_1"+-- * "i386"+-- * "ia64"+-- * "m68k"+-- * "mips"+-- * "mipseb"+-- * "mipsel"+-- * "nios2"+-- * "powerpc"+-- * "powerpc64"+-- * "powerpc64le"+-- * "riscv32"+-- * "riscv64"+-- * "rs6000"+-- * "s390"+-- * "s390x"+-- * "sh4"+-- * "sparc"+-- * "sparc64"+-- * "vax"+-- * "x86_64" arch :: String arch = HOST_ARCH -- | The Haskell implementation with which the program was compiled -- or is being interpreted.+-- On the GHC platform, the value is "ghc". compilerName :: String compilerName = "ghc"
System/Posix/Internals.hs view
@@ -593,7 +593,7 @@ Note: Windows types Windows' _read and _write have types that differ from POSIX. They take an-unsigned int for lengh and return a signed int where POSIX uses size_t and+unsigned int for length and return a signed int where POSIX uses size_t and ssize_t. Those are different on x86_64 and equivalent on x86. We import them with the types in Microsoft's documentation which means that c_read, c_safe_read, c_write and c_safe_write have different Haskell types depending on
System/Timeout.hs view
@@ -15,7 +15,7 @@ -- Attach a timeout event to arbitrary 'IO' computations. -- --------------------------------------------------------------------------------+-- TODO: Inspect is still suitable. module System.Timeout ( Timeout, timeout ) where #if !defined(mingw32_HOST_OS)
Text/ParserCombinators/ReadPrec.hs view
@@ -64,7 +64,7 @@ import GHC.Num( Num(..) ) import GHC.Base -import qualified Control.Monad.Fail as MonadFail+import Control.Monad.Fail -- --------------------------------------------------------------------------- -- The readPrec type@@ -88,8 +88,8 @@ P f >>= k = P (\n -> do a <- f n; let P f' = k a in f' n) -- | @since 4.9.0.0-instance MonadFail.MonadFail ReadPrec where- fail s = P (\_ -> MonadFail.fail s)+instance MonadFail ReadPrec where+ fail s = P (\_ -> fail s) -- | @since 2.01 instance MonadPlus ReadPrec
Text/Printf.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE GADTs #-}+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} ----------------------------------------------------------------------------- -- |
Unsafe/Coerce.hs view
@@ -1,62 +1,311 @@-{-# LANGUAGE Unsafe #-}-{-# LANGUAGE NoImplicitPrelude, MagicHash #-}+-- We don't to strictness analysis on this file to avoid turning loopy unsafe+-- equality terms below to actual loops. Details in (U5) of+-- Note [Implementing unsafeCoerce]+{-# OPTIONS_GHC -fno-strictness #-} --------------------------------------------------------------------------------- |--- Module : Unsafe.Coerce--- Copyright : Malcolm Wallace 2006--- License : BSD-style (see the LICENSE file in the distribution)+{-# LANGUAGE Unsafe, NoImplicitPrelude, MagicHash, GADTs, TypeApplications,+ ScopedTypeVariables, TypeOperators, KindSignatures, PolyKinds,+ StandaloneKindSignatures, DataKinds #-}++module Unsafe.Coerce+ ( unsafeCoerce, unsafeCoerceUnlifted, unsafeCoerceAddr+ , unsafeEqualityProof+ , UnsafeEquality (..)+ , unsafeCoerce#+ ) where++import GHC.Arr (amap) -- For amap/unsafeCoerce rule+import GHC.Base+import GHC.Num.Integer () -- See Note [Depend on GHC.Num.Integer] in GHC.Base++import GHC.Types++{- Note [Implementing unsafeCoerce]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+The implementation of unsafeCoerce is surprisingly subtle.+This Note describes the moving parts. You will find more+background in MR !1869 and ticket #16893.++The key challenge is this. Suppose we have+ case sameTypeRep t1 t2 of+ False -> blah2+ True -> ...(case (x |> UnsafeCo @t1 @t2) of { K -> blah })...++The programmer thinks that the unsafeCoerce from 't1' to 't2' is safe,+because it is justified by a runtime test (sameTypeRep t1 t2).+It used to compile to a cast, with a magical 'UnsafeCo' coercion.++But alas, nothing then stops GHC floating that call to unsafeCoerce+outwards so we get+ case (x |> UnsafeCo @t1 @t2) of+ K -> case sameTypeRep t1 t2 of+ False -> blah2+ True -> ...blah...++and this is utterly wrong, because the unsafeCoerce is being performed+before the dynamic test. This is exactly the setup in #16893.++The solution is this:++* In the library Unsafe.Coerce we define:++ unsafeEqualityProof :: forall k (a :: k) (b :: k).+ UnsafeEquality a b++* It uses a GADT, Unsafe.Coerce.UnsafeEquality, that is exactly like :~:++ data UnsafeEquality (a :: k) (b :: k) where+ UnsafeRefl :: UnsafeEquality a a++* We can now define Unsafe.Coerce.unsafeCoerce very simply:++ unsafeCoerce :: forall (a :: Type) (b :: Type) . a -> b+ unsafeCoerce x = case unsafeEqualityProof @a @b of+ UnsafeRefl -> x++ There is nothing special about unsafeCoerce; it is an+ ordinary library definition, and can be freely inlined.++Now our bad case can't happen. We'll have+ case unsafeEqualityProof @t1 @t2 of+ UnsafeRefl (co :: t1 ~ t2) -> ....(x |> co)....++and the (x |> co) mentions the evidence 'co', which prevents it+floating.++But what stops the whole (case unsafeEqualityProof of ...) from+floating? Answer: we never float a case on a redex that can fail+outside a conditional. See Primop.hs,+Note [Transformations affected by can_fail and has_side_effects].+And unsafeEqualityProof (being opaque) is definitely treated as+can-fail.++While unsafeCoerce is a perfectly ordinary function that needs no+special treatment, Unsafe.Coerce.unsafeEqualityProof is magical, in+several ways++(U1) unsafeEqualityProof is /never/ inlined.++(U2) In CoreToStg.coreToStg, we transform+ case unsafeEqualityProof of UnsafeRefl -> blah+ ==>+ blah++ This eliminates the overhead of evaluating the unsafe+ equality proof.++ Any /other/ occurrence of unsafeEqualityProof is left alone.+ For example you could write+ f :: UnsafeEquality a b -> blah+ f eq_proof = case eq_proof of UnsafeRefl -> ...+ (Nothing special about that.) In a call, you might write+ f unsafeEqualityProof++ and we'll generate code simply by passing the top-level+ unsafeEqualityProof to f. As (U5) says, it is implemented as+ UnsafeRefl so all is good.++ NB: Don't discard the case if the case-binder is used+ case unsafeEqualityProof of wild_xx { UnsafeRefl ->+ ...wild_xx...+ That rarely happens, but see #18227.++(U3) In GHC.CoreToStg.Prep.cpeRhsE, if we see+ let x = case unsafeEqualityProof ... of+ UnsafeRefl -> K e+ in ...++ there is a danger that we'll go to+ let x = case unsafeEqualityProof ... of+ UnsafeRefl -> let a = e in K a+ in ...++ and produce a thunk even after discarding the unsafeEqualityProof.+ So instead we float out the case to give+ case unsafeEqualityProof ... of { UnsafeRefl ->+ let a = K e+ x = K a+ in ...+ Flaoting the case is OK here, even though it broardens the+ scope, becuase we are done with simplification.++(U4) GHC.CoreToStg.Prep.cpeExprIsTrivial anticipates the+ upcoming discard of unsafeEqualityProof.++(U4a) Ditto GHC.Core.Unfold.inlineBoringOk we want to treat+ the RHS of unsafeCoerce as very small; see+ Note [Inline unsafeCoerce] in that module.++(U5) The definition of unsafeEqualityProof in Unsafe.Coerce+ looks very strange:+ unsafeEqualityProof = case unsafeEqualityProof @a @b of+ UnsafeRefl -> UnsafeRefl++ It looks recursive! But the above-mentioned CoreToStg+ transform will change it to+ unsafeEqualityProof = UnsafeRefl+ And that is exactly the code we want! For example, if we say+ f unsafeEqualityProof+ we want to pass an UnsafeRefl constructor to f.++ We turn off strictness analysis in this module, otherwise+ the strictness analyser will mark unsafeEqualityProof as+ bottom, which is utterly wrong.++(U6) The UnsafeEquality data type is also special in one way.+ Consider this piece of Core+ case unsafeEqualityProof @Int @Bool of+ UnsafeRefl (g :: Int ~# Bool) -> ...g...++ The simplifier normally eliminates case alternatives with+ contradicatory GADT data constructors; here we bring into+ scope evidence (g :: Int~Bool). But we do not want to+ eliminate this particular alternative! So we put a special+ case into DataCon.dataConCannotMatch to account for this.++(U7) We add a built-in RULE+ unsafeEqualityProof k t t ==> UnsafeRefl (Refl t)+ to simplify the ase when the two tpyes are equal.++(U8) The is a super-magic RULE in GHC.base+ map coerce = coerce+ (see Note [Getting the map/coerce RULE to work] in CoreOpt)+ But it's all about turning coerce into a cast, and unsafeCoerce+ no longer does that. So we need a separate map/unsafeCoerce+ RULE, in this module.++There are yet more wrinkles++(U9) unsafeCoerce works only over types of kind `Type`.+ But what about other types? In Unsafe.Coerce we also define++ unsafeCoerceUnlifted :: forall (a :: TYPE UnliftedRep)+ (b :: TYPE UnliftedRep).+ a -> b+ unsafeCoerceUnlifted x+ = case unsafeEqualityProof @a @b of+ UnsafeRefl -> x++ and similarly for unsafeCoerceAddr, unsafeCoerceInt, etc.++(U10) We also want a levity-polymorphic unsafeCoerce#:++ unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)+ (a :: TYPE r1) (b :: TYPE r2).+ a -> b++ This is even more dangerous, because it converts between two types+ *with different runtime representations*!! Our goal is to deprecate+ it entirely. But for now we want it.++ But having it is hard! It is defined by a kind of stub in Unsafe.Coerce,+ and overwritten by the desugarer. See Note [Wiring in unsafeCoerce#]+ in Desugar. Here's the code for it+ unsafeCoerce# x = case unsafeEqualityProof @r1 @r2 of UnsafeRefl ->+ case unsafeEqualityProof @a @b of UnsafeRefl ->+ x+ Notice that we can define this kind-/heterogeneous/ function by calling+ the kind-/homogeneous/ unsafeEqualityProof twice.++ See Note [Wiring in unsafeCoerce#] in Desugar.++(U11) We must also be careful to discard unsafeEqualityProof in the+ bytecode generator; see ByteCodeGen.bcView. Here we don't really+ care about fast execution, but (annoyingly) we /do/ care about the+ GHCi debugger, and GHCi itself uses unsafeCoerce.++ Moreover, in GHC.Tc.Module.tcGhciStmts we use unsafeCoerce#, rather+ than the more kosher unsafeCoerce, becuase (with -O0) the latter+ may not be inlined.++ Sigh+-}++-- | This type is treated magically within GHC. Any pattern match of the+-- form @case unsafeEqualityProof of UnsafeRefl -> body@ gets transformed just into @body@.+-- This is ill-typed, but the transformation takes place after type-checking is+-- complete. It is used to implement 'unsafeCoerce'. You probably don't want to+-- use 'UnsafeRefl' in an expression, but you might conceivably want to pattern-match+-- on it. Use 'unsafeEqualityProof' to create one of these.+data UnsafeEquality a b where+ UnsafeRefl :: UnsafeEquality a a++{-# NOINLINE unsafeEqualityProof #-}+unsafeEqualityProof :: forall a b . UnsafeEquality a b+-- See (U5) of Note [Implementing unsafeCoerce]+unsafeEqualityProof = case unsafeEqualityProof @a @b of UnsafeRefl -> UnsafeRefl++{-# INLINE [1] unsafeCoerce #-}+-- The INLINE will almost certainly happen automatically, but it's almost+-- certain to generate (slightly) better code, so let's do it. For example ----- Maintainer : libraries@haskell.org--- Stability : experimental--- Portability : portable+-- case (unsafeCoerce blah) of ... ----- The highly unsafe primitive 'unsafeCoerce' converts a value from any--- type to any other type. Needless to say, if you use this function,--- it is your responsibility to ensure that the old and new types have--- identical internal representations, in order to prevent runtime corruption.+-- will turn into ----- The types for which 'unsafeCoerce' is representation-safe may differ--- from compiler to compiler (and version to version).+-- case unsafeEqualityProof of UnsafeRefl -> case blah of ... ----- * Documentation for correct usage in GHC will be found under--- 'unsafeCoerce#' in "GHC.Base" (around which 'unsafeCoerce' is just a--- trivial wrapper).+-- which is definitely better.++-- | Coerce a value from one type to another, bypassing the type-checker. ----- * In nhc98, the only representation-safe coercions are between--- 'Prelude.Enum' types with the same range (e.g. 'Prelude.Int',--- 'Data.Int.Int32', 'Prelude.Char', 'Data.Word.Word32'), or between a--- newtype and the type that it wraps.+-- There are several legitimate ways to use 'unsafeCoerce': ----------------------------------------------------------------------------------module Unsafe.Coerce (unsafeCoerce) where+-- 1. To coerce e.g. @Int@ to @HValue@, put it in a list of @HValue@,+-- and then later coerce it back to @Int@ before using it.+--+-- 2. To produce e.g. @(a+b) :~: (b+a)@ from @unsafeCoerce Refl@.+-- Here the two sides really are the same type -- so nothing unsafe is happening+-- -- but GHC is not clever enough to see it.+--+-- 3. In @Data.Typeable@ we have+--+-- @+-- eqTypeRep :: forall k1 k2 (a :: k1) (b :: k2).+-- TypeRep a -> TypeRep b -> Maybe (a :~~: b)+-- eqTypeRep a b+-- | sameTypeRep a b = Just (unsafeCoerce HRefl)+-- | otherwise = Nothing+-- @+--+-- Here again, the @unsafeCoerce HRefl@ is safe, because the two types really+-- are the same -- but the proof of that relies on the complex, trusted+-- implementation of @Typeable@.+--+-- 4. The "reflection trick", which takes advantanage of the fact that in+-- @class C a where { op :: ty }@, we can safely coerce between @C a@ and @ty@+-- (which have different kinds!) because it's really just a newtype.+-- Note: there is /no guarantee, at all/ that this behavior will be supported+-- into perpetuity.+unsafeCoerce :: forall (a :: Type) (b :: Type) . a -> b+unsafeCoerce x = case unsafeEqualityProof @a @b of UnsafeRefl -> x -import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base-import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base-import GHC.Prim (unsafeCoerce#)+unsafeCoerceUnlifted :: forall (a :: TYPE 'UnliftedRep) (b :: TYPE 'UnliftedRep) . a -> b+-- Kind-homogeneous, but levity monomorphic (TYPE UnliftedRep)+unsafeCoerceUnlifted x = case unsafeEqualityProof @a @b of UnsafeRefl -> x -local_id :: a -> a-local_id x = x -- See Note [Mega-hack for coerce]+unsafeCoerceAddr :: forall (a :: TYPE 'AddrRep) (b :: TYPE 'AddrRep) . a -> b+-- Kind-homogeneous, but levity monomorphic (TYPE AddrRep)+unsafeCoerceAddr x = case unsafeEqualityProof @a @b of UnsafeRefl -> x -{- Note [Mega-hack for coerce]+-- | Highly, terribly dangerous coercion from one representation type+-- to another. Misuse of this function can invite the garbage collector+-- to trounce upon your data and then laugh in your face. You don't want+-- this function. Really.+unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)+ (a :: TYPE r1) (b :: TYPE r2).+ a -> b+unsafeCoerce# = error "GHC internal error: unsafeCoerce# not unfolded"+-- See (U10) of Note [Implementing unsafeCorece]+-- The RHS is updated by Desugar.patchMagicDefns+-- See Desugar Note [Wiring in unsafeCoerce#] -If we just say- unsafeCoerce x = unsafeCoerce# x-then the simple-optimiser that the desugarer runs will eta-reduce to- unsafeCoerce :: forall (a:*) (b:*). a -> b- unsafeCoerce = unsafeCoerce#-But we shouldn't be calling unsafeCoerce# in a higher-order way; it has a compulsory unfolding- unsafeCoerce# a b x = x |> UnsafeCo a b-and we really rely on it being inlined pronto. But the simple-optimiser doesn't.-The identity function local_id delays the eta reduction just long enough-for unsafeCoerce# to get inlined.+{-# RULES+-- See (U8) in Note [Implementing unsafeCoerce] -Sigh. This is horrible, but then so is unsafeCoerce.--}+-- unsafeCoerce version of the map/coerce rule defined in GHC.Base+"map/unsafeCoerce" map unsafeCoerce = unsafeCoerce -unsafeCoerce :: a -> b-unsafeCoerce x = local_id (unsafeCoerce# x)- -- See Note [Unsafe coerce magic] in basicTypes/MkId- -- NB: Do not eta-reduce this definition (see above)+-- unsafeCoerce version of the amap/coerce rule defined in GHC.Arr+"amap/unsafeCoerce" amap unsafeCoerce = unsafeCoerce+ #-}
base.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: base-version: 4.14.3.0+version: 4.15.0.0 -- NOTE: Don't forget to update ./changelog.md license: BSD-3-Clause@@ -37,6 +37,7 @@ include/ieee-flpt.h include/md5.h include/fs.h+ include/winio_structs.h install-sh source-repository head@@ -44,16 +45,6 @@ location: https://gitlab.haskell.org/ghc/ghc.git subdir: libraries/base -Flag integer-simple- Description: Use integer-simple- Manual: True- Default: False--Flag integer-gmp- Description: Use integer-gmp- Manual: True- Default: False- Library default-language: Haskell2010 other-extensions:@@ -95,17 +86,10 @@ UnliftedFFITypes Unsafe - build-depends: rts == 1.0.*, ghc-prim >= 0.5.1.0 && < 0.7-- -- sanity-check to ensure exactly one flag is set- if !((flag(integer-gmp) && !flag(integer-simple)) || (!flag(integer-gmp) && flag(integer-simple)))- build-depends: invalid-cabal-flag-settings<0-- if flag(integer-simple)- build-depends: integer-simple ^>= 0.1.1-- if flag(integer-gmp)- build-depends: integer-gmp ^>= 1.0.1+ build-depends:+ rts == 1.0,+ ghc-prim >= 0.5.1.0 && < 0.8,+ ghc-bignum >= 1.0 && < 2.0 exposed-modules: Control.Applicative@@ -217,6 +201,7 @@ GHC.Enum GHC.Environment GHC.Err+ GHC.Event.TimeOut GHC.Exception GHC.Exception.Type GHC.ExecutionStack@@ -255,9 +240,13 @@ GHC.IO.Handle.Types GHC.IO.IOMode GHC.IO.Unsafe+ GHC.IO.StdHandles+ GHC.IO.SubSystem GHC.IOArray GHC.IORef GHC.Int+ GHC.Integer+ GHC.Integer.Logarithms GHC.Ix GHC.List GHC.Maybe@@ -319,7 +308,14 @@ Type.Reflection Type.Reflection.Unsafe Unsafe.Coerce+ -- TODO: remove+ GHC.IOPort + reexported-modules:+ GHC.Num.Integer+ , GHC.Num.Natural+ , GHC.Num.BigNat+ other-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp@@ -334,6 +330,8 @@ GHC.IO.Handle.Lock.NoOp GHC.IO.Handle.Lock.Windows GHC.StaticPtr.Internal+ GHC.Event.Internal.Types+ -- GHC.IOPort -- TODO: hide again after debug System.Environment.ExecutablePath System.CPUTime.Utils @@ -342,8 +340,6 @@ cbits/PrelIOUtils.c cbits/SetEnv.c cbits/WCsubst.c- cbits/Win32Utils.c- cbits/consUtils.c cbits/iconv.c cbits/inputReady.c cbits/md5.c@@ -373,14 +369,50 @@ -- mingwex and mingw32. the __math_err symbol is defined in -- mingw32 which is required by mingwex. -- shlwapi: provides PathFileExistsW- extra-libraries: wsock32, user32, shell32, msvcrt, mingw32, mingwex, shlwapi+ -- ws2_32: provides access to socket types and functions+ -- ole32: provides UUID functionality.+ -- rpcrt4: provides RPC UUID creation.+ -- ntdll: provides access to functions to inspect window handles+ extra-libraries: wsock32, user32, shell32, msvcrt, mingw32,+ mingwex, ws2_32, shlwapi, ole32, rpcrt4, ntdll+ -- Minimum supported Windows version.+ -- These numbers can be found at:+ -- https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx+ -- If we're compiling on windows, enforce that we only support Windows 7++ -- Adding this here means it doesn't have to be done in individual .c files+ -- and also centralizes the versioning.+ cpp-options: -D_WIN32_WINNT=0x06010000+ cc-options: -D_WIN32_WINNT=0x06010000 exposed-modules: GHC.IO.Encoding.CodePage.API GHC.IO.Encoding.CodePage.Table GHC.Conc.Windows+ GHC.Conc.WinIO+ GHC.Conc.POSIX+ GHC.Conc.POSIX.Const GHC.Windows+ GHC.Event.Windows+ GHC.Event.Windows.Clock+ GHC.Event.Windows.ConsoleEvent+ GHC.Event.Windows.FFI+ GHC.Event.Windows.ManagedThreadPool+ GHC.Event.Windows.Thread+ GHC.IO.Handle.Windows+ GHC.IO.Windows.Handle+ GHC.IO.Windows.Encoding+ GHC.IO.Windows.Paths other-modules:+ GHC.Event.Arr+ GHC.Event.Array+ GHC.Event.IntTable+ GHC.Event.PSQ+ GHC.Event.Unique System.CPUTime.Windows+ c-sources:+ cbits/Win32Utils.c+ cbits/consUtils.c+ cbits/IOutils.c+ else exposed-modules: GHC.Event@@ -403,12 +435,6 @@ System.CPUTime.Posix.Times System.CPUTime.Posix.RUsage System.CPUTime.Unsupported-- -- The Ports framework always passes this flag when building software that- -- uses iconv to make iconv from Ports compatible with iconv from the base system- -- See /usr/ports/Mk/Uses/iconv.mk- if os(freebsd)- cc-options: -DLIBICONV_PLUG -- We need to set the unit id to base (without a version number) -- as it's magic.
+ cbits/IOutils.c view
@@ -0,0 +1,484 @@+/*+ * (c) The GHC Team 2017-2018.+ *+ * I/O Utility functions for Windows.+ */++#include <stdbool.h>+#include <stdint.h>+#include <winsock2.h>+#include <windows.h>+#include <io.h>+#include <math.h>++/* Import some functions defined in base. */+extern void maperrno(void);++/* Enum of Handle type. */+typedef+enum HandleType+ {+ TYPE_CHAR, // 0+ TYPE_DISK, // 1+ TYPE_PIPE, // 2+ TYPE_SOCKET, // 3+ TYPE_REMOTE, // 4+ TYPE_RAW, // 5+ TYPE_UNKNOWN // 6+ } HANDLE_TYPE;++/*+ * handleReady(hwnd) checks to see whether input is available on the file+ * handle 'hwnd'. Input meaning 'can I safely read at least a+ * *character* from this file object without blocking?'+ */+int+__handle_ready(HANDLE hFile, bool write, int msecs)+{+ DWORD handleType = GetFileType (hFile);++ DWORD rc;+ DWORD avail;++ switch (handleType)+ {+ case FILE_TYPE_CHAR:+ {+ INPUT_RECORD buf[1];+ DWORD count;++ /* A Console Handle will appear to be ready+ (WaitForSingleObject() returned WAIT_OBJECT_0) when+ it has events in its input buffer, but these events might+ not be keyboard events, so when we read from the Handle the+ read() will block. So here we try to discard non-keyboard+ events from a console handle's input buffer and then try+ the WaitForSingleObject() again.+ Phyx: I'm worried that we're discarding events someone else may need. */+ while (true) // keep trying until we find a real key event+ {+ rc = WaitForSingleObject( hFile, msecs );+ switch (rc)+ {+ case WAIT_TIMEOUT:+ return false;+ case WAIT_OBJECT_0:+ break;+ default:+ /* WAIT_FAILED */+ maperrno();+ return -1;+ }++ while (true) // discard non-key events+ {+ /* I wonder if we can do better by grabbing a list of+ input records at a time by using PeekConsoleInput. */+ rc = PeekConsoleInput(hFile, buf, 1, &count);+ if (rc == 0) {+ rc = GetLastError();+ if (rc == ERROR_INVALID_HANDLE || rc == ERROR_INVALID_FUNCTION)+ return true;+ else {+ maperrno();+ return -1;+ }+ }++ if (count == 0)+ break; /* no more events => wait again. */++ /* discard console events that are not "key down", because+ these will also be discarded by ReadFile(). */+ if (buf[0].EventType == KEY_EVENT &&+ buf[0].Event.KeyEvent.bKeyDown &&+ buf[0].Event.KeyEvent.uChar.AsciiChar != '\0')+ return true; /* it's a proper keypress. */+ else+ {+ /* it's a non-key event, a key up event, or a+ non-character key (e.g. shift). discard it. */+ rc = ReadConsoleInput(hFile, buf, 1, &count);+ if (rc == 0) {+ rc = GetLastError();+ if (rc == ERROR_INVALID_HANDLE || rc == ERROR_INVALID_FUNCTION)+ return true;+ else {+ maperrno();+ return -1;+ }+ }+ }+ }+ }+ }+ case FILE_TYPE_DISK:+ /* assume that disk files are always ready. */+ return true;++ case FILE_TYPE_PIPE:+ {+ // Try to see if this is a socket+ //-------------------------+ // Create new event+ WSAEVENT newEvent = WSACreateEvent();++ //-------------------------+ // Associate event types FD_WRITE or FD_READ+ // with the listening socket and NewEvent+ rc = WSAEventSelect((SOCKET)hFile, newEvent, write ? FD_WRITE : FD_READ);++ if (rc == WSAENOTSOCK)+ {+ CloseHandle (newEvent);++ // WaitForMultipleObjects() doesn't work for pipes (it+ // always returns WAIT_OBJECT_0 even when no data is+ // available). If the HANDLE is a pipe, therefore, we try+ // PeekNamedPipe:+ //+ rc = PeekNamedPipe( hFile, NULL, 0, NULL, &avail, NULL );+ if (rc != 0)+ return avail != 0;+ else {+ rc = GetLastError();+ if (rc == ERROR_BROKEN_PIPE)+ return true; // this is probably what we want++ if (rc != ERROR_INVALID_HANDLE && rc != ERROR_INVALID_FUNCTION) {+ maperrno();+ return -1;+ }+ }+ /* PeekNamedPipe didn't work - fall through to the general case */+ }+ else if (rc != 0)+ {+ CloseHandle (newEvent);+ // It seems to be a socket but can't determine the state.+ // Maybe not initialized. Either way, we know enough.+ return false;+ }++ // Wait for the socket event to trigger.+ rc = WaitForSingleObject( newEvent, msecs );+ CloseHandle (newEvent);++ /* 1 => Input ready, 0 => not ready, -1 => error */+ switch (rc)+ {+ case WAIT_TIMEOUT:+ return false;+ case WAIT_OBJECT_0:+ return true;+ default:+ {+ /* WAIT_FAILED */+ maperrno();+ return -1;+ }+ }+ }+ default:+ rc = WaitForSingleObject( hFile, msecs );++ /* 1 => Input ready, 0 => not ready, -1 => error */+ switch (rc)+ {+ case WAIT_TIMEOUT:+ return false;+ case WAIT_OBJECT_0:+ return true;+ default:+ {+ /* WAIT_FAILED */+ maperrno();+ return -1;+ }+ }+ }+}++bool+__is_console(HANDLE hFile)+{+ /* Broken handle can't be terminal */+ if (hFile == INVALID_HANDLE_VALUE)+ return false;++ DWORD handleType = GetFileType (hFile);++ /* TTY must be a character device */+ if (handleType != FILE_TYPE_CHAR)+ return false;++ DWORD st;+ /* GetConsoleMode appears to fail when it's not a TTY. In+ particular, it's what most of our terminal functions+ assume works, so if it doesn't work for all intents+ and purposes we're not dealing with a terminal. */+ if (!GetConsoleMode(hFile, &st)) {+ /* Clear the error buffer before returning. */+ SetLastError (ERROR_SUCCESS);+ return false;+ }++ return true;+}++#if !defined(ENABLE_VIRTUAL_TERMINAL_INPUT)+#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200+#endif++bool+__set_console_buffering(HANDLE hFile, bool cooked)+{+ if (hFile == INVALID_HANDLE_VALUE) {+ return false;+ }++ DWORD st;+ if (!GetConsoleMode(hFile, &st)) {+ return false;+ }++ /* According to GetConsoleMode() docs, it is not possible to+ leave ECHO_INPUT enabled without also having LINE_INPUT,+ so we have to turn both off here.+ We toggle ENABLE_VIRTUAL_TERMINAL_INPUT to enable us to receive+ virtual keyboard keys in ReadConsole. */+ DWORD flgs = ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT;+ DWORD enabled = (st & ~flgs) | ENABLE_VIRTUAL_TERMINAL_INPUT;+ DWORD disabled = (st | ENABLE_LINE_INPUT) & ~ENABLE_VIRTUAL_TERMINAL_INPUT;+++ return SetConsoleMode(hFile, cooked ? enabled : disabled);+}++bool+__set_console_echo(HANDLE hFile, bool on)+{+ DWORD st;+ DWORD flgs = ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT;++ if (hFile == INVALID_HANDLE_VALUE) {+ return false;+ }++ return GetConsoleMode(hFile, &st) &&+ SetConsoleMode(hFile, ( on ? (st | flgs) : (st & ~flgs)));+}++bool+__get_console_echo(HANDLE hFile)+{+ DWORD st;++ if (hFile == INVALID_HANDLE_VALUE) {+ return false;+ }++ return GetConsoleMode(hFile, &st) &&+ (st & ENABLE_ECHO_INPUT) == ENABLE_ECHO_INPUT;+}++bool+__flush_input_console(HANDLE hFile)+{+ if ( hFile == INVALID_HANDLE_VALUE )+ return false;++ /* If the 'handle' isn't connected to a console; treat the flush+ * operation as a NOP.+ */+ DWORD unused;+ if ( !GetConsoleMode(hFile, &unused) &&+ GetLastError() == ERROR_INVALID_HANDLE ) {+ return false;+ }++ if ( FlushConsoleInputBuffer(hFile) )+ return true;++ maperrno();+ return false;+}++HANDLE_TYPE+__handle_type (HANDLE hFile)+{+ DWORD handleType = GetFileType (hFile);+ switch (handleType)+ {+ case FILE_TYPE_PIPE:+ {+ WSAEVENT newEvent = WSACreateEvent();+ DWORD rc = WSAEventSelect((SOCKET)hFile, newEvent, FD_CLOSE);+ CloseHandle (newEvent);+ if (rc == WSAENOTSOCK)+ return TYPE_SOCKET;+ else+ return TYPE_PIPE;+ }+ case FILE_TYPE_CHAR:+ return TYPE_CHAR;+ case FILE_TYPE_DISK:+ return TYPE_DISK;+ case FILE_TYPE_REMOTE:+ return TYPE_REMOTE;+ case FILE_TYPE_UNKNOWN:+ default:+ return TYPE_UNKNOWN;+ }+}++bool+__close_handle (HANDLE hFile)+{+ switch (__handle_type (hFile))+ {+ case TYPE_SOCKET:+ return closesocket ((SOCKET)hFile) == 0;+ default:+ return CloseHandle (hFile);+ }+}++bool __set_file_pointer (HANDLE hFile, int64_t pos, DWORD moveMethod,+ int64_t* outPos)+{+ LARGE_INTEGER ret;+ LARGE_INTEGER li;+ li.QuadPart = pos;+ bool success = SetFilePointerEx (hFile, li, &ret, moveMethod)+ != INVALID_SET_FILE_POINTER;+ *outPos = ret.QuadPart;+ return success;+}++int64_t __get_file_pointer (HANDLE hFile)+{+ LARGE_INTEGER ret;+ LARGE_INTEGER pos;+ pos.QuadPart = 0;+ if (SetFilePointerEx(hFile, pos, &ret, FILE_CURRENT)+ == INVALID_SET_FILE_POINTER)+ return -1;++ return ret.QuadPart;+}++int64_t __get_file_size (HANDLE hFile)+{+ /* Broken handle can't do stat. */+ if (hFile == INVALID_HANDLE_VALUE)+ return false;++ switch (GetFileType (hFile))+ {+ case FILE_TYPE_CHAR:+ case FILE_TYPE_DISK:+ break;+ default:+ return -1;+ }++ LARGE_INTEGER ret;+ if (!GetFileSizeEx(hFile, &ret))+ return -1;++ return ret.QuadPart;+}++bool __set_file_size (HANDLE hFile, int64_t size)+{+ LARGE_INTEGER li;+ li.QuadPart = size;+ if(!SetFilePointerEx (hFile, li, NULL, FILE_BEGIN))+ return false;++ return SetEndOfFile (hFile);+}++bool __duplicate_handle (HANDLE hFile, HANDLE* hFileDup)+{+ switch (__handle_type (hFile))+ {+ case TYPE_SOCKET:+ // should use WSADuplicateSocket+ return false;+ default:+ return DuplicateHandle(GetCurrentProcess(),+ hFile,+ GetCurrentProcess(),+ hFileDup,+ 0,+ FALSE,+ DUPLICATE_SAME_ACCESS);+ }+}++bool __set_console_pointer (HANDLE hFile, int64_t pos, DWORD moveMethod,+ int64_t* outPos)+{+ CONSOLE_SCREEN_BUFFER_INFO info;+ if(!GetConsoleScreenBufferInfo (hFile, &info))+ return false;++ COORD point;+ switch (moveMethod)+ {+ case FILE_END:+ {+ int64_t end = info.dwSize.X * info.dwSize.Y;+ pos = end + pos;+ point = (COORD) { pos % info.dwSize.X, pos / info.dwSize.X };+ break;+ }+ case FILE_CURRENT:+ {+ int64_t current = (info.dwCursorPosition.Y * info.dwSize.X)+ + info.dwCursorPosition.X;+ pos = current + pos;+ point = (COORD) { pos % info.dwSize.X, pos / info.dwSize.X };+ break;+ }+ case FILE_BEGIN:+ default:+ point = (COORD) { pos % info.dwSize.X, pos / info.dwSize.X };+ break;+ }++ *outPos = pos;+ return SetConsoleCursorPosition (hFile, point);+}++int64_t __get_console_pointer (HANDLE hFile)+{+ CONSOLE_SCREEN_BUFFER_INFO info;+ if(!GetConsoleScreenBufferInfo (hFile, &info))+ return -1;++ return (info.dwCursorPosition.Y * info.dwSize.X) + info.dwCursorPosition.X;+}++int64_t __get_console_buffer_size (HANDLE hFile)+{+ CONSOLE_SCREEN_BUFFER_INFO ret;+ if (!GetConsoleScreenBufferInfo(hFile, &ret))+ return -1;++ return ret.dwSize.X * ret.dwSize.Y;+}++bool __set_console_buffer_size (HANDLE hFile, int64_t size)+{+ CONSOLE_SCREEN_BUFFER_INFO ret;+ if (!GetConsoleScreenBufferInfo(hFile, &ret))+ return false;++ COORD sz = {ret.dwSize.X, (int)ceil(size / ret.dwSize.X)};+ return SetConsoleScreenBufferSize (hFile, sz);+}++
cbits/WCsubst.c view
@@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- This is an automatically generated file: do not edit-Generated by ubconfc at Fri Jun 4 04:17:56 PM IST 2021+Generated by ubconfc at Mon Feb 10 11:42:51 EST 2020 @generated -------------------------------------------------------------------------*/ @@ -90,8 +90,8 @@ #define GENCAT_MN 2097152 #define GENCAT_LO 16384 #define MAX_UNI_CHAR 1114109-#define NUM_BLOCKS 3396-#define NUM_CONVBLOCKS 1332+#define NUM_BLOCKS 3351+#define NUM_CONVBLOCKS 1326 #define NUM_SPACEBLOCKS 7 #define NUM_LAT1BLOCKS 63 #define NUM_RULES 205@@ -1123,7 +1123,7 @@ {2142, 1, &rule2}, {2144, 11, &rule14}, {2208, 21, &rule14},- {2230, 18, &rule14},+ {2230, 8, &rule14}, {2259, 15, &rule92}, {2274, 1, &rule16}, {2275, 32, &rule92},@@ -1239,7 +1239,7 @@ {2887, 2, &rule124}, {2891, 2, &rule124}, {2893, 1, &rule92},- {2901, 2, &rule92},+ {2902, 1, &rule92}, {2903, 1, &rule124}, {2908, 2, &rule14}, {2911, 3, &rule14},@@ -1318,7 +1318,7 @@ {3313, 2, &rule14}, {3328, 2, &rule92}, {3330, 2, &rule124},- {3332, 9, &rule14},+ {3333, 8, &rule14}, {3342, 3, &rule14}, {3346, 41, &rule14}, {3387, 2, &rule92},@@ -1339,7 +1339,6 @@ {3440, 9, &rule17}, {3449, 1, &rule13}, {3450, 6, &rule14},- {3457, 1, &rule92}, {3458, 2, &rule124}, {3461, 18, &rule14}, {3482, 24, &rule14},@@ -1583,7 +1582,6 @@ {6824, 6, &rule2}, {6832, 14, &rule92}, {6846, 1, &rule119},- {6847, 2, &rule92}, {6912, 4, &rule92}, {6916, 1, &rule124}, {6917, 47, &rule14},@@ -2223,7 +2221,7 @@ {11079, 6, &rule6}, {11085, 39, &rule13}, {11126, 32, &rule13},- {11159, 105, &rule13},+ {11160, 104, &rule13}, {11264, 47, &rule122}, {11312, 47, &rule123}, {11360, 1, &rule22},@@ -2419,8 +2417,6 @@ {11841, 1, &rule2}, {11842, 1, &rule4}, {11843, 13, &rule2},- {11856, 2, &rule13},- {11858, 1, &rule2}, {11904, 26, &rule13}, {11931, 89, &rule13}, {12032, 214, &rule13},@@ -2480,7 +2476,7 @@ {12688, 2, &rule13}, {12690, 4, &rule17}, {12694, 10, &rule13},- {12704, 32, &rule14},+ {12704, 27, &rule14}, {12736, 36, &rule13}, {12784, 16, &rule14}, {12800, 31, &rule13},@@ -2494,9 +2490,9 @@ {12938, 39, &rule13}, {12977, 15, &rule17}, {12992, 320, &rule13},- {13312, 6592, &rule14},+ {13312, 6582, &rule14}, {19904, 64, &rule13},- {19968, 20989, &rule14},+ {19968, 20976, &rule14}, {40960, 21, &rule14}, {40981, 1, &rule91}, {40982, 1143, &rule14},@@ -2754,12 +2750,6 @@ {42948, 1, &rule194}, {42949, 1, &rule195}, {42950, 1, &rule196},- {42951, 1, &rule22},- {42952, 1, &rule23},- {42953, 1, &rule22},- {42954, 1, &rule23},- {42997, 1, &rule22},- {42998, 1, &rule23}, {42999, 1, &rule14}, {43000, 2, &rule91}, {43002, 1, &rule20},@@ -2774,7 +2764,6 @@ {43045, 2, &rule92}, {43047, 1, &rule124}, {43048, 4, &rule13},- {43052, 1, &rule92}, {43056, 6, &rule17}, {43062, 2, &rule13}, {43064, 1, &rule3},@@ -2876,9 +2865,7 @@ {43860, 7, &rule20}, {43867, 1, &rule10}, {43868, 4, &rule91},- {43872, 9, &rule20},- {43881, 1, &rule91},- {43882, 2, &rule10},+ {43872, 8, &rule20}, {43888, 80, &rule198}, {43968, 35, &rule14}, {44003, 2, &rule124},@@ -3035,7 +3022,7 @@ {65913, 17, &rule13}, {65930, 2, &rule17}, {65932, 3, &rule13},- {65936, 13, &rule13},+ {65936, 12, &rule13}, {65952, 1, &rule13}, {66000, 45, &rule13}, {66045, 1, &rule92},@@ -3134,10 +3121,6 @@ {68900, 4, &rule92}, {68912, 10, &rule8}, {69216, 31, &rule17},- {69248, 42, &rule14},- {69291, 2, &rule92},- {69293, 1, &rule7},- {69296, 2, &rule14}, {69376, 29, &rule14}, {69405, 10, &rule17}, {69415, 1, &rule14},@@ -3145,8 +3128,6 @@ {69446, 11, &rule92}, {69457, 4, &rule17}, {69461, 5, &rule2},- {69552, 21, &rule14},- {69573, 7, &rule17}, {69600, 23, &rule14}, {69632, 1, &rule124}, {69633, 1, &rule92},@@ -3178,7 +3159,6 @@ {69952, 4, &rule2}, {69956, 1, &rule14}, {69957, 2, &rule124},- {69959, 1, &rule14}, {69968, 35, &rule14}, {70003, 1, &rule92}, {70004, 2, &rule2},@@ -3193,8 +3173,6 @@ {70085, 4, &rule2}, {70089, 4, &rule92}, {70093, 1, &rule2},- {70094, 1, &rule124},- {70095, 1, &rule92}, {70096, 10, &rule8}, {70106, 1, &rule14}, {70107, 1, &rule2},@@ -3253,10 +3231,10 @@ {70727, 4, &rule14}, {70731, 5, &rule2}, {70736, 10, &rule8},- {70746, 2, &rule2},+ {70747, 1, &rule2}, {70749, 1, &rule2}, {70750, 1, &rule92},- {70751, 3, &rule14},+ {70751, 1, &rule14}, {70784, 48, &rule14}, {70832, 3, &rule124}, {70835, 6, &rule92},@@ -3321,23 +3299,7 @@ {71872, 32, &rule12}, {71904, 10, &rule8}, {71914, 9, &rule17},- {71935, 8, &rule14},- {71945, 1, &rule14},- {71948, 8, &rule14},- {71957, 2, &rule14},- {71960, 24, &rule14},- {71984, 6, &rule124},- {71991, 2, &rule124},- {71995, 2, &rule92},- {71997, 1, &rule124},- {71998, 1, &rule92},- {71999, 1, &rule14},- {72000, 1, &rule124},- {72001, 1, &rule14},- {72002, 1, &rule124},- {72003, 1, &rule92},- {72004, 3, &rule2},- {72016, 10, &rule8},+ {71935, 1, &rule14}, {72096, 8, &rule14}, {72106, 39, &rule14}, {72145, 3, &rule124},@@ -3415,7 +3377,6 @@ {73459, 2, &rule92}, {73461, 2, &rule124}, {73463, 2, &rule2},- {73648, 1, &rule14}, {73664, 21, &rule17}, {73685, 8, &rule13}, {73693, 4, &rule3},@@ -3459,11 +3420,8 @@ {94176, 2, &rule91}, {94178, 1, &rule2}, {94179, 1, &rule91},- {94180, 1, &rule92},- {94192, 2, &rule124}, {94208, 6136, &rule14},- {100352, 1238, &rule14},- {101632, 9, &rule14},+ {100352, 755, &rule14}, {110592, 287, &rule14}, {110928, 3, &rule14}, {110948, 4, &rule14},@@ -3651,7 +3609,8 @@ {127169, 15, &rule13}, {127185, 37, &rule13}, {127232, 13, &rule17},- {127245, 161, &rule13},+ {127248, 93, &rule13},+ {127344, 61, &rule13}, {127462, 29, &rule13}, {127504, 44, &rule13}, {127552, 9, &rule13},@@ -3659,9 +3618,9 @@ {127584, 6, &rule13}, {127744, 251, &rule13}, {127995, 5, &rule10},- {128000, 728, &rule13},+ {128000, 726, &rule13}, {128736, 13, &rule13},- {128752, 13, &rule13},+ {128752, 11, &rule13}, {128768, 116, &rule13}, {128896, 89, &rule13}, {128992, 12, &rule13},@@ -3670,28 +3629,24 @@ {129104, 10, &rule13}, {129120, 40, &rule13}, {129168, 30, &rule13},- {129200, 2, &rule13},- {129280, 121, &rule13},- {129402, 82, &rule13},+ {129280, 12, &rule13},+ {129293, 101, &rule13},+ {129395, 4, &rule13},+ {129402, 41, &rule13},+ {129445, 6, &rule13},+ {129454, 29, &rule13}, {129485, 135, &rule13}, {129632, 14, &rule13},- {129648, 5, &rule13},+ {129648, 4, &rule13}, {129656, 3, &rule13},- {129664, 7, &rule13},- {129680, 25, &rule13},- {129712, 7, &rule13},- {129728, 3, &rule13},- {129744, 7, &rule13},- {129792, 147, &rule13},- {129940, 55, &rule13},- {130032, 10, &rule8},- {131072, 42718, &rule14},+ {129664, 3, &rule13},+ {129680, 6, &rule13},+ {131072, 42711, &rule14}, {173824, 4149, &rule14}, {177984, 222, &rule14}, {178208, 5762, &rule14}, {183984, 7473, &rule14}, {194560, 542, &rule14},- {196608, 4939, &rule14}, {917505, 1, &rule16}, {917536, 96, &rule16}, {917760, 240, &rule92},@@ -5009,12 +4964,6 @@ {42948, 1, &rule194}, {42949, 1, &rule195}, {42950, 1, &rule196},- {42951, 1, &rule22},- {42952, 1, &rule23},- {42953, 1, &rule22},- {42954, 1, &rule23},- {42997, 1, &rule22},- {42998, 1, &rule23}, {43859, 1, &rule197}, {43888, 80, &rule198}, {65313, 26, &rule9},
cbits/Win32Utils.c view
@@ -5,14 +5,21 @@ ------------------------------------------------------------------------- */ #if defined(_WIN32)+/* Use Mingw's C99 print functions. */+#define __USE_MINGW_ANSI_STDIO 1+/* Using Secure APIs */+#define MINGW_HAS_SECURE_API 1 #include "HsBase.h" #include <stdbool.h> #include <stdint.h>-/* Using Secure APIs */-#define MINGW_HAS_SECURE_API 1 #include <wchar.h> #include <windows.h>+#include <io.h>+#include <objbase.h>+#include <ntstatus.h>+#include <winternl.h>+#include "fs.h" /* This is the error table that defines the mapping between OS error codes and errno values */@@ -131,9 +138,8 @@ return what; } -int get_unique_file_info(int fd, HsWord64 *dev, HsWord64 *ino)+int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino) {- HANDLE h = (HANDLE)_get_osfhandle(fd); BY_HANDLE_FILE_INFORMATION info; if (GetFileInformationByHandle(h, &info))@@ -148,10 +154,98 @@ return -1; } +int get_unique_file_info(int fd, HsWord64 *dev, HsWord64 *ino)+{+ HANDLE h = (HANDLE)_get_osfhandle(fd);+ return get_unique_file_info_hwnd (h, dev, ino);+}+ BOOL file_exists(LPCTSTR path) { DWORD r = GetFileAttributes(path); return r != INVALID_FILE_ATTRIBUTES;+}++/* If true then caller needs to free tempFileName. */+bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix,+ wchar_t* suffix, wchar_t** tempFileName)+{+ *tempFileName = NULL;+ int retry = 5;+ bool success = false;+ while (retry-- > 0 && !success)+ {+ GUID guid;+ ZeroMemory (&guid, sizeof (guid));+ if (CoCreateGuid (&guid) != S_OK)+ goto fail;++ RPC_WSTR guidStr;+ if (UuidToStringW ((UUID*)&guid, &guidStr) != S_OK)+ goto fail;++ /* We can't create a device path here since this path escapes the compiler+ so instead return a normal path and have openFile deal with it. */+ wchar_t* devName = malloc (sizeof (wchar_t) * wcslen (pathName));+ wcscpy (devName, pathName);+ int len = wcslen (devName) + wcslen (suffix) + wcslen (prefix)+ + wcslen (guidStr) + 3;+ *tempFileName = malloc (len * sizeof (wchar_t));+ if (*tempFileName == NULL)+ goto fail;++ /* Only add a slash if path didn't already end in one, otherwise we create+ an invalid path. */+ bool slashed = devName[wcslen(devName)-1] == '\\';+ wchar_t* sep = slashed ? L"" : L"\\";+ if (-1 == swprintf_s (*tempFileName, len, L"%ls%ls%ls-%ls%ls",+ devName, sep, prefix, guidStr, suffix))+ goto fail;++ free (devName);+ RpcStringFreeW (&guidStr);+ /* This should never happen because GUIDs are unique. But in case hell+ froze over let's check anyway. */+ DWORD dwAttrib = GetFileAttributesW (*tempFileName);+ success = (dwAttrib == INVALID_FILE_ATTRIBUTES+ || (dwAttrib & FILE_ATTRIBUTE_DIRECTORY));+ if (!success)+ free (*tempFileName);+ }++ return success;++fail:+ if (*tempFileName != NULL) {+ free (*tempFileName);+ }+ maperrno();+ return false;+}+++/* Seems to be part of the Windows SDK so provide an inline definition for+ use and rename it so it doesn't conflict for people who do have the SDK. */++typedef struct _MY_PUBLIC_OBJECT_BASIC_INFORMATION {+ ULONG Attributes;+ ACCESS_MASK GrantedAccess;+ ULONG HandleCount;+ ULONG PointerCount;+ ULONG Reserved[10];+ } MY_PUBLIC_OBJECT_BASIC_INFORMATION, *PMY_PUBLIC_OBJECT_BASIC_INFORMATION;++ACCESS_MASK __get_handle_access_mask (HANDLE handle)+{+ MY_PUBLIC_OBJECT_BASIC_INFORMATION obi;+ if (STATUS_SUCCESS != NtQueryObject(handle, ObjectBasicInformation, &obi,+ sizeof(obi), NULL))+ {+ return obi.GrantedAccess;+ }++ maperrno();+ return 0; } bool getTempFileNameErrorNo (wchar_t* pathName, wchar_t* prefix,
cbits/consUtils.c view
@@ -1,4 +1,4 @@-/* +/* * (c) The University of Glasgow 2002 * * Win32 Console API support@@ -46,7 +46,7 @@ leave ECHO_INPUT enabled without also having LINE_INPUT, so we have to turn both off here. */ DWORD flgs = ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT;- + if ( (h = (HANDLE)_get_osfhandle(fd)) != INVALID_HANDLE_VALUE ) { if ( GetConsoleMode(h,&st) && SetConsoleMode(h, cooked ? (st | ENABLE_LINE_INPUT) : st & ~flgs) ) {@@ -62,9 +62,9 @@ HANDLE h; DWORD st; DWORD flgs = ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT;- + if ( (h = (HANDLE)_get_osfhandle(fd)) != INVALID_HANDLE_VALUE ) {- if ( GetConsoleMode(h,&st) && + if ( GetConsoleMode(h,&st) && SetConsoleMode(h,( on ? (st | flgs) : (st & ~ENABLE_ECHO_INPUT))) ) { return 0; }@@ -77,34 +77,12 @@ { HANDLE h; DWORD st;- + if ( (h = (HANDLE)_get_osfhandle(fd)) != INVALID_HANDLE_VALUE ) { if ( GetConsoleMode(h,&st) ) { return (st & ENABLE_ECHO_INPUT ? 1 : 0); } }- return -1;-}--int-flush_input_console__(int fd)-{- HANDLE h = (HANDLE)_get_osfhandle(fd);- - if ( h != INVALID_HANDLE_VALUE ) {- /* If the 'fd' isn't connected to a console; treat the flush- * operation as a NOP.- */- DWORD unused;- if ( !GetConsoleMode(h,&unused) &&- GetLastError() == ERROR_INVALID_HANDLE ) {- return 0;- }- if ( FlushConsoleInputBuffer(h) ) {- return 0;- }- }- /* ToDo: translate GetLastError() into something errno-friendly */ return -1; }
cbits/fs.c view
@@ -412,7 +412,7 @@ static __time64_t ftToPosix(FILETIME ft) {- // takes the last modified date+ /* takes the last modified date. */ LARGE_INTEGER date, adjust; date.HighPart = ft.dwHighDateTime; date.LowPart = ft.dwLowDateTime;
changelog.md view
@@ -1,24 +1,53 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) -## 4.14.3.0 *August 2021*+## 4.15.0.0 *January 2021* - * Bundled with GHC 8.10.5- - * Check the buffer size *before* calling the continuation in withEncodedCString (#20107)+ * Add `Functor`, `Applicative`, `Monad`, `MonadFix`, `Foldable`, `Traversable`,+ `Eq`, `Ord`, `Show`, `Read`, `Eq1`, `Ord1`, `Show1`, `Read1`, `Generic`,+ `Generic1`, and `Data` instances for `GHC.Tuple.Solo`. - * Pass -DLIBICONV_PLUG when building base library on FreeBSD (#19958)+ * `openFile` now calls the `open` system call with an `interruptible` FFI+ call, ensuring that the call can be interrupted with `SIGINT` on POSIX+ systems. -## 4.14.2.0 *June 2021*+ * Add `hGetContents'`, `getContents'`, and `readFile'` in `System.IO`:+ Strict IO variants of `hGetContents`, `getContents`, and `readFile`. - * Bundled with GHC 8.10.5+ * Add `singleton` function for `Data.List.NonEmpty`. - * Update Unicode class definitions to Unicode version 7.0+ * The planned deprecation of `Data.Monoid.First` and `Data.Monoid.Last`+ is scrapped due to difficulties with the suggested migration path. - * Inline mconcat (#17123)+ * `Data.Semigroup.Option` and the accompanying `option` function are+ deprecated and scheduled for removal in 4.16. - * Enable large-file support in `base`'s the OFD file locking- implementation, avoiding #17950.+ * Add `Generic` instances to `Fingerprint`, `GiveGCStats`, `GCFlags`,+ `ConcFlags`, `DebugFlags`, `CCFlags`, `DoHeapProfile`, `ProfFlags`,+ `DoTrace`, `TraceFlags`, `TickyFlags`, `ParFlags`, `RTSFlags`, `RTSStats`,+ `GCStats`, `ByteOrder`, `GeneralCategory`, `SrcLoc`+ + * Add rules `unpackUtf8`, `unpack-listUtf8` and `unpack-appendUtf8` to `GHC.Base`.+ They correspond to their ascii versions and hopefully make it easier+ for libraries to handle utf8 encoded strings efficiently. + * An issue with list fusion and `elem` was fixed. `elem` applied to known+ small lists will now compile to a simple case statement more often.++ * Add `MonadFix` and `MonadZip` instances for `Complex`++ * Add `Ix` instances for tuples of size 6 through 15+ + * Correct `Bounded` instance and remove `Enum` and `Integral` instances for+ `Data.Ord.Down`.++ * `Foreign.ForeignPtr.withForeignPtr` is now less aggressively optimised,+ avoiding the soundness issue reported in+ [#17760](https://gitlab.haskell.org/ghc/ghc/-/issues/17760) in exchange for+ a small amount more allocation. If your application regresses significantly+ *and* the continuation given to `withForeignPtr` will *not* provably+ diverge then the previous optimisation behavior can be recovered by instead+ using `GHC.ForeignPtr.unsafeWithForeignPtr`.+ ## 4.14.1.0 *Jul 2020* * Bundled with GHC 8.10.2@@ -26,7 +55,6 @@ * Fix a precision issue in `log1mexp` (#17125) ## 4.14.0.0 *Jan 2020*- * Bundled with GHC 8.10.1 * Add a `TestEquality` instance for the `Compose` newtype.
config.guess view
@@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2021-05-24'+timestamp='2021-01-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by@@ -136,7 +136,7 @@ UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown -case $UNAME_SYSTEM in+case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) LIBC=unknown @@ -176,7 +176,7 @@ # Note: order is significant - the case branches are not exclusive. -case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,@@ -192,7 +192,7 @@ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown))- case $UNAME_MACHINE_ARCH in+ case "$UNAME_MACHINE_ARCH" in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;;@@ -208,7 +208,7 @@ esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI.- case $UNAME_MACHINE_ARCH in+ case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;;@@ -229,7 +229,7 @@ ;; esac # Determine ABI tags.- case $UNAME_MACHINE_ARCH in+ case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")@@ -240,7 +240,7 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu.- case $UNAME_VERSION in+ case "$UNAME_VERSION" in Debian*) release='-gnu' ;;@@ -261,10 +261,6 @@ UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;;- *:SecBSD:*:*)- UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//')- echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE"- exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"@@ -300,8 +296,6 @@ echo mips-dec-osf1 exit ;; alpha:OSF1:*:*)- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.- trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')@@ -315,7 +309,7 @@ # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)- case $ALPHA_CPU_TYPE in+ case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)")@@ -353,7 +347,10 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"- exit ;;+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.+ exitcode=$?+ trap '' 0+ exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;;@@ -434,7 +431,7 @@ echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*)- case $(/usr/bin/arch -k) in+ case "$(/usr/bin/arch -k)" in Series*|S4*) UNAME_RELEASE=$(uname -v) ;;@@ -448,7 +445,7 @@ sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3- case $(/bin/arch) in+ case "$(/bin/arch)" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;;@@ -664,18 +661,18 @@ exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')- case $UNAME_MACHINE in+ case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)- case $sc_cpu_version in+ case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0- case $sc_kernel_bits in+ case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20@@ -876,7 +873,7 @@ exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=$(/usr/bin/uname -p)- case $UNAME_PROCESSOR in+ case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386)@@ -900,7 +897,7 @@ echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*)- case $UNAME_MACHINE in+ case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;;@@ -952,7 +949,7 @@ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;;- arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)+ arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*)@@ -1437,9 +1434,10 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems.- if test "${cputype-}" = 386; then+ # shellcheck disable=SC2154+ if test "$cputype" = 386; then UNAME_MACHINE=i386- elif test "x${cputype-}" != x; then+ else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9@@ -1470,7 +1468,7 @@ exit ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null)- case $UNAME_MACHINE in+ case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;;@@ -1637,7 +1635,7 @@ echo "$0: unable to guess system type" >&2 -case $UNAME_MACHINE:$UNAME_SYSTEM in+case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <<EOF
config.sub view
@@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2021-04-30'+timestamp='2021-01-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by@@ -1165,7 +1165,7 @@ | alphapca5[67] | alpha64pca5[67] \ | am33_2.0 \ | amdgcn \- | arc | arceb | arc64 \+ | arc | arceb \ | arm | arm[lb]e | arme[lb] | armv* \ | avr | avr32 \ | asmjs \@@ -1204,13 +1204,9 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \- | mipsisa32r3 | mipsisa32r3el \- | mipsisa32r5 | mipsisa32r5el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \- | mipsisa64r3 | mipsisa64r3el \- | mipsisa64r5 | mipsisa64r5el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \@@ -1711,12 +1707,12 @@ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | mirbsd* | netbsd* | dicos* | openedition* | ose* \- | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \- | chorusrdb* | cegcc* | glidix* | serenity* \+ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | mint* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
configure view
@@ -1,34001 +1,32943 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.71 for Haskell base package 1.0.-#-# Report bugs to <libraries@haskell.org>.-#-#-# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,-# Inc.-#-#-# This configure script is free software; the Free Software Foundation-# gives unlimited permission to copy, distribute and modify it.-## -------------------- ##-## M4sh Initialization. ##-## -------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-as_nop=:-if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1-then :- emulate sh- NULLCMD=:- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which- # is contrary to our usage. Disable this feature.- alias -g '${1+"$@"}'='"$@"'- setopt NO_GLOB_SUBST-else $as_nop- case `(set -o) 2>/dev/null` in #(- *posix*) :- set -o posix ;; #(- *) :- ;;-esac-fi----# Reset variables that may have inherited troublesome values from-# the environment.--# IFS needs to be set, to space, tab, and newline, in precisely that order.-# (If _AS_PATH_WALK were called with IFS unset, it would have the-# side effect of setting IFS to empty, thus disabling word splitting.)-# Quoting is to prevent editors from complaining about space-tab.-as_nl='-'-export as_nl-IFS=" "" $as_nl"--PS1='$ '-PS2='> '-PS4='+ '--# Ensure predictable behavior from utilities with locale-dependent output.-LC_ALL=C-export LC_ALL-LANGUAGE=C-export LANGUAGE--# We cannot yet rely on "unset" to work, but we need these variables-# to be unset--not just set to an empty or harmless value--now, to-# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct-# also avoids known problems related to "unset" and subshell syntax-# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).-for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH-do eval test \${$as_var+y} \- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :-done--# Ensure that fds 0, 1, and 2 are open.-if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi-if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi-if (exec 3>&2) ; then :; else exec 2>/dev/null; fi--# The user is always right.-if ${PATH_SEPARATOR+false} :; then- PATH_SEPARATOR=:- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||- PATH_SEPARATOR=';'- }-fi---# Find who we are. Look in the path if we contain no directory separator.-as_myself=-case $0 in #((- *[\\/]* ) as_myself=$0 ;;- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- test -r "$as_dir$0" && as_myself=$as_dir$0 && break- done-IFS=$as_save_IFS-- ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then- as_myself=$0-fi-if test ! -f "$as_myself"; then- printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2- exit 1-fi---# Use a proper internal environment variable to ensure we don't fall- # into an infinite loop, continuously re-executing ourselves.- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then- _as_can_reexec=no; export _as_can_reexec;- # We cannot yet assume a decent shell, so we have to provide a-# neutralization value for shells without unset; and this also-# works around shells that cannot unset nonexistent variables.-# Preserve -v and -x to the replacement shell.-BASH_ENV=/dev/null-ENV=/dev/null-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV-case $- in # ((((- *v*x* | *x*v* ) as_opts=-vx ;;- *v* ) as_opts=-v ;;- *x* ) as_opts=-x ;;- * ) as_opts= ;;-esac-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}-# Admittedly, this is quite paranoid, since all the known shells bail-# out after a failed `exec'.-printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2-exit 255- fi- # We don't want this to propagate to other subprocesses.- { _as_can_reexec=; unset _as_can_reexec;}-if test "x$CONFIG_SHELL" = x; then- as_bourne_compatible="as_nop=:-if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1-then :- emulate sh- NULLCMD=:- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which- # is contrary to our usage. Disable this feature.- alias -g '\${1+\"\$@\"}'='\"\$@\"'- setopt NO_GLOB_SUBST-else \$as_nop- case \`(set -o) 2>/dev/null\` in #(- *posix*) :- set -o posix ;; #(- *) :- ;;-esac-fi-"- as_required="as_fn_return () { (exit \$1); }-as_fn_success () { as_fn_return 0; }-as_fn_failure () { as_fn_return 1; }-as_fn_ret_success () { return 0; }-as_fn_ret_failure () { return 1; }--exitcode=0-as_fn_success || { exitcode=1; echo as_fn_success failed.; }-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }-if ( set x; as_fn_ret_success y && test x = \"\$1\" )-then :--else \$as_nop- exitcode=1; echo positional parameters were not saved.-fi-test x\$exitcode = x0 || exit 1-blah=\$(echo \$(echo blah))-test x\"\$blah\" = xblah || exit 1-test -x / || exit 1"- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1-test \$(( 1 + 1 )) = 2 || exit 1"- if (eval "$as_required") 2>/dev/null-then :- as_have_required=yes-else $as_nop- as_have_required=no-fi- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null-then :--else $as_nop- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-as_found=false-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- as_found=:- case $as_dir in #(- /*)- for as_base in sh bash ksh sh5; do- # Try only shells that exist, to save several forks.- as_shell=$as_dir$as_base- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&- as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null-then :- CONFIG_SHELL=$as_shell as_have_required=yes- if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null-then :- break 2-fi-fi- done;;- esac- as_found=false-done-IFS=$as_save_IFS-if $as_found-then :--else $as_nop- if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&- as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null-then :- CONFIG_SHELL=$SHELL as_have_required=yes-fi-fi--- if test "x$CONFIG_SHELL" != x-then :- export CONFIG_SHELL- # We cannot yet assume a decent shell, so we have to provide a-# neutralization value for shells without unset; and this also-# works around shells that cannot unset nonexistent variables.-# Preserve -v and -x to the replacement shell.-BASH_ENV=/dev/null-ENV=/dev/null-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV-case $- in # ((((- *v*x* | *x*v* ) as_opts=-vx ;;- *v* ) as_opts=-v ;;- *x* ) as_opts=-x ;;- * ) as_opts= ;;-esac-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}-# Admittedly, this is quite paranoid, since all the known shells bail-# out after a failed `exec'.-printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2-exit 255-fi-- if test x$as_have_required = xno-then :- printf "%s\n" "$0: This script requires a shell more modern than all"- printf "%s\n" "$0: the shells that I found on your system."- if test ${ZSH_VERSION+y} ; then- printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"- printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."- else- printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and-$0: libraries@haskell.org about your system, including any-$0: error possibly output before this message. Then install-$0: a modern shell, or manually run the script under such a-$0: shell if you do have one."- fi- exit 1-fi-fi-fi-SHELL=${CONFIG_SHELL-/bin/sh}-export SHELL-# Unset more variables known to interfere with behavior of common tools.-CLICOLOR_FORCE= GREP_OPTIONS=-unset CLICOLOR_FORCE GREP_OPTIONS--## --------------------- ##-## M4sh Shell Functions. ##-## --------------------- ##-# as_fn_unset VAR-# ----------------# Portably unset VAR.-as_fn_unset ()-{- { eval $1=; unset $1;}-}-as_unset=as_fn_unset---# as_fn_set_status STATUS-# ------------------------# Set $? to STATUS, without forking.-as_fn_set_status ()-{- return $1-} # as_fn_set_status--# as_fn_exit STATUS-# ------------------# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.-as_fn_exit ()-{- set +e- as_fn_set_status $1- exit $1-} # as_fn_exit-# as_fn_nop-# ----------# Do nothing but, unlike ":", preserve the value of $?.-as_fn_nop ()-{- return $?-}-as_nop=as_fn_nop--# as_fn_mkdir_p-# --------------# Create "$as_dir" as a directory, including parents if necessary.-as_fn_mkdir_p ()-{-- case $as_dir in #(- -*) as_dir=./$as_dir;;- esac- test -d "$as_dir" || eval $as_mkdir_p || {- as_dirs=- while :; do- case $as_dir in #(- *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(- *) as_qdir=$as_dir;;- esac- as_dirs="'$as_qdir' $as_dirs"- as_dir=`$as_dirname -- "$as_dir" ||-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \- X"$as_dir" : 'X\(//\)[^/]' \| \- X"$as_dir" : 'X\(//\)$' \| \- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X"$as_dir" |- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{- s//\1/- q- }- /^X\(\/\/\)[^/].*/{- s//\1/- q- }- /^X\(\/\/\)$/{- s//\1/- q- }- /^X\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`- test -d "$as_dir" && break- done- test -z "$as_dirs" || eval "mkdir $as_dirs"- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"---} # as_fn_mkdir_p--# as_fn_executable_p FILE-# ------------------------# Test if FILE is an executable regular file.-as_fn_executable_p ()-{- test -f "$1" && test -x "$1"-} # as_fn_executable_p-# as_fn_append VAR VALUE-# -----------------------# Append the text in VALUE to the end of the definition contained in VAR. Take-# advantage of any shell optimizations that allow amortized linear growth over-# repeated appends, instead of the typical quadratic growth present in naive-# implementations.-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null-then :- eval 'as_fn_append ()- {- eval $1+=\$2- }'-else $as_nop- as_fn_append ()- {- eval $1=\$$1\$2- }-fi # as_fn_append--# as_fn_arith ARG...-# -------------------# Perform arithmetic evaluation on the ARGs, and store the result in the-# global $as_val. Take advantage of shells that can avoid forks. The arguments-# must be portable across $(()) and expr.-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null-then :- eval 'as_fn_arith ()- {- as_val=$(( $* ))- }'-else $as_nop- as_fn_arith ()- {- as_val=`expr "$@" || test $? -eq 1`- }-fi # as_fn_arith--# as_fn_nop-# ----------# Do nothing but, unlike ":", preserve the value of $?.-as_fn_nop ()-{- return $?-}-as_nop=as_fn_nop--# as_fn_error STATUS ERROR [LINENO LOG_FD]-# -----------------------------------------# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the-# script with STATUS, using 1 if that was 0.-as_fn_error ()-{- as_status=$1; test $as_status -eq 0 && as_status=1- if test "$4"; then- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4- fi- printf "%s\n" "$as_me: error: $2" >&2- as_fn_exit $as_status-} # as_fn_error--if expr a : '\(a\)' >/dev/null 2>&1 &&- test "X`expr 00001 : '.*\(...\)'`" = X001; then- as_expr=expr-else- as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then- as_basename=basename-else- as_basename=false-fi--if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then- as_dirname=dirname-else- as_dirname=false-fi--as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \- X"$0" : 'X\(//\)$' \| \- X"$0" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X/"$0" |- sed '/^.*\/\([^/][^/]*\)\/*$/{- s//\1/- q- }- /^X\/\(\/\/\)$/{- s//\1/- q- }- /^X\/\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`--# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits--- as_lineno_1=$LINENO as_lineno_1a=$LINENO- as_lineno_2=$LINENO as_lineno_2a=$LINENO- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)- sed -n '- p- /[$]LINENO/=- ' <$as_myself |- sed '- s/[$]LINENO.*/&-/- t lineno- b- :lineno- N- :loop- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/- t loop- s/-\n.*//- ' >$as_me.lineno &&- chmod +x "$as_me.lineno" ||- { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }-- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have- # already done that, so ensure we don't try to do so again and fall- # in an infinite loop. This has already happened in practice.- _as_can_reexec=no; export _as_can_reexec- # Don't try to exec as it changes $[0], causing all sort of problems- # (the dirname of $[0] is not the place where we might find the- # original and so on. Autoconf is especially sensitive to this).- . "./$as_me.lineno"- # Exit status is that of the last command.- exit-}---# Determine whether it's possible to make 'echo' print without a newline.-# These variables are no longer used directly by Autoconf, but are AC_SUBSTed-# for compatibility with existing Makefiles.-ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in #(((((--n*)- case `echo 'xy\c'` in- *c*) ECHO_T=' ';; # ECHO_T is single tab character.- xy) ECHO_C='\c';;- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null- ECHO_T=' ';;- esac;;-*)- ECHO_N='-n';;-esac--# For backward compatibility with old third-party macros, we provide-# the shell variables $as_echo and $as_echo_n. New code should use-# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.-as_echo='printf %s\n'-as_echo_n='printf %s'---rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then- rm -f conf$$.dir/conf$$.file-else- rm -f conf$$.dir- mkdir conf$$.dir 2>/dev/null-fi-if (echo >conf$$.file) 2>/dev/null; then- if ln -s conf$$.file conf$$ 2>/dev/null; then- as_ln_s='ln -s'- # ... but there are two gotchas:- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.- # In both cases, we have to default to `cp -pR'.- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||- as_ln_s='cp -pR'- elif ln conf$$.file conf$$ 2>/dev/null; then- as_ln_s=ln- else- as_ln_s='cp -pR'- fi-else- as_ln_s='cp -pR'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null--if mkdir -p . 2>/dev/null; then- as_mkdir_p='mkdir -p "$as_dir"'-else- test -d ./-p && rmdir ./-p- as_mkdir_p=false-fi--as_test_x='test -x'-as_executable_p=as_fn_executable_p--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"---test -n "$DJDIR" || exec 7<&0 </dev/null-exec 6>&1--# Name of the host.-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,-# so uname gets run too.-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`--#-# Initializations.-#-ac_default_prefix=/usr/local-ac_clean_files=-ac_config_libobj_dir=.-LIBOBJS=-cross_compiling=no-subdirs=-MFLAGS=-MAKEFLAGS=--# Identity of this package.-PACKAGE_NAME='Haskell base package'-PACKAGE_TARNAME='base'-PACKAGE_VERSION='1.0'-PACKAGE_STRING='Haskell base package 1.0'-PACKAGE_BUGREPORT='libraries@haskell.org'-PACKAGE_URL=''--ac_unique_file="include/HsBase.h"-# Factoring default headers for most tests.-ac_includes_default="\-#include <stddef.h>-#ifdef HAVE_STDIO_H-# include <stdio.h>-#endif-#ifdef HAVE_STDLIB_H-# include <stdlib.h>-#endif-#ifdef HAVE_STRING_H-# include <string.h>-#endif-#ifdef HAVE_INTTYPES_H-# include <inttypes.h>-#endif-#ifdef HAVE_STDINT_H-# include <stdint.h>-#endif-#ifdef HAVE_STRINGS_H-# include <strings.h>-#endif-#ifdef HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif-#ifdef HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif-#ifdef HAVE_UNISTD_H-# include <unistd.h>-#endif"--ac_header_c_list=-ac_subst_vars='LTLIBOBJS-LIBOBJS-EXTRA_LIBS-ICONV_LIB_DIRS-ICONV_INCLUDE_DIRS-EGREP-GREP-CPP-OBJEXT-EXEEXT-ac_ct_CC-CPPFLAGS-LDFLAGS-CFLAGS-CC-target_alias-host_alias-build_alias-LIBS-ECHO_T-ECHO_N-ECHO_C-DEFS-mandir-localedir-libdir-psdir-pdfdir-dvidir-htmldir-infodir-docdir-oldincludedir-includedir-runstatedir-localstatedir-sharedstatedir-sysconfdir-datadir-datarootdir-libexecdir-sbindir-bindir-program_transform_name-prefix-exec_prefix-PACKAGE_URL-PACKAGE_BUGREPORT-PACKAGE_STRING-PACKAGE_VERSION-PACKAGE_TARNAME-PACKAGE_NAME-PATH_SEPARATOR-SHELL'-ac_subst_files=''-ac_user_opts='-enable_option_checking-enable_largefile-with_iconv_includes-with_iconv_libraries-with_libcharset-'- ac_precious_vars='build_alias-host_alias-target_alias-CC-CFLAGS-LDFLAGS-LIBS-CPPFLAGS-CPP'---# Initialize some variables set by options.-ac_init_help=-ac_init_version=false-ac_unrecognized_opts=-ac_unrecognized_sep=-# The variables have the same names as the options, with-# dashes changed to underlines.-cache_file=/dev/null-exec_prefix=NONE-no_create=-no_recursion=-prefix=NONE-program_prefix=NONE-program_suffix=NONE-program_transform_name=s,x,x,-silent=-site=-srcdir=-verbose=-x_includes=NONE-x_libraries=NONE--# Installation directory options.-# These are left unexpanded so users can "make install exec_prefix=/foo"-# and all the variables that are supposed to be based on exec_prefix-# by default will actually change.-# Use braces instead of parens because sh, perl, etc. also accept them.-# (The list follows the same order as the GNU Coding Standards.)-bindir='${exec_prefix}/bin'-sbindir='${exec_prefix}/sbin'-libexecdir='${exec_prefix}/libexec'-datarootdir='${prefix}/share'-datadir='${datarootdir}'-sysconfdir='${prefix}/etc'-sharedstatedir='${prefix}/com'-localstatedir='${prefix}/var'-runstatedir='${localstatedir}/run'-includedir='${prefix}/include'-oldincludedir='/usr/include'-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'-infodir='${datarootdir}/info'-htmldir='${docdir}'-dvidir='${docdir}'-pdfdir='${docdir}'-psdir='${docdir}'-libdir='${exec_prefix}/lib'-localedir='${datarootdir}/locale'-mandir='${datarootdir}/man'--ac_prev=-ac_dashdash=-for ac_option-do- # If the previous option needs an argument, assign it.- if test -n "$ac_prev"; then- eval $ac_prev=\$ac_option- ac_prev=- continue- fi-- case $ac_option in- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;- *=) ac_optarg= ;;- *) ac_optarg=yes ;;- esac-- case $ac_dashdash$ac_option in- --)- ac_dashdash=yes ;;-- -bindir | --bindir | --bindi | --bind | --bin | --bi)- ac_prev=bindir ;;- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)- bindir=$ac_optarg ;;-- -build | --build | --buil | --bui | --bu)- ac_prev=build_alias ;;- -build=* | --build=* | --buil=* | --bui=* | --bu=*)- build_alias=$ac_optarg ;;-- -cache-file | --cache-file | --cache-fil | --cache-fi \- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)- ac_prev=cache_file ;;- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)- cache_file=$ac_optarg ;;-- --config-cache | -C)- cache_file=config.cache ;;-- -datadir | --datadir | --datadi | --datad)- ac_prev=datadir ;;- -datadir=* | --datadir=* | --datadi=* | --datad=*)- datadir=$ac_optarg ;;-- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \- | --dataroo | --dataro | --datar)- ac_prev=datarootdir ;;- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)- datarootdir=$ac_optarg ;;-- -disable-* | --disable-*)- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`- # Reject names that are not valid shell variable names.- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&- as_fn_error $? "invalid feature name: \`$ac_useropt'"- ac_useropt_orig=$ac_useropt- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`- case $ac_user_opts in- *"-"enable_$ac_useropt"-"*) ;;- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"- ac_unrecognized_sep=', ';;- esac- eval enable_$ac_useropt=no ;;-- -docdir | --docdir | --docdi | --doc | --do)- ac_prev=docdir ;;- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)- docdir=$ac_optarg ;;-- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)- ac_prev=dvidir ;;- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)- dvidir=$ac_optarg ;;-- -enable-* | --enable-*)- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`- # Reject names that are not valid shell variable names.- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&- as_fn_error $? "invalid feature name: \`$ac_useropt'"- ac_useropt_orig=$ac_useropt- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`- case $ac_user_opts in- *"-"enable_$ac_useropt"-"*) ;;- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"- ac_unrecognized_sep=', ';;- esac- eval enable_$ac_useropt=\$ac_optarg ;;-- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \- | --exec | --exe | --ex)- ac_prev=exec_prefix ;;- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \- | --exec=* | --exe=* | --ex=*)- exec_prefix=$ac_optarg ;;-- -gas | --gas | --ga | --g)- # Obsolete; use --with-gas.- with_gas=yes ;;-- -help | --help | --hel | --he | -h)- ac_init_help=long ;;- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)- ac_init_help=recursive ;;- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)- ac_init_help=short ;;-- -host | --host | --hos | --ho)- ac_prev=host_alias ;;- -host=* | --host=* | --hos=* | --ho=*)- host_alias=$ac_optarg ;;-- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)- ac_prev=htmldir ;;- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \- | --ht=*)- htmldir=$ac_optarg ;;-- -includedir | --includedir | --includedi | --included | --include \- | --includ | --inclu | --incl | --inc)- ac_prev=includedir ;;- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \- | --includ=* | --inclu=* | --incl=* | --inc=*)- includedir=$ac_optarg ;;-- -infodir | --infodir | --infodi | --infod | --info | --inf)- ac_prev=infodir ;;- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)- infodir=$ac_optarg ;;-- -libdir | --libdir | --libdi | --libd)- ac_prev=libdir ;;- -libdir=* | --libdir=* | --libdi=* | --libd=*)- libdir=$ac_optarg ;;-- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \- | --libexe | --libex | --libe)- ac_prev=libexecdir ;;- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \- | --libexe=* | --libex=* | --libe=*)- libexecdir=$ac_optarg ;;-- -localedir | --localedir | --localedi | --localed | --locale)- ac_prev=localedir ;;- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)- localedir=$ac_optarg ;;-- -localstatedir | --localstatedir | --localstatedi | --localstated \- | --localstate | --localstat | --localsta | --localst | --locals)- ac_prev=localstatedir ;;- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)- localstatedir=$ac_optarg ;;-- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)- ac_prev=mandir ;;- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)- mandir=$ac_optarg ;;-- -nfp | --nfp | --nf)- # Obsolete; use --without-fp.- with_fp=no ;;-- -no-create | --no-create | --no-creat | --no-crea | --no-cre \- | --no-cr | --no-c | -n)- no_create=yes ;;-- -no-recursion | --no-recursion | --no-recursio | --no-recursi \- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)- no_recursion=yes ;;-- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \- | --oldin | --oldi | --old | --ol | --o)- ac_prev=oldincludedir ;;- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)- oldincludedir=$ac_optarg ;;-- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)- ac_prev=prefix ;;- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)- prefix=$ac_optarg ;;-- -program-prefix | --program-prefix | --program-prefi | --program-pref \- | --program-pre | --program-pr | --program-p)- ac_prev=program_prefix ;;- -program-prefix=* | --program-prefix=* | --program-prefi=* \- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)- program_prefix=$ac_optarg ;;-- -program-suffix | --program-suffix | --program-suffi | --program-suff \- | --program-suf | --program-su | --program-s)- ac_prev=program_suffix ;;- -program-suffix=* | --program-suffix=* | --program-suffi=* \- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)- program_suffix=$ac_optarg ;;-- -program-transform-name | --program-transform-name \- | --program-transform-nam | --program-transform-na \- | --program-transform-n | --program-transform- \- | --program-transform | --program-transfor \- | --program-transfo | --program-transf \- | --program-trans | --program-tran \- | --progr-tra | --program-tr | --program-t)- ac_prev=program_transform_name ;;- -program-transform-name=* | --program-transform-name=* \- | --program-transform-nam=* | --program-transform-na=* \- | --program-transform-n=* | --program-transform-=* \- | --program-transform=* | --program-transfor=* \- | --program-transfo=* | --program-transf=* \- | --program-trans=* | --program-tran=* \- | --progr-tra=* | --program-tr=* | --program-t=*)- program_transform_name=$ac_optarg ;;-- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)- ac_prev=pdfdir ;;- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)- pdfdir=$ac_optarg ;;-- -psdir | --psdir | --psdi | --psd | --ps)- ac_prev=psdir ;;- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)- psdir=$ac_optarg ;;-- -q | -quiet | --quiet | --quie | --qui | --qu | --q \- | -silent | --silent | --silen | --sile | --sil)- silent=yes ;;-- -runstatedir | --runstatedir | --runstatedi | --runstated \- | --runstate | --runstat | --runsta | --runst | --runs \- | --run | --ru | --r)- ac_prev=runstatedir ;;- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \- | --run=* | --ru=* | --r=*)- runstatedir=$ac_optarg ;;-- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)- ac_prev=sbindir ;;- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \- | --sbi=* | --sb=*)- sbindir=$ac_optarg ;;-- -sharedstatedir | --sharedstatedir | --sharedstatedi \- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \- | --sharedst | --shareds | --shared | --share | --shar \- | --sha | --sh)- ac_prev=sharedstatedir ;;- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \- | --sha=* | --sh=*)- sharedstatedir=$ac_optarg ;;-- -site | --site | --sit)- ac_prev=site ;;- -site=* | --site=* | --sit=*)- site=$ac_optarg ;;-- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)- ac_prev=srcdir ;;- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)- srcdir=$ac_optarg ;;-- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \- | --syscon | --sysco | --sysc | --sys | --sy)- ac_prev=sysconfdir ;;- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)- sysconfdir=$ac_optarg ;;-- -target | --target | --targe | --targ | --tar | --ta | --t)- ac_prev=target_alias ;;- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)- target_alias=$ac_optarg ;;-- -v | -verbose | --verbose | --verbos | --verbo | --verb)- verbose=yes ;;-- -version | --version | --versio | --versi | --vers | -V)- ac_init_version=: ;;-- -with-* | --with-*)- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`- # Reject names that are not valid shell variable names.- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&- as_fn_error $? "invalid package name: \`$ac_useropt'"- ac_useropt_orig=$ac_useropt- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`- case $ac_user_opts in- *"-"with_$ac_useropt"-"*) ;;- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"- ac_unrecognized_sep=', ';;- esac- eval with_$ac_useropt=\$ac_optarg ;;-- -without-* | --without-*)- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`- # Reject names that are not valid shell variable names.- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&- as_fn_error $? "invalid package name: \`$ac_useropt'"- ac_useropt_orig=$ac_useropt- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`- case $ac_user_opts in- *"-"with_$ac_useropt"-"*) ;;- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"- ac_unrecognized_sep=', ';;- esac- eval with_$ac_useropt=no ;;-- --x)- # Obsolete; use --with-x.- with_x=yes ;;-- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \- | --x-incl | --x-inc | --x-in | --x-i)- ac_prev=x_includes ;;- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)- x_includes=$ac_optarg ;;-- -x-libraries | --x-libraries | --x-librarie | --x-librari \- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)- ac_prev=x_libraries ;;- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)- x_libraries=$ac_optarg ;;-- -*) as_fn_error $? "unrecognized option: \`$ac_option'-Try \`$0 --help' for more information"- ;;-- *=*)- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`- # Reject names that are not valid shell variable names.- case $ac_envvar in #(- '' | [0-9]* | *[!_$as_cr_alnum]* )- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;- esac- eval $ac_envvar=\$ac_optarg- export $ac_envvar ;;-- *)- # FIXME: should be removed in autoconf 3.0.- printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&- printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"- ;;-- esac-done--if test -n "$ac_prev"; then- ac_option=--`echo $ac_prev | sed 's/_/-/g'`- as_fn_error $? "missing argument to $ac_option"-fi--if test -n "$ac_unrecognized_opts"; then- case $enable_option_checking in- no) ;;- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;- *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;- esac-fi--# Check all directory arguments for consistency.-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \- datadir sysconfdir sharedstatedir localstatedir includedir \- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \- libdir localedir mandir runstatedir-do- eval ac_val=\$$ac_var- # Remove trailing slashes.- case $ac_val in- */ )- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`- eval $ac_var=\$ac_val;;- esac- # Be sure to have absolute directory names.- case $ac_val in- [\\/$]* | ?:[\\/]* ) continue;;- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;- esac- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"-done--# There might be people who depend on the old broken behavior: `$host'-# used to hold the argument of --host etc.-# FIXME: To remove some day.-build=$build_alias-host=$host_alias-target=$target_alias--# FIXME: To remove some day.-if test "x$host_alias" != x; then- if test "x$build_alias" = x; then- cross_compiling=maybe- elif test "x$build_alias" != "x$host_alias"; then- cross_compiling=yes- fi-fi--ac_tool_prefix=-test -n "$host_alias" && ac_tool_prefix=$host_alias---test "$silent" = yes && exec 6>/dev/null---ac_pwd=`pwd` && test -n "$ac_pwd" &&-ac_ls_di=`ls -di .` &&-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||- as_fn_error $? "working directory cannot be determined"-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||- as_fn_error $? "pwd does not report name of working directory"---# Find the source files, if location was not specified.-if test -z "$srcdir"; then- ac_srcdir_defaulted=yes- # Try the directory containing this script, then the parent directory.- ac_confdir=`$as_dirname -- "$as_myself" ||-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \- X"$as_myself" : 'X\(//\)[^/]' \| \- X"$as_myself" : 'X\(//\)$' \| \- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X"$as_myself" |- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{- s//\1/- q- }- /^X\(\/\/\)[^/].*/{- s//\1/- q- }- /^X\(\/\/\)$/{- s//\1/- q- }- /^X\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`- srcdir=$ac_confdir- if test ! -r "$srcdir/$ac_unique_file"; then- srcdir=..- fi-else- ac_srcdir_defaulted=no-fi-if test ! -r "$srcdir/$ac_unique_file"; then- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"-fi-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"-ac_abs_confdir=`(- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"- pwd)`-# When building in place, set srcdir=.-if test "$ac_abs_confdir" = "$ac_pwd"; then- srcdir=.-fi-# Remove unnecessary trailing slashes from srcdir.-# Double slashes in file names in object file debugging info-# mess up M-x gdb in Emacs.-case $srcdir in-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;-esac-for ac_var in $ac_precious_vars; do- eval ac_env_${ac_var}_set=\${${ac_var}+set}- eval ac_env_${ac_var}_value=\$${ac_var}- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}- eval ac_cv_env_${ac_var}_value=\$${ac_var}-done--#-# Report the --help message.-#-if test "$ac_init_help" = "long"; then- # Omit some internal or obsolete options to make the list less imposing.- # This message is too long to be a string in the A/UX 3.1 sh.- cat <<_ACEOF-\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.--Usage: $0 [OPTION]... [VAR=VALUE]...--To assign environment variables (e.g., CC, CFLAGS...), specify them as-VAR=VALUE. See below for descriptions of some of the useful variables.--Defaults for the options are specified in brackets.--Configuration:- -h, --help display this help and exit- --help=short display options specific to this package- --help=recursive display the short help of all the included packages- -V, --version display version information and exit- -q, --quiet, --silent do not print \`checking ...' messages- --cache-file=FILE cache test results in FILE [disabled]- -C, --config-cache alias for \`--cache-file=config.cache'- -n, --no-create do not create output files- --srcdir=DIR find the sources in DIR [configure dir or \`..']--Installation directories:- --prefix=PREFIX install architecture-independent files in PREFIX- [$ac_default_prefix]- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX- [PREFIX]--By default, \`make install' will install all the files in-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify-an installation prefix other than \`$ac_default_prefix' using \`--prefix',-for instance \`--prefix=\$HOME'.--For better control, use the options below.--Fine tuning of the installation directories:- --bindir=DIR user executables [EPREFIX/bin]- --sbindir=DIR system admin executables [EPREFIX/sbin]- --libexecdir=DIR program executables [EPREFIX/libexec]- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]- --localstatedir=DIR modifiable single-machine data [PREFIX/var]- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]- --libdir=DIR object code libraries [EPREFIX/lib]- --includedir=DIR C header files [PREFIX/include]- --oldincludedir=DIR C header files for non-gcc [/usr/include]- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]- --infodir=DIR info documentation [DATAROOTDIR/info]- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]- --mandir=DIR man documentation [DATAROOTDIR/man]- --docdir=DIR documentation root [DATAROOTDIR/doc/base]- --htmldir=DIR html documentation [DOCDIR]- --dvidir=DIR dvi documentation [DOCDIR]- --pdfdir=DIR pdf documentation [DOCDIR]- --psdir=DIR ps documentation [DOCDIR]-_ACEOF-- cat <<\_ACEOF-_ACEOF-fi--if test -n "$ac_init_help"; then- case $ac_init_help in- short | recursive ) echo "Configuration of Haskell base package 1.0:";;- esac- cat <<\_ACEOF--Optional Features:- --disable-option-checking ignore unrecognized --enable/--with options- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]- --disable-largefile omit support for large files--Optional Packages:- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)- --with-iconv-includes directory containing iconv.h- --with-iconv-libraries directory containing iconv library- --with-libcharset Use libcharset [default=only if available]--Some influential environment variables:- CC C compiler command- CFLAGS C compiler flags- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a- nonstandard directory <lib dir>- LIBS libraries to pass to the linker, e.g. -l<library>- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if- you have headers in a nonstandard directory <include dir>- CPP C preprocessor--Use these variables to override the choices made by `configure' or to help-it to find libraries and programs with nonstandard names/locations.--Report bugs to <libraries@haskell.org>.-_ACEOF-ac_status=$?-fi--if test "$ac_init_help" = "recursive"; then- # If there are subdirs, report their specific --help.- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue- test -d "$ac_dir" ||- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||- continue- ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)- ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`- # A ".." for each directory in $ac_dir_suffix.- ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`- case $ac_top_builddir_sub in- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;- esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in- .) # We are building in place.- ac_srcdir=.- ac_top_srcdir=$ac_top_builddir_sub- ac_abs_top_srcdir=$ac_pwd ;;- [\\/]* | ?:[\\/]* ) # Absolute name.- ac_srcdir=$srcdir$ac_dir_suffix;- ac_top_srcdir=$srcdir- ac_abs_top_srcdir=$srcdir ;;- *) # Relative name.- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix- ac_top_srcdir=$ac_top_build_prefix$srcdir- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix-- cd "$ac_dir" || { ac_status=$?; continue; }- # Check for configure.gnu first; this name is used for a wrapper for- # Metaconfig's "Configure" on case-insensitive file systems.- if test -f "$ac_srcdir/configure.gnu"; then- echo &&- $SHELL "$ac_srcdir/configure.gnu" --help=recursive- elif test -f "$ac_srcdir/configure"; then- echo &&- $SHELL "$ac_srcdir/configure" --help=recursive- else- printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2- fi || ac_status=$?- cd "$ac_pwd" || { ac_status=$?; break; }- done-fi--test -n "$ac_init_help" && exit $ac_status-if $ac_init_version; then- cat <<\_ACEOF-Haskell base package configure 1.0-generated by GNU Autoconf 2.71--Copyright (C) 2021 Free Software Foundation, Inc.-This configure script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it.-_ACEOF- exit-fi--## ------------------------ ##-## Autoconf initialization. ##-## ------------------------ ##--# ac_fn_c_try_compile LINENO-# ---------------------------# Try to compile conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_compile ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- rm -f conftest.$ac_objext conftest.beam- if { { ac_try="$ac_compile"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_compile") 2>conftest.err- ac_status=$?- if test -s conftest.err; then- grep -v '^ *+' conftest.err >conftest.er1- cat conftest.er1 >&5- mv -f conftest.er1 conftest.err- fi- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; } && {- test -z "$ac_c_werror_flag" ||- test ! -s conftest.err- } && test -s conftest.$ac_objext-then :- ac_retval=0-else $as_nop- printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5-- ac_retval=1-fi- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno- as_fn_set_status $ac_retval--} # ac_fn_c_try_compile--# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES-# --------------------------------------------------------# Tests whether HEADER exists and can be compiled using the include files in-# INCLUDES, setting the cache variable VAR accordingly.-ac_fn_c_check_header_compile ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-printf %s "checking for $2... " >&6; }-if eval test \${$3+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-#include <$2>-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- eval "$3=yes"-else $as_nop- eval "$3=no"-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-eval ac_res=\$$3- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno--} # ac_fn_c_check_header_compile--# ac_fn_c_check_type LINENO TYPE VAR INCLUDES-# --------------------------------------------# Tests whether TYPE exists after having included INCLUDES, setting cache-# variable VAR accordingly.-ac_fn_c_check_type ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-printf %s "checking for $2... " >&6; }-if eval test \${$3+y}-then :- printf %s "(cached) " >&6-else $as_nop- eval "$3=no"- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-if (sizeof ($2))- return 0;- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-if (sizeof (($2)))- return 0;- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :--else $as_nop- eval "$3=yes"-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-eval ac_res=\$$3- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno--} # ac_fn_c_check_type--# ac_fn_c_try_link LINENO-# ------------------------# Try to link conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_link ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext- if { { ac_try="$ac_link"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_link") 2>conftest.err- ac_status=$?- if test -s conftest.err; then- grep -v '^ *+' conftest.err >conftest.er1- cat conftest.er1 >&5- mv -f conftest.er1 conftest.err- fi- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; } && {- test -z "$ac_c_werror_flag" ||- test ! -s conftest.err- } && test -s conftest$ac_exeext && {- test "$cross_compiling" = yes ||- test -x conftest$ac_exeext- }-then :- ac_retval=0-else $as_nop- printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5-- ac_retval=1-fi- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would- # interfere with the next link command; also delete a directory that is- # left behind by Apple's compiler. We do this before executing the actions.- rm -rf conftest.dSYM conftest_ipa8_conftest.oo- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno- as_fn_set_status $ac_retval--} # ac_fn_c_try_link--# ac_fn_c_check_func LINENO FUNC VAR-# -----------------------------------# Tests whether FUNC exists, setting the cache variable VAR accordingly-ac_fn_c_check_func ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5-printf %s "checking for $2... " >&6; }-if eval test \${$3+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.- For example, HP-UX 11i <limits.h> declares gettimeofday. */-#define $2 innocuous_$2--/* System header to define __stub macros and hopefully few prototypes,- which can conflict with char $2 (); below. */--#include <limits.h>-#undef $2--/* Override any GCC internal prototype to avoid an error.- Use char because int might match the return type of a GCC- builtin and then its argument prototype would still apply. */-#ifdef __cplusplus-extern "C"-#endif-char $2 ();-/* The GNU C library defines this for functions which it implements- to always fail with ENOSYS. Some functions are actually named- something starting with __ and the normal name is an alias. */-#if defined __stub_$2 || defined __stub___$2-choke me-#endif--int-main (void)-{-return $2 ();- ;- return 0;-}-_ACEOF-if ac_fn_c_try_link "$LINENO"-then :- eval "$3=yes"-else $as_nop- eval "$3=no"-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam \- conftest$ac_exeext conftest.$ac_ext-fi-eval ac_res=\$$3- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno--} # ac_fn_c_check_func--# ac_fn_c_try_run LINENO-# -----------------------# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that-# executables *can* be run.-ac_fn_c_try_run ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- if { { ac_try="$ac_link"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_link") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'- { { case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_try") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }; }-then :- ac_retval=0-else $as_nop- printf "%s\n" "$as_me: program exited with status $ac_status" >&5- printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5-- ac_retval=$ac_status-fi- rm -rf conftest.dSYM conftest_ipa8_conftest.oo- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno- as_fn_set_status $ac_retval--} # ac_fn_c_try_run--# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES-# ---------------------------------------------# Tries to find the compile-time value of EXPR in a program that includes-# INCLUDES, setting VAR accordingly. Returns whether the value could be-# computed-ac_fn_c_compute_int ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- if test "$cross_compiling" = yes; then- # Depending upon the size, compute the lo and hi bounds.-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-static int test_array [1 - 2 * !(($2) >= 0)];-test_array [0] = 0;-return test_array [0];-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_lo=0 ac_mid=0- while :; do- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-static int test_array [1 - 2 * !(($2) <= $ac_mid)];-test_array [0] = 0;-return test_array [0];-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_hi=$ac_mid; break-else $as_nop- as_fn_arith $ac_mid + 1 && ac_lo=$as_val- if test $ac_lo -le $ac_mid; then- ac_lo= ac_hi=- break- fi- as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- done-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-static int test_array [1 - 2 * !(($2) < 0)];-test_array [0] = 0;-return test_array [0];-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_hi=-1 ac_mid=-1- while :; do- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-static int test_array [1 - 2 * !(($2) >= $ac_mid)];-test_array [0] = 0;-return test_array [0];-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_lo=$ac_mid; break-else $as_nop- as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val- if test $ac_mid -le $ac_hi; then- ac_lo= ac_hi=- break- fi- as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- done-else $as_nop- ac_lo= ac_hi=-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-# Binary search between lo and hi bounds.-while test "x$ac_lo" != "x$ac_hi"; do- as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-static int test_array [1 - 2 * !(($2) <= $ac_mid)];-test_array [0] = 0;-return test_array [0];-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_hi=$ac_mid-else $as_nop- as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-done-case $ac_lo in #((-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;-'') ac_retval=1 ;;-esac- else- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-static long int longval (void) { return $2; }-static unsigned long int ulongval (void) { return $2; }-#include <stdio.h>-#include <stdlib.h>-int-main (void)-{-- FILE *f = fopen ("conftest.val", "w");- if (! f)- return 1;- if (($2) < 0)- {- long int i = longval ();- if (i != ($2))- return 1;- fprintf (f, "%ld", i);- }- else- {- unsigned long int i = ulongval ();- if (i != ($2))- return 1;- fprintf (f, "%lu", i);- }- /* Do not output a trailing newline, as this causes \r\n confusion- on some platforms. */- return ferror (f) || fclose (f) != 0;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_run "$LINENO"-then :- echo >>conftest.val; read $3 <conftest.val; ac_retval=0-else $as_nop- ac_retval=1-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \- conftest.$ac_objext conftest.beam conftest.$ac_ext-rm -f conftest.val-- fi- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno- as_fn_set_status $ac_retval--} # ac_fn_c_compute_int--# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR-# -------------------------------------------------------------------# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR-# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.-ac_fn_check_decl ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- as_decl_name=`echo $2|sed 's/ *(.*//'`- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5-printf %s "checking whether $as_decl_name is declared... " >&6; }-if eval test \${$3+y}-then :- printf %s "(cached) " >&6-else $as_nop- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`- eval ac_save_FLAGS=\$$6- as_fn_append $6 " $5"- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$4-int-main (void)-{-#ifndef $as_decl_name-#ifdef __cplusplus- (void) $as_decl_use;-#else- (void) $as_decl_name;-#endif-#endif-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- eval "$3=yes"-else $as_nop- eval "$3=no"-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- eval $6=\$ac_save_FLAGS--fi-eval ac_res=\$$3- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno--} # ac_fn_check_decl--# ac_fn_c_try_cpp LINENO-# -----------------------# Try to preprocess conftest.$ac_ext, and return whether this succeeded.-ac_fn_c_try_cpp ()-{- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- if { { ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err- ac_status=$?- if test -s conftest.err; then- grep -v '^ *+' conftest.err >conftest.er1- cat conftest.er1 >&5- mv -f conftest.er1 conftest.err- fi- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; } > conftest.i && {- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||- test ! -s conftest.err- }-then :- ac_retval=0-else $as_nop- printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5-- ac_retval=1-fi- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno- as_fn_set_status $ac_retval--} # ac_fn_c_try_cpp-ac_configure_args_raw=-for ac_arg-do- case $ac_arg in- *\'*)- ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;- esac- as_fn_append ac_configure_args_raw " '$ac_arg'"-done--case $ac_configure_args_raw in- *$as_nl*)- ac_safe_unquote= ;;- *)- ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.- ac_unsafe_a="$ac_unsafe_z#~"- ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"- ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;-esac--cat >config.log <<_ACEOF-This file contains any messages produced by compilers while-running configure, to aid debugging if configure makes a mistake.--It was created by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.71. Invocation command line was-- $ $0$ac_configure_args_raw--_ACEOF-exec 5>>config.log-{-cat <<_ASUNAME-## --------- ##-## Platform. ##-## --------- ##--hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`-uname -m = `(uname -m) 2>/dev/null || echo unknown`-uname -r = `(uname -r) 2>/dev/null || echo unknown`-uname -s = `(uname -s) 2>/dev/null || echo unknown`-uname -v = `(uname -v) 2>/dev/null || echo unknown`--/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`--/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`--_ASUNAME--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- printf "%s\n" "PATH: $as_dir"- done-IFS=$as_save_IFS--} >&5--cat >&5 <<_ACEOF---## ----------- ##-## Core tests. ##-## ----------- ##--_ACEOF---# Keep a trace of the command line.-# Strip out --no-create and --no-recursion so they do not pile up.-# Strip out --silent because we don't want to record it for future runs.-# Also quote any args containing shell meta-characters.-# Make two passes to allow for proper duplicate-argument suppression.-ac_configure_args=-ac_configure_args0=-ac_configure_args1=-ac_must_keep_next=false-for ac_pass in 1 2-do- for ac_arg- do- case $ac_arg in- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;- -q | -quiet | --quiet | --quie | --qui | --qu | --q \- | -silent | --silent | --silen | --sile | --sil)- continue ;;- *\'*)- ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;- esac- case $ac_pass in- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;- 2)- as_fn_append ac_configure_args1 " '$ac_arg'"- if test $ac_must_keep_next = true; then- ac_must_keep_next=false # Got value, back to normal.- else- case $ac_arg in- *=* | --config-cache | -C | -disable-* | --disable-* \- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \- | -with-* | --with-* | -without-* | --without-* | --x)- case "$ac_configure_args0 " in- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;- esac- ;;- -* ) ac_must_keep_next=true ;;- esac- fi- as_fn_append ac_configure_args " '$ac_arg'"- ;;- esac- done-done-{ ac_configure_args0=; unset ac_configure_args0;}-{ ac_configure_args1=; unset ac_configure_args1;}--# When interrupted or exit'd, cleanup temporary files, and complete-# config.log. We remove comments because anyway the quotes in there-# would cause problems or look ugly.-# WARNING: Use '\'' to represent an apostrophe within the trap.-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.-trap 'exit_status=$?- # Sanitize IFS.- IFS=" "" $as_nl"- # Save into config.log some information that might help in debugging.- {- echo-- printf "%s\n" "## ---------------- ##-## Cache variables. ##-## ---------------- ##"- echo- # The following way of writing the cache mishandles newlines in values,-(- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do- eval ac_val=\$$ac_var- case $ac_val in #(- *${as_nl}*)- case $ac_var in #(- *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5-printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;- esac- case $ac_var in #(- _ | IFS | as_nl) ;; #(- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(- *) { eval $ac_var=; unset $ac_var;} ;;- esac ;;- esac- done- (set) 2>&1 |- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(- *${as_nl}ac_space=\ *)- sed -n \- "s/'\''/'\''\\\\'\'''\''/g;- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"- ;; #(- *)- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"- ;;- esac |- sort-)- echo-- printf "%s\n" "## ----------------- ##-## Output variables. ##-## ----------------- ##"- echo- for ac_var in $ac_subst_vars- do- eval ac_val=\$$ac_var- case $ac_val in- *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;- esac- printf "%s\n" "$ac_var='\''$ac_val'\''"- done | sort- echo-- if test -n "$ac_subst_files"; then- printf "%s\n" "## ------------------- ##-## File substitutions. ##-## ------------------- ##"- echo- for ac_var in $ac_subst_files- do- eval ac_val=\$$ac_var- case $ac_val in- *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;- esac- printf "%s\n" "$ac_var='\''$ac_val'\''"- done | sort- echo- fi-- if test -s confdefs.h; then- printf "%s\n" "## ----------- ##-## confdefs.h. ##-## ----------- ##"- echo- cat confdefs.h- echo- fi- test "$ac_signal" != 0 &&- printf "%s\n" "$as_me: caught signal $ac_signal"- printf "%s\n" "$as_me: exit $exit_status"- } >&5- rm -f core *.core core.conftest.* &&- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&- exit $exit_status-' 0-for ac_signal in 1 2 13 15; do- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal-done-ac_signal=0--# confdefs.h avoids OS command line length limits that DEFS can exceed.-rm -f -r conftest* confdefs.h--printf "%s\n" "/* confdefs.h */" > confdefs.h--# Predefined preprocessor variables.--printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h--printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h--printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h--printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h--printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h--printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h---# Let the site file select an alternate cache file if it wants to.-# Prefer an explicitly selected file to automatically selected ones.-if test -n "$CONFIG_SITE"; then- ac_site_files="$CONFIG_SITE"-elif test "x$prefix" != xNONE; then- ac_site_files="$prefix/share/config.site $prefix/etc/config.site"-else- ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"-fi--for ac_site_file in $ac_site_files-do- case $ac_site_file in #(- */*) :- ;; #(- *) :- ac_site_file=./$ac_site_file ;;-esac- if test -f "$ac_site_file" && test -r "$ac_site_file"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5-printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}- sed 's/^/| /' "$ac_site_file" >&5- . "$ac_site_file" \- || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "failed to load site script $ac_site_file-See \`config.log' for more details" "$LINENO" 5; }- fi-done--if test -r "$cache_file"; then- # Some versions of bash will fail to source /dev/null (special files- # actually), so we avoid doing that. DJGPP emulates it as a regular file.- if test /dev/null != "$cache_file" && test -f "$cache_file"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5-printf "%s\n" "$as_me: loading cache $cache_file" >&6;}- case $cache_file in- [\\/]* | ?:[\\/]* ) . "$cache_file";;- *) . "./$cache_file";;- esac- fi-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5-printf "%s\n" "$as_me: creating cache $cache_file" >&6;}- >$cache_file-fi--# Test code for whether the C compiler supports C89 (global declarations)-ac_c_conftest_c89_globals='-/* Does the compiler advertise C89 conformance?- Do not test the value of __STDC__, because some compilers set it to 0- while being otherwise adequately conformant. */-#if !defined __STDC__-# error "Compiler does not advertise C89 conformance"-#endif--#include <stddef.h>-#include <stdarg.h>-struct stat;-/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */-struct buf { int x; };-struct buf * (*rcsopen) (struct buf *, struct stat *, int);-static char *e (p, i)- char **p;- int i;-{- return p[i];-}-static char *f (char * (*g) (char **, int), char **p, ...)-{- char *s;- va_list v;- va_start (v,p);- s = g (p, va_arg (v,int));- va_end (v);- return s;-}--/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has- function prototypes and stuff, but not \xHH hex character constants.- These do not provoke an error unfortunately, instead are silently treated- as an "x". The following induces an error, until -std is added to get- proper ANSI mode. Curiously \x00 != x always comes out true, for an- array size at least. It is necessary to write \x00 == 0 to get something- that is true only with -std. */-int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];--/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters- inside strings and character constants. */-#define FOO(x) '\''x'\''-int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];--int test (int i, double x);-struct s1 {int (*f) (int a);};-struct s2 {int (*f) (double a);};-int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),- int, int);'--# Test code for whether the C compiler supports C89 (body of main).-ac_c_conftest_c89_main='-ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);-'--# Test code for whether the C compiler supports C99 (global declarations)-ac_c_conftest_c99_globals='-// Does the compiler advertise C99 conformance?-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L-# error "Compiler does not advertise C99 conformance"-#endif--#include <stdbool.h>-extern int puts (const char *);-extern int printf (const char *, ...);-extern int dprintf (int, const char *, ...);-extern void *malloc (size_t);--// Check varargs macros. These examples are taken from C99 6.10.3.5.-// dprintf is used instead of fprintf to avoid needing to declare-// FILE and stderr.-#define debug(...) dprintf (2, __VA_ARGS__)-#define showlist(...) puts (#__VA_ARGS__)-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))-static void-test_varargs_macros (void)-{- int x = 1234;- int y = 5678;- debug ("Flag");- debug ("X = %d\n", x);- showlist (The first, second, and third items.);- report (x>y, "x is %d but y is %d", x, y);-}--// Check long long types.-#define BIG64 18446744073709551615ull-#define BIG32 4294967295ul-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)-#if !BIG_OK- #error "your preprocessor is broken"-#endif-#if BIG_OK-#else- #error "your preprocessor is broken"-#endif-static long long int bignum = -9223372036854775807LL;-static unsigned long long int ubignum = BIG64;--struct incomplete_array-{- int datasize;- double data[];-};--struct named_init {- int number;- const wchar_t *name;- double average;-};--typedef const char *ccp;--static inline int-test_restrict (ccp restrict text)-{- // See if C++-style comments work.- // Iterate through items via the restricted pointer.- // Also check for declarations in for loops.- for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)- continue;- return 0;-}--// Check varargs and va_copy.-static bool-test_varargs (const char *format, ...)-{- va_list args;- va_start (args, format);- va_list args_copy;- va_copy (args_copy, args);-- const char *str = "";- int number = 0;- float fnumber = 0;-- while (*format)- {- switch (*format++)- {- case '\''s'\'': // string- str = va_arg (args_copy, const char *);- break;- case '\''d'\'': // int- number = va_arg (args_copy, int);- break;- case '\''f'\'': // float- fnumber = va_arg (args_copy, double);- break;- default:- break;- }- }- va_end (args_copy);- va_end (args);-- return *str && number && fnumber;-}-'--# Test code for whether the C compiler supports C99 (body of main).-ac_c_conftest_c99_main='- // Check bool.- _Bool success = false;- success |= (argc != 0);-- // Check restrict.- if (test_restrict ("String literal") == 0)- success = true;- char *restrict newvar = "Another string";-- // Check varargs.- success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);- test_varargs_macros ();-- // Check flexible array members.- struct incomplete_array *ia =- malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));- ia->datasize = 10;- for (int i = 0; i < ia->datasize; ++i)- ia->data[i] = i * 1.234;-- // Check named initializers.- struct named_init ni = {- .number = 34,- .name = L"Test wide string",- .average = 543.34343,- };-- ni.number = 58;-- int dynamic_array[ni.number];- dynamic_array[0] = argv[0][0];- dynamic_array[ni.number - 1] = 543;-- // work around unused variable warnings- ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''- || dynamic_array[ni.number - 1] != 543);-'--# Test code for whether the C compiler supports C11 (global declarations)-ac_c_conftest_c11_globals='-// Does the compiler advertise C11 conformance?-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L-# error "Compiler does not advertise C11 conformance"-#endif--// Check _Alignas.-char _Alignas (double) aligned_as_double;-char _Alignas (0) no_special_alignment;-extern char aligned_as_int;-char _Alignas (0) _Alignas (int) aligned_as_int;--// Check _Alignof.-enum-{- int_alignment = _Alignof (int),- int_array_alignment = _Alignof (int[100]),- char_alignment = _Alignof (char)-};-_Static_assert (0 < -_Alignof (int), "_Alignof is signed");--// Check _Noreturn.-int _Noreturn does_not_return (void) { for (;;) continue; }--// Check _Static_assert.-struct test_static_assert-{- int x;- _Static_assert (sizeof (int) <= sizeof (long int),- "_Static_assert does not work in struct");- long int y;-};--// Check UTF-8 literals.-#define u8 syntax error!-char const utf8_literal[] = u8"happens to be ASCII" "another string";--// Check duplicate typedefs.-typedef long *long_ptr;-typedef long int *long_ptr;-typedef long_ptr long_ptr;--// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.-struct anonymous-{- union {- struct { int i; int j; };- struct { int k; long int l; } w;- };- int m;-} v1;-'--# Test code for whether the C compiler supports C11 (body of main).-ac_c_conftest_c11_main='- _Static_assert ((offsetof (struct anonymous, i)- == offsetof (struct anonymous, w.k)),- "Anonymous union alignment botch");- v1.i = 2;- v1.w.k = 5;- ok |= v1.i != 5;-'--# Test code for whether the C compiler supports C11 (complete).-ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}-${ac_c_conftest_c99_globals}-${ac_c_conftest_c11_globals}--int-main (int argc, char **argv)-{- int ok = 0;- ${ac_c_conftest_c89_main}- ${ac_c_conftest_c99_main}- ${ac_c_conftest_c11_main}- return ok;-}-"--# Test code for whether the C compiler supports C99 (complete).-ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}-${ac_c_conftest_c99_globals}--int-main (int argc, char **argv)-{- int ok = 0;- ${ac_c_conftest_c89_main}- ${ac_c_conftest_c99_main}- return ok;-}-"--# Test code for whether the C compiler supports C89 (complete).-ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}--int-main (int argc, char **argv)-{- int ok = 0;- ${ac_c_conftest_c89_main}- return ok;-}-"--as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"-as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"-as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"-as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"-as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"-as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"-as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"-as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"-as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"-as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H"-as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H"-# Check that the precious variables saved in the cache have kept the same-# value.-ac_cache_corrupted=false-for ac_var in $ac_precious_vars; do- eval ac_old_set=\$ac_cv_env_${ac_var}_set- eval ac_new_set=\$ac_env_${ac_var}_set- eval ac_old_val=\$ac_cv_env_${ac_var}_value- eval ac_new_val=\$ac_env_${ac_var}_value- case $ac_old_set,$ac_new_set in- set,)- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5-printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}- ac_cache_corrupted=: ;;- ,set)- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5-printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}- ac_cache_corrupted=: ;;- ,);;- *)- if test "x$ac_old_val" != "x$ac_new_val"; then- # differences in whitespace do not lead to failure.- ac_old_val_w=`echo x $ac_old_val`- ac_new_val_w=`echo x $ac_new_val`- if test "$ac_old_val_w" != "$ac_new_val_w"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5-printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}- ac_cache_corrupted=:- else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5-printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}- eval $ac_var=\$ac_old_val- fi- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5-printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5-printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}- fi;;- esac- # Pass precious variables to config.status.- if test "$ac_new_set" = set; then- case $ac_new_val in- *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;- *) ac_arg=$ac_var=$ac_new_val ;;- esac- case " $ac_configure_args " in- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.- *) as_fn_append ac_configure_args " '$ac_arg'" ;;- esac- fi-done-if $ac_cache_corrupted; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5-printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}- as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'- and start over" "$LINENO" 5-fi-## -------------------- ##-## Main body of script. ##-## -------------------- ##--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu----# Safety check: Ensure that we are in the correct source directory.---ac_config_headers="$ac_config_headers include/HsBaseConfig.h include/EventConfig.h"------------ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-if test -n "$ac_tool_prefix"; then- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.-set dummy ${ac_tool_prefix}gcc; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$CC"; then- ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_CC="${ac_tool_prefix}gcc"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-printf "%s\n" "$CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi---fi-if test -z "$ac_cv_prog_CC"; then- ac_ct_CC=$CC- # Extract the first word of "gcc", so it can be a program name with args.-set dummy gcc; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_ac_ct_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$ac_ct_CC"; then- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_ac_ct_CC="gcc"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5-printf "%s\n" "$ac_ct_CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi-- if test "x$ac_ct_CC" = x; then- CC=""- else- case $cross_compiling:$ac_tool_warned in-yes:)-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}-ac_tool_warned=yes ;;-esac- CC=$ac_ct_CC- fi-else- CC="$ac_cv_prog_CC"-fi--if test -z "$CC"; then- if test -n "$ac_tool_prefix"; then- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.-set dummy ${ac_tool_prefix}cc; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$CC"; then- ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_CC="${ac_tool_prefix}cc"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-printf "%s\n" "$CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi--- fi-fi-if test -z "$CC"; then- # Extract the first word of "cc", so it can be a program name with args.-set dummy cc; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$CC"; then- ac_cv_prog_CC="$CC" # Let the user override the test.-else- ac_prog_rejected=no-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then- ac_prog_rejected=yes- continue- fi- ac_cv_prog_CC="cc"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--if test $ac_prog_rejected = yes; then- # We found a bogon in the path, so make sure we never use it.- set dummy $ac_cv_prog_CC- shift- if test $# != 0; then- # We chose a different compiler from the bogus one.- # However, it has the same basename, so the bogon will be chosen- # first if we set CC to just the basename; use the full file name.- shift- ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"- fi-fi-fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-printf "%s\n" "$CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi---fi-if test -z "$CC"; then- if test -n "$ac_tool_prefix"; then- for ac_prog in cl.exe- do- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.-set dummy $ac_tool_prefix$ac_prog; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$CC"; then- ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-printf "%s\n" "$CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi--- test -n "$CC" && break- done-fi-if test -z "$CC"; then- ac_ct_CC=$CC- for ac_prog in cl.exe-do- # Extract the first word of "$ac_prog", so it can be a program name with args.-set dummy $ac_prog; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_ac_ct_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$ac_ct_CC"; then- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_ac_ct_CC="$ac_prog"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5-printf "%s\n" "$ac_ct_CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi--- test -n "$ac_ct_CC" && break-done-- if test "x$ac_ct_CC" = x; then- CC=""- else- case $cross_compiling:$ac_tool_warned in-yes:)-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}-ac_tool_warned=yes ;;-esac- CC=$ac_ct_CC- fi-fi--fi-if test -z "$CC"; then- if test -n "$ac_tool_prefix"; then- # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.-set dummy ${ac_tool_prefix}clang; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$CC"; then- ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_CC="${ac_tool_prefix}clang"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5-printf "%s\n" "$CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi---fi-if test -z "$ac_cv_prog_CC"; then- ac_ct_CC=$CC- # Extract the first word of "clang", so it can be a program name with args.-set dummy clang; ac_word=$2-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-printf %s "checking for $ac_word... " >&6; }-if test ${ac_cv_prog_ac_ct_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -n "$ac_ct_CC"; then- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then- ac_cv_prog_ac_ct_CC="clang"- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5-printf "%s\n" "$ac_ct_CC" >&6; }-else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-fi-- if test "x$ac_ct_CC" = x; then- CC=""- else- case $cross_compiling:$ac_tool_warned in-yes:)-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}-ac_tool_warned=yes ;;-esac- CC=$ac_ct_CC- fi-else- CC="$ac_cv_prog_CC"-fi--fi---test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "no acceptable C compiler found in \$PATH-See \`config.log' for more details" "$LINENO" 5; }--# Provide some information about the compiler.-printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5-set X $ac_compile-ac_compiler=$2-for ac_option in --version -v -V -qversion -version; do- { { ac_try="$ac_compiler $ac_option >&5"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_compiler $ac_option >&5") 2>conftest.err- ac_status=$?- if test -s conftest.err; then- sed '10a\-... rest of stderr output deleted ...- 10q' conftest.err >conftest.er1- cat conftest.er1 >&5- fi- rm -f conftest.er1 conftest.err- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }-done--cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-- ;- return 0;-}-_ACEOF-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"-# Try to create an executable without -o first, disregard a.out.-# It will help us diagnose broken compilers, and finding out an intuition-# of exeext.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5-printf %s "checking whether the C compiler works... " >&6; }-ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`--# The possible output files:-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"--ac_rmfiles=-for ac_file in $ac_files-do- case $ac_file in- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;- * ) ac_rmfiles="$ac_rmfiles $ac_file";;- esac-done-rm -f $ac_rmfiles--if { { ac_try="$ac_link_default"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_link_default") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }-then :- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'-# in a Makefile. We should not override ac_cv_exeext if it was cached,-# so that the user can short-circuit this test for compilers unknown to-# Autoconf.-for ac_file in $ac_files ''-do- test -f "$ac_file" || continue- case $ac_file in- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )- ;;- [ab].out )- # We found the default executable, but exeext='' is most- # certainly right.- break;;- *.* )- if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;- then :; else- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`- fi- # We set ac_cv_exeext here because the later test for it is not- # safe: cross compilers may not add the suffix if given an `-o'- # argument, so we may need to know it at that point already.- # Even if this section looks crufty: it has the advantage of- # actually working.- break;;- * )- break;;- esac-done-test "$ac_cv_exeext" = no && ac_cv_exeext=--else $as_nop- ac_file=''-fi-if test -z "$ac_file"-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5-printf "%s\n" "no" >&6; }-printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "C compiler cannot create executables-See \`config.log' for more details" "$LINENO" 5; }-else $as_nop- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5-printf "%s\n" "yes" >&6; }-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5-printf %s "checking for C compiler default output file name... " >&6; }-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5-printf "%s\n" "$ac_file" >&6; }-ac_exeext=$ac_cv_exeext--rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out-ac_clean_files=$ac_clean_files_save-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5-printf %s "checking for suffix of executables... " >&6; }-if { { ac_try="$ac_link"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_link") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }-then :- # If both `conftest.exe' and `conftest' are `present' (well, observable)-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will-# work properly (i.e., refer to `conftest.exe'), while it won't with-# `rm'.-for ac_file in conftest.exe conftest conftest.*; do- test -f "$ac_file" || continue- case $ac_file in- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`- break;;- * ) break;;- esac-done-else $as_nop- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot compute suffix of executables: cannot compile and link-See \`config.log' for more details" "$LINENO" 5; }-fi-rm -f conftest conftest$ac_cv_exeext-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5-printf "%s\n" "$ac_cv_exeext" >&6; }--rm -f conftest.$ac_ext-EXEEXT=$ac_cv_exeext-ac_exeext=$EXEEXT-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <stdio.h>-int-main (void)-{-FILE *f = fopen ("conftest.out", "w");- return ferror (f) || fclose (f) != 0;-- ;- return 0;-}-_ACEOF-ac_clean_files="$ac_clean_files conftest.out"-# Check that the compiler produces executables we can run. If not, either-# the compiler is broken, or we cross compile.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5-printf %s "checking whether we are cross compiling... " >&6; }-if test "$cross_compiling" != yes; then- { { ac_try="$ac_link"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_link") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }- if { ac_try='./conftest$ac_cv_exeext'- { { case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_try") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }; }; then- cross_compiling=no- else- if test "$cross_compiling" = maybe; then- cross_compiling=yes- else- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot run C compiled programs.-If you meant to cross compile, use \`--host'.-See \`config.log' for more details" "$LINENO" 5; }- fi- fi-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5-printf "%s\n" "$cross_compiling" >&6; }--rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out-ac_clean_files=$ac_clean_files_save-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5-printf %s "checking for suffix of object files... " >&6; }-if test ${ac_cv_objext+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-- ;- return 0;-}-_ACEOF-rm -f conftest.o conftest.obj-if { { ac_try="$ac_compile"-case "(($ac_try" in- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;- *) ac_try_echo=$ac_try;;-esac-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""-printf "%s\n" "$ac_try_echo"; } >&5- (eval "$ac_compile") 2>&5- ac_status=$?- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5- test $ac_status = 0; }-then :- for ac_file in conftest.o conftest.obj conftest.*; do- test -f "$ac_file" || continue;- case $ac_file in- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`- break;;- esac-done-else $as_nop- printf "%s\n" "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot compute suffix of object files: cannot compile-See \`config.log' for more details" "$LINENO" 5; }-fi-rm -f conftest.$ac_cv_objext conftest.$ac_ext-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5-printf "%s\n" "$ac_cv_objext" >&6; }-OBJEXT=$ac_cv_objext-ac_objext=$OBJEXT-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5-printf %s "checking whether the compiler supports GNU C... " >&6; }-if test ${ac_cv_c_compiler_gnu+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-#ifndef __GNUC__- choke me-#endif-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_compiler_gnu=yes-else $as_nop- ac_compiler_gnu=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-ac_cv_c_compiler_gnu=$ac_compiler_gnu--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5-printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }-ac_compiler_gnu=$ac_cv_c_compiler_gnu--if test $ac_compiler_gnu = yes; then- GCC=yes-else- GCC=-fi-ac_test_CFLAGS=${CFLAGS+y}-ac_save_CFLAGS=$CFLAGS-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5-printf %s "checking whether $CC accepts -g... " >&6; }-if test ${ac_cv_prog_cc_g+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_save_c_werror_flag=$ac_c_werror_flag- ac_c_werror_flag=yes- ac_cv_prog_cc_g=no- CFLAGS="-g"- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_prog_cc_g=yes-else $as_nop- CFLAGS=""- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :--else $as_nop- ac_c_werror_flag=$ac_save_c_werror_flag- CFLAGS="-g"- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_prog_cc_g=yes-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- ac_c_werror_flag=$ac_save_c_werror_flag-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5-printf "%s\n" "$ac_cv_prog_cc_g" >&6; }-if test $ac_test_CFLAGS; then- CFLAGS=$ac_save_CFLAGS-elif test $ac_cv_prog_cc_g = yes; then- if test "$GCC" = yes; then- CFLAGS="-g -O2"- else- CFLAGS="-g"- fi-else- if test "$GCC" = yes; then- CFLAGS="-O2"- else- CFLAGS=- fi-fi-ac_prog_cc_stdc=no-if test x$ac_prog_cc_stdc = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5-printf %s "checking for $CC option to enable C11 features... " >&6; }-if test ${ac_cv_prog_cc_c11+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_cv_prog_cc_c11=no-ac_save_CC=$CC-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$ac_c_conftest_c11_program-_ACEOF-for ac_arg in '' -std=gnu11-do- CC="$ac_save_CC $ac_arg"- if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_prog_cc_c11=$ac_arg-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam- test "x$ac_cv_prog_cc_c11" != "xno" && break-done-rm -f conftest.$ac_ext-CC=$ac_save_CC-fi--if test "x$ac_cv_prog_cc_c11" = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5-printf "%s\n" "unsupported" >&6; }-else $as_nop- if test "x$ac_cv_prog_cc_c11" = x-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5-printf "%s\n" "none needed" >&6; }-else $as_nop- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5-printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }- CC="$CC $ac_cv_prog_cc_c11"-fi- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11- ac_prog_cc_stdc=c11-fi-fi-if test x$ac_prog_cc_stdc = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5-printf %s "checking for $CC option to enable C99 features... " >&6; }-if test ${ac_cv_prog_cc_c99+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_cv_prog_cc_c99=no-ac_save_CC=$CC-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$ac_c_conftest_c99_program-_ACEOF-for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=-do- CC="$ac_save_CC $ac_arg"- if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_prog_cc_c99=$ac_arg-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam- test "x$ac_cv_prog_cc_c99" != "xno" && break-done-rm -f conftest.$ac_ext-CC=$ac_save_CC-fi--if test "x$ac_cv_prog_cc_c99" = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5-printf "%s\n" "unsupported" >&6; }-else $as_nop- if test "x$ac_cv_prog_cc_c99" = x-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5-printf "%s\n" "none needed" >&6; }-else $as_nop- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5-printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }- CC="$CC $ac_cv_prog_cc_c99"-fi- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99- ac_prog_cc_stdc=c99-fi-fi-if test x$ac_prog_cc_stdc = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5-printf %s "checking for $CC option to enable C89 features... " >&6; }-if test ${ac_cv_prog_cc_c89+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_cv_prog_cc_c89=no-ac_save_CC=$CC-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-$ac_c_conftest_c89_program-_ACEOF-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"-do- CC="$ac_save_CC $ac_arg"- if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_prog_cc_c89=$ac_arg-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam- test "x$ac_cv_prog_cc_c89" != "xno" && break-done-rm -f conftest.$ac_ext-CC=$ac_save_CC-fi--if test "x$ac_cv_prog_cc_c89" = xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5-printf "%s\n" "unsupported" >&6; }-else $as_nop- if test "x$ac_cv_prog_cc_c89" = x-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5-printf "%s\n" "none needed" >&6; }-else $as_nop- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5-printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }- CC="$CC $ac_cv_prog_cc_c89"-fi- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89- ac_prog_cc_stdc=c89-fi-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---ac_header= ac_cache=-for ac_item in $ac_header_c_list-do- if test $ac_cache; then- ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"- if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then- printf "%s\n" "#define $ac_item 1" >> confdefs.h- fi- ac_header= ac_cache=- elif test $ac_header; then- ac_cache=$ac_item- else- ac_header=$ac_item- fi-done---------if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes-then :--printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h--fi------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5-printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; }-if test ${ac_cv_safe_to_define___extensions__+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--# define __EXTENSIONS__ 1- $ac_includes_default-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_safe_to_define___extensions__=yes-else $as_nop- ac_cv_safe_to_define___extensions__=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5-printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; }-- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5-printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; }-if test ${ac_cv_should_define__xopen_source+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_cv_should_define__xopen_source=no- if test $ac_cv_header_wchar_h = yes-then :- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-- #include <wchar.h>- mbstate_t x;-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :--else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-- #define _XOPEN_SOURCE 500- #include <wchar.h>- mbstate_t x;-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_should_define__xopen_source=yes-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5-printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; }-- printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h-- printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h-- printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h-- printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h-- if test $ac_cv_header_minix_config_h = yes-then :- MINIX=yes- printf "%s\n" "#define _MINIX 1" >>confdefs.h-- printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h-- printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h--else $as_nop- MINIX=-fi- if test $ac_cv_safe_to_define___extensions__ = yes-then :- printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h--fi- if test $ac_cv_should_define__xopen_source = yes-then :- printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h--fi---{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for WINDOWS platform" >&5-printf %s "checking for WINDOWS platform... " >&6; }-case $host_alias in- *mingw32*|*mingw64*|*cygwin*|*msys*)- WINDOWS=YES;;- *)- WINDOWS=NO;;-esac-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WINDOWS" >&5-printf "%s\n" "$WINDOWS" >&6; }--# do we have long longs?-ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"-if test "x$ac_cv_type_long_long" = xyes-then :--printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h---fi---# check for specific header (.h) files that we are interested in-ac_fn_c_check_header_compile "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default"-if test "x$ac_cv_header_ctype_h" = xyes-then :- printf "%s\n" "#define HAVE_CTYPE_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"-if test "x$ac_cv_header_errno_h" = xyes-then :- printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default"-if test "x$ac_cv_header_fcntl_h" = xyes-then :- printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"-if test "x$ac_cv_header_inttypes_h" = xyes-then :- printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default"-if test "x$ac_cv_header_limits_h" = xyes-then :- printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default"-if test "x$ac_cv_header_signal_h" = xyes-then :- printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_file_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_resource_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_select_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_stat_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_syscall_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_time_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_timeb_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_TIMEB_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/timers.h" "ac_cv_header_sys_timers_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_timers_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_TIMERS_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_times_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_types_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_utsname_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_wait_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"-if test "x$ac_cv_header_termios_h" = xyes-then :- printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default"-if test "x$ac_cv_header_time_h" = xyes-then :- printf "%s\n" "#define HAVE_TIME_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"-if test "x$ac_cv_header_unistd_h" = xyes-then :- printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default"-if test "x$ac_cv_header_utime_h" = xyes-then :- printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"-if test "x$ac_cv_header_windows_h" = xyes-then :- printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default"-if test "x$ac_cv_header_winsock_h" = xyes-then :- printf "%s\n" "#define HAVE_WINSOCK_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default"-if test "x$ac_cv_header_langinfo_h" = xyes-then :- printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default"-if test "x$ac_cv_header_poll_h" = xyes-then :- printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_epoll_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_event_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_eventfd_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h--fi-ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"-if test "x$ac_cv_header_sys_socket_h" = xyes-then :- printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h--fi---# Enable large file support. Do this before testing the types ino_t, off_t, and-# rlim_t, because it will affect the result of that test.-# Check whether --enable-largefile was given.-if test ${enable_largefile+y}-then :- enableval=$enable_largefile;-fi--if test "$enable_largefile" != no; then-- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5-printf %s "checking for special C compiler options needed for large files... " >&6; }-if test ${ac_cv_sys_largefile_CC+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_cv_sys_largefile_CC=no- if test "$GCC" != yes; then- ac_save_CC=$CC- while :; do- # IRIX 6.2 and later do not support large files by default,- # so use the C compiler's -n32 option if that helps.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.- We can't simply define LARGE_OFF_T to be 9223372036854775807,- since some C++ compilers masquerading as C compilers- incorrectly reject 9223372036854775807. */-#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721- && LARGE_OFF_T % 2147483647 == 1)- ? 1 : -1];-int-main (void)-{-- ;- return 0;-}-_ACEOF- if ac_fn_c_try_compile "$LINENO"-then :- break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam- CC="$CC -n32"- if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_sys_largefile_CC=' -n32'; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam- break- done- CC=$ac_save_CC- rm -f conftest.$ac_ext- fi-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5-printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; }- if test "$ac_cv_sys_largefile_CC" != no; then- CC=$CC$ac_cv_sys_largefile_CC- fi-- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5-printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }-if test ${ac_cv_sys_file_offset_bits+y}-then :- printf %s "(cached) " >&6-else $as_nop- while :; do- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.- We can't simply define LARGE_OFF_T to be 9223372036854775807,- since some C++ compilers masquerading as C compilers- incorrectly reject 9223372036854775807. */-#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721- && LARGE_OFF_T % 2147483647 == 1)- ? 1 : -1];-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_sys_file_offset_bits=no; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#define _FILE_OFFSET_BITS 64-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.- We can't simply define LARGE_OFF_T to be 9223372036854775807,- since some C++ compilers masquerading as C compilers- incorrectly reject 9223372036854775807. */-#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721- && LARGE_OFF_T % 2147483647 == 1)- ? 1 : -1];-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_sys_file_offset_bits=64; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- ac_cv_sys_file_offset_bits=unknown- break-done-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5-printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; }-case $ac_cv_sys_file_offset_bits in #(- no | unknown) ;;- *)-printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h-;;-esac-rm -rf conftest*- if test $ac_cv_sys_file_offset_bits = unknown; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5-printf %s "checking for _LARGE_FILES value needed for large files... " >&6; }-if test ${ac_cv_sys_large_files+y}-then :- printf %s "(cached) " >&6-else $as_nop- while :; do- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.- We can't simply define LARGE_OFF_T to be 9223372036854775807,- since some C++ compilers masquerading as C compilers- incorrectly reject 9223372036854775807. */-#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721- && LARGE_OFF_T % 2147483647 == 1)- ? 1 : -1];-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_sys_large_files=no; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#define _LARGE_FILES 1-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.- We can't simply define LARGE_OFF_T to be 9223372036854775807,- since some C++ compilers masquerading as C compilers- incorrectly reject 9223372036854775807. */-#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721- && LARGE_OFF_T % 2147483647 == 1)- ? 1 : -1];-int-main (void)-{-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- ac_cv_sys_large_files=1; break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- ac_cv_sys_large_files=unknown- break-done-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5-printf "%s\n" "$ac_cv_sys_large_files" >&6; }-case $ac_cv_sys_large_files in #(- no | unknown) ;;- *)-printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h-;;-esac-rm -rf conftest*- fi-fi--- for ac_header in wctype.h-do :- ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default"-if test "x$ac_cv_header_wctype_h" = xyes-then :- printf "%s\n" "#define HAVE_WCTYPE_H 1" >>confdefs.h- ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace"-if test "x$ac_cv_func_iswspace" = xyes-then :- printf "%s\n" "#define HAVE_ISWSPACE 1" >>confdefs.h--fi--fi--done--ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat"-if test "x$ac_cv_func_lstat" = xyes-then :- printf "%s\n" "#define HAVE_LSTAT 1" >>confdefs.h--fi--{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5-printf %s "checking for clock_gettime in -lrt... " >&6; }-if test ${ac_cv_lib_rt_clock_gettime+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_check_lib_save_LIBS=$LIBS-LIBS="-lrt $LIBS"-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--/* Override any GCC internal prototype to avoid an error.- Use char because int might match the return type of a GCC- builtin and then its argument prototype would still apply. */-char clock_gettime ();-int-main (void)-{-return clock_gettime ();- ;- return 0;-}-_ACEOF-if ac_fn_c_try_link "$LINENO"-then :- ac_cv_lib_rt_clock_gettime=yes-else $as_nop- ac_cv_lib_rt_clock_gettime=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam \- conftest$ac_exeext conftest.$ac_ext-LIBS=$ac_check_lib_save_LIBS-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5-printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; }-if test "x$ac_cv_lib_rt_clock_gettime" = xyes-then :- printf "%s\n" "#define HAVE_LIBRT 1" >>confdefs.h-- LIBS="-lrt $LIBS"--fi--ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"-if test "x$ac_cv_func_clock_gettime" = xyes-then :- printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h--fi--ac_fn_c_check_func "$LINENO" "getclock" "ac_cv_func_getclock"-if test "x$ac_cv_func_getclock" = xyes-then :- printf "%s\n" "#define HAVE_GETCLOCK 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"-if test "x$ac_cv_func_getrusage" = xyes-then :- printf "%s\n" "#define HAVE_GETRUSAGE 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times"-if test "x$ac_cv_func_times" = xyes-then :- printf "%s\n" "#define HAVE_TIMES 1" >>confdefs.h--fi--ac_fn_c_check_func "$LINENO" "_chsize" "ac_cv_func__chsize"-if test "x$ac_cv_func__chsize" = xyes-then :- printf "%s\n" "#define HAVE__CHSIZE 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate"-if test "x$ac_cv_func_ftruncate" = xyes-then :- printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h--fi---ac_fn_c_check_func "$LINENO" "epoll_ctl" "ac_cv_func_epoll_ctl"-if test "x$ac_cv_func_epoll_ctl" = xyes-then :- printf "%s\n" "#define HAVE_EPOLL_CTL 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "eventfd" "ac_cv_func_eventfd"-if test "x$ac_cv_func_eventfd" = xyes-then :- printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "kevent" "ac_cv_func_kevent"-if test "x$ac_cv_func_kevent" = xyes-then :- printf "%s\n" "#define HAVE_KEVENT 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "kevent64" "ac_cv_func_kevent64"-if test "x$ac_cv_func_kevent64" = xyes-then :- printf "%s\n" "#define HAVE_KEVENT64 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue"-if test "x$ac_cv_func_kqueue" = xyes-then :- printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h--fi-ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll"-if test "x$ac_cv_func_poll" = xyes-then :- printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h--fi---# event-related fun--if test "$ac_cv_header_sys_epoll_h" = yes && test "$ac_cv_func_epoll_ctl" = yes; then--printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h--fi--if test "$ac_cv_header_sys_event_h" = yes && test "$ac_cv_func_kqueue" = yes; then--printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h--- # The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of kev.filter" >&5-printf %s "checking size of kev.filter... " >&6; }-if test ${ac_cv_sizeof_kev_filter+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.filter))" "ac_cv_sizeof_kev_filter" "#include <sys/event.h>-struct kevent kev;-"-then :--else $as_nop- if test "$ac_cv_type_kev_filter" = yes; then- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (kev.filter)-See \`config.log' for more details" "$LINENO" 5; }- else- ac_cv_sizeof_kev_filter=0- fi-fi--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_filter" >&5-printf "%s\n" "$ac_cv_sizeof_kev_filter" >&6; }----printf "%s\n" "#define SIZEOF_KEV_FILTER $ac_cv_sizeof_kev_filter" >>confdefs.h---- # The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of kev.flags" >&5-printf %s "checking size of kev.flags... " >&6; }-if test ${ac_cv_sizeof_kev_flags+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.flags))" "ac_cv_sizeof_kev_flags" "#include <sys/event.h>-struct kevent kev;-"-then :--else $as_nop- if test "$ac_cv_type_kev_flags" = yes; then- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (kev.flags)-See \`config.log' for more details" "$LINENO" 5; }- else- ac_cv_sizeof_kev_flags=0- fi-fi--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_flags" >&5-printf "%s\n" "$ac_cv_sizeof_kev_flags" >&6; }----printf "%s\n" "#define SIZEOF_KEV_FLAGS $ac_cv_sizeof_kev_flags" >>confdefs.h---fi--if test "$ac_cv_header_poll_h" = yes && test "$ac_cv_func_poll" = yes; then--printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h--fi--# Linux open file descriptor locks-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5-printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }-if test ${ac_cv_c_undeclared_builtin_options+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_save_CFLAGS=$CFLAGS- ac_cv_c_undeclared_builtin_options='cannot detect'- for ac_arg in '' -fno-builtin; do- CFLAGS="$ac_save_CFLAGS $ac_arg"- # This test program should *not* compile successfully.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--int-main (void)-{-(void) strchr;- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :--else $as_nop- # This test program should compile successfully.- # No library function is consistently available on- # freestanding implementations, so test against a dummy- # declaration. Include always-available headers on the- # off chance that they somehow elicit warnings.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <float.h>-#include <limits.h>-#include <stdarg.h>-#include <stddef.h>-extern void ac_decl (int, char *);--int-main (void)-{-(void) ac_decl (0, (char *) 0);- (void) ac_decl;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- if test x"$ac_arg" = x-then :- ac_cv_c_undeclared_builtin_options='none needed'-else $as_nop- ac_cv_c_undeclared_builtin_options=$ac_arg-fi- break-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext- done- CFLAGS=$ac_save_CFLAGS--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5-printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }- case $ac_cv_c_undeclared_builtin_options in #(- 'cannot detect') :- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "cannot make $CC report undeclared builtins-See \`config.log' for more details" "$LINENO" 5; } ;; #(- 'none needed') :- ac_c_undeclared_builtin_options='' ;; #(- *) :- ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;-esac--ac_fn_check_decl "$LINENO" "F_OFD_SETLK" "ac_cv_have_decl_F_OFD_SETLK" "- #include <unistd.h>- #include <fcntl.h>--" "$ac_c_undeclared_builtin_options" "CFLAGS"-if test "x$ac_cv_have_decl_F_OFD_SETLK" = xyes-then :---printf "%s\n" "#define HAVE_OFD_LOCKING 1" >>confdefs.h---fi--# flock-ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"-if test "x$ac_cv_func_flock" = xyes-then :- printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h--fi--if test "$ac_cv_header_sys_file_h" = yes && test "$ac_cv_func_flock" = yes; then--printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h--fi--# unsetenv-ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"-if test "x$ac_cv_func_unsetenv" = xyes-then :- printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h--fi---### POSIX.1003.1 unsetenv returns 0 or -1 (EINVAL), but older implementations-### in common use return void.-ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5-printf %s "checking how to run the C preprocessor... " >&6; }-# On Suns, sometimes $CPP names a directory.-if test -n "$CPP" && test -d "$CPP"; then- CPP=-fi-if test -z "$CPP"; then- if test ${ac_cv_prog_CPP+y}-then :- printf %s "(cached) " >&6-else $as_nop- # Double quotes because $CC needs to be expanded- for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp- do- ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do- # Use a header file that comes with gcc, so configuring glibc- # with a fresh cross-compiler works.- # On the NeXT, cc -E runs the code through the compiler's parser,- # not just through cpp. "Syntax error" is here to catch this case.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <limits.h>- Syntax error-_ACEOF-if ac_fn_c_try_cpp "$LINENO"-then :--else $as_nop- # Broken: fails on valid input.-continue-fi-rm -f conftest.err conftest.i conftest.$ac_ext-- # OK, works on sane cases. Now check whether nonexistent headers- # can be detected and how.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <ac_nonexistent.h>-_ACEOF-if ac_fn_c_try_cpp "$LINENO"-then :- # Broken: success on invalid input.-continue-else $as_nop- # Passes both tests.-ac_preproc_ok=:-break-fi-rm -f conftest.err conftest.i conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.i conftest.err conftest.$ac_ext-if $ac_preproc_ok-then :- break-fi-- done- ac_cv_prog_CPP=$CPP--fi- CPP=$ac_cv_prog_CPP-else- ac_cv_prog_CPP=$CPP-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5-printf "%s\n" "$CPP" >&6; }-ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do- # Use a header file that comes with gcc, so configuring glibc- # with a fresh cross-compiler works.- # On the NeXT, cc -E runs the code through the compiler's parser,- # not just through cpp. "Syntax error" is here to catch this case.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <limits.h>- Syntax error-_ACEOF-if ac_fn_c_try_cpp "$LINENO"-then :--else $as_nop- # Broken: fails on valid input.-continue-fi-rm -f conftest.err conftest.i conftest.$ac_ext-- # OK, works on sane cases. Now check whether nonexistent headers- # can be detected and how.- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <ac_nonexistent.h>-_ACEOF-if ac_fn_c_try_cpp "$LINENO"-then :- # Broken: success on invalid input.-continue-else $as_nop- # Passes both tests.-ac_preproc_ok=:-break-fi-rm -f conftest.err conftest.i conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.i conftest.err conftest.$ac_ext-if $ac_preproc_ok-then :--else $as_nop- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check-See \`config.log' for more details" "$LINENO" 5; }-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5-printf %s "checking for grep that handles long lines and -e... " >&6; }-if test ${ac_cv_path_GREP+y}-then :- printf %s "(cached) " >&6-else $as_nop- if test -z "$GREP"; then- ac_path_GREP_found=false- # Loop through the user's path and test for each of PROGNAME-LIST- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_prog in grep ggrep- do- for ac_exec_ext in '' $ac_executable_extensions; do- ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"- as_fn_executable_p "$ac_path_GREP" || continue-# Check for GNU ac_path_GREP and select it if it is found.- # Check for GNU $ac_path_GREP-case `"$ac_path_GREP" --version 2>&1` in-*GNU*)- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;-*)- ac_count=0- printf %s 0123456789 >"conftest.in"- while :- do- cat "conftest.in" "conftest.in" >"conftest.tmp"- mv "conftest.tmp" "conftest.in"- cp "conftest.in" "conftest.nl"- printf "%s\n" 'GREP' >> "conftest.nl"- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break- as_fn_arith $ac_count + 1 && ac_count=$as_val- if test $ac_count -gt ${ac_path_GREP_max-0}; then- # Best one so far, save it but keep looking for a better one- ac_cv_path_GREP="$ac_path_GREP"- ac_path_GREP_max=$ac_count- fi- # 10*(2^10) chars as input seems more than enough- test $ac_count -gt 10 && break- done- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac-- $ac_path_GREP_found && break 3- done- done- done-IFS=$as_save_IFS- if test -z "$ac_cv_path_GREP"; then- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5- fi-else- ac_cv_path_GREP=$GREP-fi--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5-printf "%s\n" "$ac_cv_path_GREP" >&6; }- GREP="$ac_cv_path_GREP"---{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5-printf %s "checking for egrep... " >&6; }-if test ${ac_cv_path_EGREP+y}-then :- printf %s "(cached) " >&6-else $as_nop- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1- then ac_cv_path_EGREP="$GREP -E"- else- if test -z "$EGREP"; then- ac_path_EGREP_found=false- # Loop through the user's path and test for each of PROGNAME-LIST- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- for ac_prog in egrep- do- for ac_exec_ext in '' $ac_executable_extensions; do- ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"- as_fn_executable_p "$ac_path_EGREP" || continue-# Check for GNU ac_path_EGREP and select it if it is found.- # Check for GNU $ac_path_EGREP-case `"$ac_path_EGREP" --version 2>&1` in-*GNU*)- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;-*)- ac_count=0- printf %s 0123456789 >"conftest.in"- while :- do- cat "conftest.in" "conftest.in" >"conftest.tmp"- mv "conftest.tmp" "conftest.in"- cp "conftest.in" "conftest.nl"- printf "%s\n" 'EGREP' >> "conftest.nl"- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break- as_fn_arith $ac_count + 1 && ac_count=$as_val- if test $ac_count -gt ${ac_path_EGREP_max-0}; then- # Best one so far, save it but keep looking for a better one- ac_cv_path_EGREP="$ac_path_EGREP"- ac_path_EGREP_max=$ac_count- fi- # 10*(2^10) chars as input seems more than enough- test $ac_count -gt 10 && break- done- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac-- $ac_path_EGREP_found && break 3- done- done- done-IFS=$as_save_IFS- if test -z "$ac_cv_path_EGREP"; then- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5- fi-else- ac_cv_path_EGREP=$EGREP-fi-- fi-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5-printf "%s\n" "$ac_cv_path_EGREP" >&6; }- EGREP="$ac_cv_path_EGREP"---{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking return type of unsetenv" >&5-printf %s "checking return type of unsetenv... " >&6; }-if test ${fptools_cv_func_unsetenv_return_type+y}-then :- printf %s "(cached) " >&6-else $as_nop- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <stdlib.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |- $EGREP "void[ ]+unsetenv" >/dev/null 2>&1-then :- fptools_cv_func_unsetenv_return_type=void-else $as_nop- fptools_cv_func_unsetenv_return_type=int-fi-rm -rf conftest*--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_func_unsetenv_return_type" >&5-printf "%s\n" "$fptools_cv_func_unsetenv_return_type" >&6; }-case "$fptools_cv_func_unsetenv_return_type" in- "void" )--printf "%s\n" "#define UNSETENV_RETURNS_VOID 1" >>confdefs.h-- ;;-esac----# Check whether --with-iconv-includes was given.-if test ${with_iconv_includes+y}-then :- withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval-else $as_nop- ICONV_INCLUDE_DIRS=-fi----# Check whether --with-iconv-libraries was given.-if test ${with_iconv_libraries+y}-then :- withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval $LDFLAGS"-else $as_nop- ICONV_LIB_DIRS=-fi------# map standard C types and ISO types to Haskell types--------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for char" >&5-printf %s "checking Haskell type for char... " >&6; }- if test ${fptools_cv_htype_char+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_char=yes- if ac_fn_c_compute_int "$LINENO" "(char)0.2 - (char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-char val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_char="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_char=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_char=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_char=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_char=LDouble- else- fptools_cv_htype_sup_char=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((char)(-1)) < ((char)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(char) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_char=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_char="Word$HTYPE_SIZE"- else- fptools_cv_htype_char="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_char" = no- then-- fptools_cv_htype_char=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_char" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_char" >&5-printf "%s\n" "$fptools_cv_htype_char" >&6; }--printf "%s\n" "#define HTYPE_CHAR $fptools_cv_htype_char" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for signed char" >&5-printf %s "checking Haskell type for signed char... " >&6; }- if test ${fptools_cv_htype_signed_char+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_signed_char=yes- if ac_fn_c_compute_int "$LINENO" "(signed char)0.2 - (signed char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-signed char val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_signed_char="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_signed_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_signed_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_signed_char=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_signed_char=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_signed_char=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_signed_char=LDouble- else- fptools_cv_htype_sup_signed_char=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((signed char)(-1)) < ((signed char)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_signed_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_signed_char=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_signed_char="Word$HTYPE_SIZE"- else- fptools_cv_htype_signed_char="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_signed_char" = no- then-- fptools_cv_htype_signed_char=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_signed_char" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_signed_char" >&5-printf "%s\n" "$fptools_cv_htype_signed_char" >&6; }--printf "%s\n" "#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned char" >&5-printf %s "checking Haskell type for unsigned char... " >&6; }- if test ${fptools_cv_htype_unsigned_char+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_unsigned_char=yes- if ac_fn_c_compute_int "$LINENO" "(unsigned char)0.2 - (unsigned char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-unsigned char val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_unsigned_char="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_char=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_unsigned_char=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_unsigned_char=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_unsigned_char=LDouble- else- fptools_cv_htype_sup_unsigned_char=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((unsigned char)(-1)) < ((unsigned char)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_char=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_char=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_unsigned_char="Word$HTYPE_SIZE"- else- fptools_cv_htype_unsigned_char="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_unsigned_char" = no- then-- fptools_cv_htype_unsigned_char=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_unsigned_char" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_char" >&5-printf "%s\n" "$fptools_cv_htype_unsigned_char" >&6; }--printf "%s\n" "#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for short" >&5-printf %s "checking Haskell type for short... " >&6; }- if test ${fptools_cv_htype_short+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_short=yes- if ac_fn_c_compute_int "$LINENO" "(short)0.2 - (short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-short val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_short="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_short=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_short=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_short=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_short=LDouble- else- fptools_cv_htype_sup_short=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((short)(-1)) < ((short)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(short) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_short=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_short="Word$HTYPE_SIZE"- else- fptools_cv_htype_short="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_short" = no- then-- fptools_cv_htype_short=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_short" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_short" >&5-printf "%s\n" "$fptools_cv_htype_short" >&6; }--printf "%s\n" "#define HTYPE_SHORT $fptools_cv_htype_short" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned short" >&5-printf %s "checking Haskell type for unsigned short... " >&6; }- if test ${fptools_cv_htype_unsigned_short+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_unsigned_short=yes- if ac_fn_c_compute_int "$LINENO" "(unsigned short)0.2 - (unsigned short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-unsigned short val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_unsigned_short="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_short=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_unsigned_short=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_unsigned_short=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_unsigned_short=LDouble- else- fptools_cv_htype_sup_unsigned_short=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((unsigned short)(-1)) < ((unsigned short)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_short=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_short=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_unsigned_short="Word$HTYPE_SIZE"- else- fptools_cv_htype_unsigned_short="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_unsigned_short" = no- then-- fptools_cv_htype_unsigned_short=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_unsigned_short" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_short" >&5-printf "%s\n" "$fptools_cv_htype_unsigned_short" >&6; }--printf "%s\n" "#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for int" >&5-printf %s "checking Haskell type for int... " >&6; }- if test ${fptools_cv_htype_int+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_int=yes- if ac_fn_c_compute_int "$LINENO" "(int)0.2 - (int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-int val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_int="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_int=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_int=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_int=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_int=LDouble- else- fptools_cv_htype_sup_int=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((int)(-1)) < ((int)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(int) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_int=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_int="Word$HTYPE_SIZE"- else- fptools_cv_htype_int="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_int" = no- then-- fptools_cv_htype_int=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_int" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_int" >&5-printf "%s\n" "$fptools_cv_htype_int" >&6; }--printf "%s\n" "#define HTYPE_INT $fptools_cv_htype_int" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned int" >&5-printf %s "checking Haskell type for unsigned int... " >&6; }- if test ${fptools_cv_htype_unsigned_int+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_unsigned_int=yes- if ac_fn_c_compute_int "$LINENO" "(unsigned int)0.2 - (unsigned int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-unsigned int val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_unsigned_int="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_int=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_unsigned_int=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_unsigned_int=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_unsigned_int=LDouble- else- fptools_cv_htype_sup_unsigned_int=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((unsigned int)(-1)) < ((unsigned int)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_int=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_int=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_unsigned_int="Word$HTYPE_SIZE"- else- fptools_cv_htype_unsigned_int="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_unsigned_int" = no- then-- fptools_cv_htype_unsigned_int=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_unsigned_int" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_int" >&5-printf "%s\n" "$fptools_cv_htype_unsigned_int" >&6; }--printf "%s\n" "#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for long" >&5-printf %s "checking Haskell type for long... " >&6; }- if test ${fptools_cv_htype_long+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_long=yes- if ac_fn_c_compute_int "$LINENO" "(long)0.2 - (long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-long val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_long="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_long=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_long=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_long=LDouble- else- fptools_cv_htype_sup_long=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((long)(-1)) < ((long)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_long="Word$HTYPE_SIZE"- else- fptools_cv_htype_long="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_long" = no- then-- fptools_cv_htype_long=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_long" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long" >&5-printf "%s\n" "$fptools_cv_htype_long" >&6; }--printf "%s\n" "#define HTYPE_LONG $fptools_cv_htype_long" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long" >&5-printf %s "checking Haskell type for unsigned long... " >&6; }- if test ${fptools_cv_htype_unsigned_long+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_unsigned_long=yes- if ac_fn_c_compute_int "$LINENO" "(unsigned long)0.2 - (unsigned long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-unsigned long val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_unsigned_long="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_unsigned_long=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_unsigned_long=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_unsigned_long=LDouble- else- fptools_cv_htype_sup_unsigned_long=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((unsigned long)(-1)) < ((unsigned long)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_unsigned_long="Word$HTYPE_SIZE"- else- fptools_cv_htype_unsigned_long="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_unsigned_long" = no- then-- fptools_cv_htype_unsigned_long=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_unsigned_long" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long" >&5-printf "%s\n" "$fptools_cv_htype_unsigned_long" >&6; }--printf "%s\n" "#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long" >>confdefs.h-- fi---if test "$ac_cv_type_long_long" = yes; then--------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for long long" >&5-printf %s "checking Haskell type for long long... " >&6; }- if test ${fptools_cv_htype_long_long+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_long_long=yes- if ac_fn_c_compute_int "$LINENO" "(long long)0.2 - (long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-long long val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_long_long="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long_long=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_long_long=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_long_long=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_long_long=LDouble- else- fptools_cv_htype_sup_long_long=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((long long)(-1)) < ((long long)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(long long) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_long_long=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_long_long="Word$HTYPE_SIZE"- else- fptools_cv_htype_long_long="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_long_long" = no- then-- fptools_cv_htype_long_long=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_long_long" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long_long" >&5-printf "%s\n" "$fptools_cv_htype_long_long" >&6; }--printf "%s\n" "#define HTYPE_LONG_LONG $fptools_cv_htype_long_long" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long long" >&5-printf %s "checking Haskell type for unsigned long long... " >&6; }- if test ${fptools_cv_htype_unsigned_long_long+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_unsigned_long_long=yes- if ac_fn_c_compute_int "$LINENO" "(unsigned long long)0.2 - (unsigned long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-unsigned long long val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_unsigned_long_long="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long_long=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_unsigned_long_long=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_unsigned_long_long=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_unsigned_long_long=LDouble- else- fptools_cv_htype_sup_unsigned_long_long=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((unsigned long long)(-1)) < ((unsigned long long)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long_long=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_unsigned_long_long=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_unsigned_long_long="Word$HTYPE_SIZE"- else- fptools_cv_htype_unsigned_long_long="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_unsigned_long_long" = no- then-- fptools_cv_htype_unsigned_long_long=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long_long" >&5-printf "%s\n" "$fptools_cv_htype_unsigned_long_long" >&6; }--printf "%s\n" "#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long" >>confdefs.h-- fi---fi--------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for bool" >&5-printf %s "checking Haskell type for bool... " >&6; }- if test ${fptools_cv_htype_bool+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_bool=yes- if ac_fn_c_compute_int "$LINENO" "(bool)0.2 - (bool)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-bool val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_bool="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_bool=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_bool=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_bool=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_bool=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_bool=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_bool=LDouble- else- fptools_cv_htype_sup_bool=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((bool)(-1)) < ((bool)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_bool=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(bool) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_bool=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_bool="Word$HTYPE_SIZE"- else- fptools_cv_htype_bool="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_bool" = no- then-- fptools_cv_htype_bool=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_bool" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_bool" >&5-printf "%s\n" "$fptools_cv_htype_bool" >&6; }--printf "%s\n" "#define HTYPE_BOOL $fptools_cv_htype_bool" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for float" >&5-printf %s "checking Haskell type for float... " >&6; }- if test ${fptools_cv_htype_float+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_float=yes- if ac_fn_c_compute_int "$LINENO" "(float)0.2 - (float)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-float val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_float="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_float=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_float=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_float=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_float=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_float=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_float=LDouble- else- fptools_cv_htype_sup_float=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((float)(-1)) < ((float)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_float=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(float) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_float=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_float="Word$HTYPE_SIZE"- else- fptools_cv_htype_float="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_float" = no- then-- fptools_cv_htype_float=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_float" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_float" >&5-printf "%s\n" "$fptools_cv_htype_float" >&6; }--printf "%s\n" "#define HTYPE_FLOAT $fptools_cv_htype_float" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for double" >&5-printf %s "checking Haskell type for double... " >&6; }- if test ${fptools_cv_htype_double+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_double=yes- if ac_fn_c_compute_int "$LINENO" "(double)0.2 - (double)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-double val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_double="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_double=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_double=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_double=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_double=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_double=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_double=LDouble- else- fptools_cv_htype_sup_double=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((double)(-1)) < ((double)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_double=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(double) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_double=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_double="Word$HTYPE_SIZE"- else- fptools_cv_htype_double="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_double" = no- then-- fptools_cv_htype_double=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_double" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_double" >&5-printf "%s\n" "$fptools_cv_htype_double" >&6; }--printf "%s\n" "#define HTYPE_DOUBLE $fptools_cv_htype_double" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for ptrdiff_t" >&5-printf %s "checking Haskell type for ptrdiff_t... " >&6; }- if test ${fptools_cv_htype_ptrdiff_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_ptrdiff_t=yes- if ac_fn_c_compute_int "$LINENO" "(ptrdiff_t)0.2 - (ptrdiff_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-ptrdiff_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_ptrdiff_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ptrdiff_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ptrdiff_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ptrdiff_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_ptrdiff_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_ptrdiff_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_ptrdiff_t=LDouble- else- fptools_cv_htype_sup_ptrdiff_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((ptrdiff_t)(-1)) < ((ptrdiff_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ptrdiff_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ptrdiff_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_ptrdiff_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_ptrdiff_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_ptrdiff_t" = no- then-- fptools_cv_htype_ptrdiff_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ptrdiff_t" >&5-printf "%s\n" "$fptools_cv_htype_ptrdiff_t" >&6; }--printf "%s\n" "#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for size_t" >&5-printf %s "checking Haskell type for size_t... " >&6; }- if test ${fptools_cv_htype_size_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_size_t=yes- if ac_fn_c_compute_int "$LINENO" "(size_t)0.2 - (size_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-size_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_size_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_size_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_size_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_size_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_size_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_size_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_size_t=LDouble- else- fptools_cv_htype_sup_size_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((size_t)(-1)) < ((size_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_size_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_size_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_size_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_size_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_size_t" = no- then-- fptools_cv_htype_size_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_size_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_size_t" >&5-printf "%s\n" "$fptools_cv_htype_size_t" >&6; }--printf "%s\n" "#define HTYPE_SIZE_T $fptools_cv_htype_size_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for wchar_t" >&5-printf %s "checking Haskell type for wchar_t... " >&6; }- if test ${fptools_cv_htype_wchar_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_wchar_t=yes- if ac_fn_c_compute_int "$LINENO" "(wchar_t)0.2 - (wchar_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-wchar_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_wchar_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_wchar_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_wchar_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_wchar_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_wchar_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_wchar_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_wchar_t=LDouble- else- fptools_cv_htype_sup_wchar_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((wchar_t)(-1)) < ((wchar_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_wchar_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_wchar_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_wchar_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_wchar_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_wchar_t" = no- then-- fptools_cv_htype_wchar_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_wchar_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wchar_t" >&5-printf "%s\n" "$fptools_cv_htype_wchar_t" >&6; }--printf "%s\n" "#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for sig_atomic_t" >&5-printf %s "checking Haskell type for sig_atomic_t... " >&6; }- if test ${fptools_cv_htype_sig_atomic_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_sig_atomic_t=yes- if ac_fn_c_compute_int "$LINENO" "(sig_atomic_t)0.2 - (sig_atomic_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-sig_atomic_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_sig_atomic_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_sig_atomic_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_sig_atomic_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_sig_atomic_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_sig_atomic_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_sig_atomic_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_sig_atomic_t=LDouble- else- fptools_cv_htype_sup_sig_atomic_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((sig_atomic_t)(-1)) < ((sig_atomic_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_sig_atomic_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_sig_atomic_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_sig_atomic_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_sig_atomic_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_sig_atomic_t" = no- then-- fptools_cv_htype_sig_atomic_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_sig_atomic_t" >&5-printf "%s\n" "$fptools_cv_htype_sig_atomic_t" >&6; }--printf "%s\n" "#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for clock_t" >&5-printf %s "checking Haskell type for clock_t... " >&6; }- if test ${fptools_cv_htype_clock_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_clock_t=yes- if ac_fn_c_compute_int "$LINENO" "(clock_t)0.2 - (clock_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-clock_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_clock_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clock_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clock_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clock_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_clock_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_clock_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_clock_t=LDouble- else- fptools_cv_htype_sup_clock_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((clock_t)(-1)) < ((clock_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clock_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clock_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_clock_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_clock_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_clock_t" = no- then-- fptools_cv_htype_clock_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_clock_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clock_t" >&5-printf "%s\n" "$fptools_cv_htype_clock_t" >&6; }--printf "%s\n" "#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for time_t" >&5-printf %s "checking Haskell type for time_t... " >&6; }- if test ${fptools_cv_htype_time_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_time_t=yes- if ac_fn_c_compute_int "$LINENO" "(time_t)0.2 - (time_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-time_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_time_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_time_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_time_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_time_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_time_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_time_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_time_t=LDouble- else- fptools_cv_htype_sup_time_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((time_t)(-1)) < ((time_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_time_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_time_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_time_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_time_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_time_t" = no- then-- fptools_cv_htype_time_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_time_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_time_t" >&5-printf "%s\n" "$fptools_cv_htype_time_t" >&6; }--printf "%s\n" "#define HTYPE_TIME_T $fptools_cv_htype_time_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for useconds_t" >&5-printf %s "checking Haskell type for useconds_t... " >&6; }- if test ${fptools_cv_htype_useconds_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_useconds_t=yes- if ac_fn_c_compute_int "$LINENO" "(useconds_t)0.2 - (useconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-useconds_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_useconds_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_useconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_useconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_useconds_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_useconds_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_useconds_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_useconds_t=LDouble- else- fptools_cv_htype_sup_useconds_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((useconds_t)(-1)) < ((useconds_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_useconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_useconds_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_useconds_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_useconds_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_useconds_t" = no- then-- fptools_cv_htype_useconds_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_useconds_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_useconds_t" >&5-printf "%s\n" "$fptools_cv_htype_useconds_t" >&6; }--printf "%s\n" "#define HTYPE_USECONDS_T $fptools_cv_htype_useconds_t" >>confdefs.h-- fi---------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for suseconds_t" >&5-printf %s "checking Haskell type for suseconds_t... " >&6; }- if test ${fptools_cv_htype_suseconds_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_suseconds_t=yes- if ac_fn_c_compute_int "$LINENO" "(suseconds_t)0.2 - (suseconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-suseconds_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_suseconds_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_suseconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_suseconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_suseconds_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_suseconds_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_suseconds_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_suseconds_t=LDouble- else- fptools_cv_htype_sup_suseconds_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((suseconds_t)(-1)) < ((suseconds_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_suseconds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_suseconds_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_suseconds_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_suseconds_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_suseconds_t" = no- then- if test "$WINDOWS" = "YES"- then- fptools_cv_htype_suseconds_t=Int32- fptools_cv_htype_sup_suseconds_t=yes- else- as_fn_error $? "type not found" "$LINENO" 5- fi- fi-- if test "$fptools_cv_htype_sup_suseconds_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_suseconds_t" >&5-printf "%s\n" "$fptools_cv_htype_suseconds_t" >&6; }--printf "%s\n" "#define HTYPE_SUSECONDS_T $fptools_cv_htype_suseconds_t" >>confdefs.h-- fi---------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for dev_t" >&5-printf %s "checking Haskell type for dev_t... " >&6; }- if test ${fptools_cv_htype_dev_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_dev_t=yes- if ac_fn_c_compute_int "$LINENO" "(dev_t)0.2 - (dev_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-dev_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_dev_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_dev_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_dev_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_dev_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_dev_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_dev_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_dev_t=LDouble- else- fptools_cv_htype_sup_dev_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((dev_t)(-1)) < ((dev_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_dev_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_dev_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_dev_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_dev_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_dev_t" = no- then-- fptools_cv_htype_dev_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_dev_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_dev_t" >&5-printf "%s\n" "$fptools_cv_htype_dev_t" >&6; }--printf "%s\n" "#define HTYPE_DEV_T $fptools_cv_htype_dev_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for ino_t" >&5-printf %s "checking Haskell type for ino_t... " >&6; }- if test ${fptools_cv_htype_ino_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_ino_t=yes- if ac_fn_c_compute_int "$LINENO" "(ino_t)0.2 - (ino_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-ino_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_ino_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ino_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ino_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ino_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_ino_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_ino_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_ino_t=LDouble- else- fptools_cv_htype_sup_ino_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((ino_t)(-1)) < ((ino_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ino_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ino_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_ino_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_ino_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_ino_t" = no- then-- fptools_cv_htype_ino_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_ino_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ino_t" >&5-printf "%s\n" "$fptools_cv_htype_ino_t" >&6; }--printf "%s\n" "#define HTYPE_INO_T $fptools_cv_htype_ino_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for mode_t" >&5-printf %s "checking Haskell type for mode_t... " >&6; }- if test ${fptools_cv_htype_mode_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_mode_t=yes- if ac_fn_c_compute_int "$LINENO" "(mode_t)0.2 - (mode_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-mode_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_mode_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_mode_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_mode_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_mode_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_mode_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_mode_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_mode_t=LDouble- else- fptools_cv_htype_sup_mode_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((mode_t)(-1)) < ((mode_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_mode_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_mode_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_mode_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_mode_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_mode_t" = no- then-- fptools_cv_htype_mode_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_mode_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_mode_t" >&5-printf "%s\n" "$fptools_cv_htype_mode_t" >&6; }--printf "%s\n" "#define HTYPE_MODE_T $fptools_cv_htype_mode_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for off_t" >&5-printf %s "checking Haskell type for off_t... " >&6; }- if test ${fptools_cv_htype_off_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_off_t=yes- if ac_fn_c_compute_int "$LINENO" "(off_t)0.2 - (off_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-off_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_off_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_off_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_off_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_off_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_off_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_off_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_off_t=LDouble- else- fptools_cv_htype_sup_off_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((off_t)(-1)) < ((off_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_off_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_off_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_off_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_off_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_off_t" = no- then-- fptools_cv_htype_off_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_off_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_off_t" >&5-printf "%s\n" "$fptools_cv_htype_off_t" >&6; }--printf "%s\n" "#define HTYPE_OFF_T $fptools_cv_htype_off_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for pid_t" >&5-printf %s "checking Haskell type for pid_t... " >&6; }- if test ${fptools_cv_htype_pid_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_pid_t=yes- if ac_fn_c_compute_int "$LINENO" "(pid_t)0.2 - (pid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-pid_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_pid_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_pid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_pid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_pid_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_pid_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_pid_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_pid_t=LDouble- else- fptools_cv_htype_sup_pid_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((pid_t)(-1)) < ((pid_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_pid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_pid_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_pid_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_pid_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_pid_t" = no- then-- fptools_cv_htype_pid_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_pid_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_pid_t" >&5-printf "%s\n" "$fptools_cv_htype_pid_t" >&6; }--printf "%s\n" "#define HTYPE_PID_T $fptools_cv_htype_pid_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for gid_t" >&5-printf %s "checking Haskell type for gid_t... " >&6; }- if test ${fptools_cv_htype_gid_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_gid_t=yes- if ac_fn_c_compute_int "$LINENO" "(gid_t)0.2 - (gid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-gid_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_gid_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_gid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_gid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_gid_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_gid_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_gid_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_gid_t=LDouble- else- fptools_cv_htype_sup_gid_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((gid_t)(-1)) < ((gid_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_gid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_gid_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_gid_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_gid_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_gid_t" = no- then-- fptools_cv_htype_gid_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_gid_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_gid_t" >&5-printf "%s\n" "$fptools_cv_htype_gid_t" >&6; }--printf "%s\n" "#define HTYPE_GID_T $fptools_cv_htype_gid_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for uid_t" >&5-printf %s "checking Haskell type for uid_t... " >&6; }- if test ${fptools_cv_htype_uid_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_uid_t=yes- if ac_fn_c_compute_int "$LINENO" "(uid_t)0.2 - (uid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-uid_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_uid_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uid_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_uid_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_uid_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_uid_t=LDouble- else- fptools_cv_htype_sup_uid_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((uid_t)(-1)) < ((uid_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uid_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_uid_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_uid_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_uid_t" = no- then-- fptools_cv_htype_uid_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_uid_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uid_t" >&5-printf "%s\n" "$fptools_cv_htype_uid_t" >&6; }--printf "%s\n" "#define HTYPE_UID_T $fptools_cv_htype_uid_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for cc_t" >&5-printf %s "checking Haskell type for cc_t... " >&6; }- if test ${fptools_cv_htype_cc_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_cc_t=yes- if ac_fn_c_compute_int "$LINENO" "(cc_t)0.2 - (cc_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-cc_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_cc_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_cc_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_cc_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_cc_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_cc_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_cc_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_cc_t=LDouble- else- fptools_cv_htype_sup_cc_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((cc_t)(-1)) < ((cc_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_cc_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_cc_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_cc_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_cc_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_cc_t" = no- then-- fptools_cv_htype_cc_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_cc_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_cc_t" >&5-printf "%s\n" "$fptools_cv_htype_cc_t" >&6; }--printf "%s\n" "#define HTYPE_CC_T $fptools_cv_htype_cc_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for speed_t" >&5-printf %s "checking Haskell type for speed_t... " >&6; }- if test ${fptools_cv_htype_speed_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_speed_t=yes- if ac_fn_c_compute_int "$LINENO" "(speed_t)0.2 - (speed_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-speed_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_speed_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_speed_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_speed_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_speed_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_speed_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_speed_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_speed_t=LDouble- else- fptools_cv_htype_sup_speed_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((speed_t)(-1)) < ((speed_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_speed_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_speed_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_speed_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_speed_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_speed_t" = no- then-- fptools_cv_htype_speed_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_speed_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_speed_t" >&5-printf "%s\n" "$fptools_cv_htype_speed_t" >&6; }--printf "%s\n" "#define HTYPE_SPEED_T $fptools_cv_htype_speed_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for tcflag_t" >&5-printf %s "checking Haskell type for tcflag_t... " >&6; }- if test ${fptools_cv_htype_tcflag_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_tcflag_t=yes- if ac_fn_c_compute_int "$LINENO" "(tcflag_t)0.2 - (tcflag_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-tcflag_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_tcflag_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_tcflag_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_tcflag_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_tcflag_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_tcflag_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_tcflag_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_tcflag_t=LDouble- else- fptools_cv_htype_sup_tcflag_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((tcflag_t)(-1)) < ((tcflag_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_tcflag_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_tcflag_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_tcflag_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_tcflag_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_tcflag_t" = no- then-- fptools_cv_htype_tcflag_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_tcflag_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_tcflag_t" >&5-printf "%s\n" "$fptools_cv_htype_tcflag_t" >&6; }--printf "%s\n" "#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for nlink_t" >&5-printf %s "checking Haskell type for nlink_t... " >&6; }- if test ${fptools_cv_htype_nlink_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_nlink_t=yes- if ac_fn_c_compute_int "$LINENO" "(nlink_t)0.2 - (nlink_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-nlink_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_nlink_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nlink_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nlink_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nlink_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_nlink_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_nlink_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_nlink_t=LDouble- else- fptools_cv_htype_sup_nlink_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((nlink_t)(-1)) < ((nlink_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nlink_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nlink_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_nlink_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_nlink_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_nlink_t" = no- then-- fptools_cv_htype_nlink_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_nlink_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nlink_t" >&5-printf "%s\n" "$fptools_cv_htype_nlink_t" >&6; }--printf "%s\n" "#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for ssize_t" >&5-printf %s "checking Haskell type for ssize_t... " >&6; }- if test ${fptools_cv_htype_ssize_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_ssize_t=yes- if ac_fn_c_compute_int "$LINENO" "(ssize_t)0.2 - (ssize_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-ssize_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_ssize_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ssize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ssize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ssize_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_ssize_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_ssize_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_ssize_t=LDouble- else- fptools_cv_htype_sup_ssize_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((ssize_t)(-1)) < ((ssize_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ssize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_ssize_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_ssize_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_ssize_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_ssize_t" = no- then-- fptools_cv_htype_ssize_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_ssize_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ssize_t" >&5-printf "%s\n" "$fptools_cv_htype_ssize_t" >&6; }--printf "%s\n" "#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for rlim_t" >&5-printf %s "checking Haskell type for rlim_t... " >&6; }- if test ${fptools_cv_htype_rlim_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_rlim_t=yes- if ac_fn_c_compute_int "$LINENO" "(rlim_t)0.2 - (rlim_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-rlim_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_rlim_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_rlim_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_rlim_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_rlim_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_rlim_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_rlim_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_rlim_t=LDouble- else- fptools_cv_htype_sup_rlim_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((rlim_t)(-1)) < ((rlim_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_rlim_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_rlim_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_rlim_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_rlim_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_rlim_t" = no- then-- fptools_cv_htype_rlim_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_rlim_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_rlim_t" >&5-printf "%s\n" "$fptools_cv_htype_rlim_t" >&6; }--printf "%s\n" "#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for blksize_t" >&5-printf %s "checking Haskell type for blksize_t... " >&6; }- if test ${fptools_cv_htype_blksize_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_blksize_t=yes- if ac_fn_c_compute_int "$LINENO" "(blksize_t)0.2 - (blksize_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-blksize_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_blksize_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blksize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blksize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blksize_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_blksize_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_blksize_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_blksize_t=LDouble- else- fptools_cv_htype_sup_blksize_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((blksize_t)(-1)) < ((blksize_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blksize_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blksize_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_blksize_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_blksize_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_blksize_t" = no- then-- fptools_cv_htype_blksize_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_blksize_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_blksize_t" >&5-printf "%s\n" "$fptools_cv_htype_blksize_t" >&6; }--printf "%s\n" "#define HTYPE_BLKSIZE_T $fptools_cv_htype_blksize_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for blkcnt_t" >&5-printf %s "checking Haskell type for blkcnt_t... " >&6; }- if test ${fptools_cv_htype_blkcnt_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_blkcnt_t=yes- if ac_fn_c_compute_int "$LINENO" "(blkcnt_t)0.2 - (blkcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-blkcnt_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_blkcnt_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blkcnt_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_blkcnt_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_blkcnt_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_blkcnt_t=LDouble- else- fptools_cv_htype_sup_blkcnt_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((blkcnt_t)(-1)) < ((blkcnt_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_blkcnt_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_blkcnt_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_blkcnt_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_blkcnt_t" = no- then-- fptools_cv_htype_blkcnt_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_blkcnt_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_blkcnt_t" >&5-printf "%s\n" "$fptools_cv_htype_blkcnt_t" >&6; }--printf "%s\n" "#define HTYPE_BLKCNT_T $fptools_cv_htype_blkcnt_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for clockid_t" >&5-printf %s "checking Haskell type for clockid_t... " >&6; }- if test ${fptools_cv_htype_clockid_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_clockid_t=yes- if ac_fn_c_compute_int "$LINENO" "(clockid_t)0.2 - (clockid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-clockid_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_clockid_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clockid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clockid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clockid_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_clockid_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_clockid_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_clockid_t=LDouble- else- fptools_cv_htype_sup_clockid_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((clockid_t)(-1)) < ((clockid_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clockid_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_clockid_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_clockid_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_clockid_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_clockid_t" = no- then-- fptools_cv_htype_clockid_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_clockid_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clockid_t" >&5-printf "%s\n" "$fptools_cv_htype_clockid_t" >&6; }--printf "%s\n" "#define HTYPE_CLOCKID_T $fptools_cv_htype_clockid_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for fsblkcnt_t" >&5-printf %s "checking Haskell type for fsblkcnt_t... " >&6; }- if test ${fptools_cv_htype_fsblkcnt_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_fsblkcnt_t=yes- if ac_fn_c_compute_int "$LINENO" "(fsblkcnt_t)0.2 - (fsblkcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-fsblkcnt_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_fsblkcnt_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsblkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsblkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsblkcnt_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_fsblkcnt_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_fsblkcnt_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_fsblkcnt_t=LDouble- else- fptools_cv_htype_sup_fsblkcnt_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((fsblkcnt_t)(-1)) < ((fsblkcnt_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsblkcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsblkcnt_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_fsblkcnt_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_fsblkcnt_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_fsblkcnt_t" = no- then-- fptools_cv_htype_fsblkcnt_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_fsblkcnt_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_fsblkcnt_t" >&5-printf "%s\n" "$fptools_cv_htype_fsblkcnt_t" >&6; }--printf "%s\n" "#define HTYPE_FSBLKCNT_T $fptools_cv_htype_fsblkcnt_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for fsfilcnt_t" >&5-printf %s "checking Haskell type for fsfilcnt_t... " >&6; }- if test ${fptools_cv_htype_fsfilcnt_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_fsfilcnt_t=yes- if ac_fn_c_compute_int "$LINENO" "(fsfilcnt_t)0.2 - (fsfilcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-fsfilcnt_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_fsfilcnt_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsfilcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsfilcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsfilcnt_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_fsfilcnt_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_fsfilcnt_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_fsfilcnt_t=LDouble- else- fptools_cv_htype_sup_fsfilcnt_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((fsfilcnt_t)(-1)) < ((fsfilcnt_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsfilcnt_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_fsfilcnt_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_fsfilcnt_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_fsfilcnt_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_fsfilcnt_t" = no- then-- fptools_cv_htype_fsfilcnt_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_fsfilcnt_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_fsfilcnt_t" >&5-printf "%s\n" "$fptools_cv_htype_fsfilcnt_t" >&6; }--printf "%s\n" "#define HTYPE_FSFILCNT_T $fptools_cv_htype_fsfilcnt_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for id_t" >&5-printf %s "checking Haskell type for id_t... " >&6; }- if test ${fptools_cv_htype_id_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_id_t=yes- if ac_fn_c_compute_int "$LINENO" "(id_t)0.2 - (id_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-id_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_id_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_id_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_id_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_id_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_id_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_id_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_id_t=LDouble- else- fptools_cv_htype_sup_id_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((id_t)(-1)) < ((id_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_id_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_id_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_id_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_id_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_id_t" = no- then-- fptools_cv_htype_id_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_id_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_id_t" >&5-printf "%s\n" "$fptools_cv_htype_id_t" >&6; }--printf "%s\n" "#define HTYPE_ID_T $fptools_cv_htype_id_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for key_t" >&5-printf %s "checking Haskell type for key_t... " >&6; }- if test ${fptools_cv_htype_key_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_key_t=yes- if ac_fn_c_compute_int "$LINENO" "(key_t)0.2 - (key_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-key_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_key_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_key_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_key_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_key_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_key_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_key_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_key_t=LDouble- else- fptools_cv_htype_sup_key_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((key_t)(-1)) < ((key_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_key_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_key_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_key_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_key_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_key_t" = no- then-- fptools_cv_htype_key_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_key_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_key_t" >&5-printf "%s\n" "$fptools_cv_htype_key_t" >&6; }--printf "%s\n" "#define HTYPE_KEY_T $fptools_cv_htype_key_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for timer_t" >&5-printf %s "checking Haskell type for timer_t... " >&6; }- if test ${fptools_cv_htype_timer_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_timer_t=yes- if ac_fn_c_compute_int "$LINENO" "(timer_t)0.2 - (timer_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-timer_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_timer_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_timer_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_timer_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_timer_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_timer_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_timer_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_timer_t=LDouble- else- fptools_cv_htype_sup_timer_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((timer_t)(-1)) < ((timer_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_timer_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_timer_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_timer_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_timer_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_timer_t" = no- then-- fptools_cv_htype_timer_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_timer_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_timer_t" >&5-printf "%s\n" "$fptools_cv_htype_timer_t" >&6; }--printf "%s\n" "#define HTYPE_TIMER_T $fptools_cv_htype_timer_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for socklen_t" >&5-printf %s "checking Haskell type for socklen_t... " >&6; }- if test ${fptools_cv_htype_socklen_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_socklen_t=yes- if ac_fn_c_compute_int "$LINENO" "(socklen_t)0.2 - (socklen_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-socklen_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_socklen_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_socklen_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_socklen_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_socklen_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_socklen_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_socklen_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_socklen_t=LDouble- else- fptools_cv_htype_sup_socklen_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((socklen_t)(-1)) < ((socklen_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_socklen_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_socklen_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_socklen_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_socklen_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_socklen_t" = no- then-- fptools_cv_htype_socklen_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_socklen_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_socklen_t" >&5-printf "%s\n" "$fptools_cv_htype_socklen_t" >&6; }--printf "%s\n" "#define HTYPE_SOCKLEN_T $fptools_cv_htype_socklen_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for nfds_t" >&5-printf %s "checking Haskell type for nfds_t... " >&6; }- if test ${fptools_cv_htype_nfds_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_nfds_t=yes- if ac_fn_c_compute_int "$LINENO" "(nfds_t)0.2 - (nfds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-nfds_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_nfds_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nfds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nfds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nfds_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_nfds_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_nfds_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_nfds_t=LDouble- else- fptools_cv_htype_sup_nfds_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((nfds_t)(-1)) < ((nfds_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nfds_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_nfds_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_nfds_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_nfds_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_nfds_t" = no- then-- fptools_cv_htype_nfds_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_nfds_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nfds_t" >&5-printf "%s\n" "$fptools_cv_htype_nfds_t" >&6; }--printf "%s\n" "#define HTYPE_NFDS_T $fptools_cv_htype_nfds_t" >>confdefs.h-- fi------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for intptr_t" >&5-printf %s "checking Haskell type for intptr_t... " >&6; }- if test ${fptools_cv_htype_intptr_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_intptr_t=yes- if ac_fn_c_compute_int "$LINENO" "(intptr_t)0.2 - (intptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-intptr_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_intptr_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intptr_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_intptr_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_intptr_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_intptr_t=LDouble- else- fptools_cv_htype_sup_intptr_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((intptr_t)(-1)) < ((intptr_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intptr_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_intptr_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_intptr_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_intptr_t" = no- then-- fptools_cv_htype_intptr_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_intptr_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intptr_t" >&5-printf "%s\n" "$fptools_cv_htype_intptr_t" >&6; }--printf "%s\n" "#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintptr_t" >&5-printf %s "checking Haskell type for uintptr_t... " >&6; }- if test ${fptools_cv_htype_uintptr_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_uintptr_t=yes- if ac_fn_c_compute_int "$LINENO" "(uintptr_t)0.2 - (uintptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-uintptr_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_uintptr_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintptr_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_uintptr_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_uintptr_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_uintptr_t=LDouble- else- fptools_cv_htype_sup_uintptr_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((uintptr_t)(-1)) < ((uintptr_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintptr_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintptr_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_uintptr_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_uintptr_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_uintptr_t" = no- then-- fptools_cv_htype_uintptr_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_uintptr_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintptr_t" >&5-printf "%s\n" "$fptools_cv_htype_uintptr_t" >&6; }--printf "%s\n" "#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for intmax_t" >&5-printf %s "checking Haskell type for intmax_t... " >&6; }- if test ${fptools_cv_htype_intmax_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_intmax_t=yes- if ac_fn_c_compute_int "$LINENO" "(intmax_t)0.2 - (intmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-intmax_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_intmax_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intmax_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_intmax_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_intmax_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_intmax_t=LDouble- else- fptools_cv_htype_sup_intmax_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((intmax_t)(-1)) < ((intmax_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_intmax_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_intmax_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_intmax_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_intmax_t" = no- then-- fptools_cv_htype_intmax_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_intmax_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intmax_t" >&5-printf "%s\n" "$fptools_cv_htype_intmax_t" >&6; }--printf "%s\n" "#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t" >>confdefs.h-- fi----------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintmax_t" >&5-printf %s "checking Haskell type for uintmax_t... " >&6; }- if test ${fptools_cv_htype_uintmax_t+y}-then :- printf %s "(cached) " >&6-else $as_nop-- fptools_cv_htype_sup_uintmax_t=yes- if ac_fn_c_compute_int "$LINENO" "(uintmax_t)0.2 - (uintmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- HTYPE_IS_INTEGRAL=0-fi--- if test "$HTYPE_IS_INTEGRAL" -eq 0- then- cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>--int-main (void)-{-uintmax_t val; *val;-- ;- return 0;-}-_ACEOF-if ac_fn_c_try_compile "$LINENO"-then :- HTYPE_IS_POINTER=yes-else $as_nop- HTYPE_IS_POINTER=no-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext-- if test "$HTYPE_IS_POINTER" = yes- then- fptools_cv_htype_uintmax_t="Ptr ()"- else- if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(float)" "HTYPE_IS_FLOAT" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintmax_t=no-fi-- if test "$HTYPE_IS_FLOAT" -eq 1- then- fptools_cv_htype_uintmax_t=Float- elif test "$HTYPE_IS_DOUBLE" -eq 1- then- fptools_cv_htype_uintmax_t=Double- elif test "$HTYPE_IS_LDOUBLE" -eq 1- then- fptools_cv_htype_uintmax_t=LDouble- else- fptools_cv_htype_sup_uintmax_t=no- fi- fi- else- if ac_fn_c_compute_int "$LINENO" "((uintmax_t)(-1)) < ((uintmax_t)0)" "HTYPE_IS_SIGNED" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintmax_t=no-fi-- if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) * 8" "HTYPE_SIZE" "-#include <stdbool.h>-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-# include <stdint.h>-# endif-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#if HAVE_POLL_H-# include <poll.h>-#endif--#if HAVE_SYS_SOCKET_H-# include <sys/socket.h>-#endif--#include <stdlib.h>-"-then :--else $as_nop- fptools_cv_htype_sup_uintmax_t=no-fi-- if test "$HTYPE_IS_SIGNED" -eq 0- then- fptools_cv_htype_uintmax_t="Word$HTYPE_SIZE"- else- fptools_cv_htype_uintmax_t="Int$HTYPE_SIZE"- fi- fi--fi-- if test "$fptools_cv_htype_sup_uintmax_t" = no- then-- fptools_cv_htype_uintmax_t=NotReallyAType- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5-printf "%s\n" "not supported" >&6; }-- fi-- if test "$fptools_cv_htype_sup_uintmax_t" = yes; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintmax_t" >&5-printf "%s\n" "$fptools_cv_htype_uintmax_t" >&6; }--printf "%s\n" "#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t" >>confdefs.h-- fi----# test errno values-for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR ENOTSUP-do-as_fp_Cache=`printf "%s\n" "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5-printf %s "checking value of $fp_const_name... " >&6; }-if eval test \${$as_fp_Cache+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result" "#include <stdio.h>-#include <errno.h>-"-then :--else $as_nop- fp_check_const_result='-1'-fi--eval "$as_fp_Cache=\$fp_check_const_result"-fi-eval ac_res=\$$as_fp_Cache- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `printf "%s\n" "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};printf "%s\n" "$as_val"'`-_ACEOF--done---# we need SIGINT in TopHandler.lhs-for fp_const_name in SIGINT-do-as_fp_Cache=`printf "%s\n" "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5-printf %s "checking value of $fp_const_name... " >&6; }-if eval test \${$as_fp_Cache+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result" "-#if HAVE_SIGNAL_H-#include <signal.h>-#endif-"-then :--else $as_nop- fp_check_const_result='-1'-fi--eval "$as_fp_Cache=\$fp_check_const_result"-fi-eval ac_res=\$$as_fp_Cache- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5-printf "%s\n" "$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `printf "%s\n" "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};printf "%s\n" "$as_val"'`-_ACEOF--done---{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking value of O_BINARY" >&5-printf %s "checking value of O_BINARY... " >&6; }-if test ${fp_cv_const_O_BINARY+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "O_BINARY" "fp_check_const_result" "#include <fcntl.h>-"-then :--else $as_nop- fp_check_const_result=0-fi--fp_cv_const_O_BINARY=$fp_check_const_result-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fp_cv_const_O_BINARY" >&5-printf "%s\n" "$fp_cv_const_O_BINARY" >&6; }-printf "%s\n" "#define CONST_O_BINARY $fp_cv_const_O_BINARY" >>confdefs.h---# We don't use iconv or libcharset on Windows, but if configure finds-# them then it can cause problems. So we don't even try looking if-# we are on Windows.-# See http://www.haskell.org/pipermail/cvs-ghc/2011-September/065980.html-if test "$WINDOWS" = "NO"-then--# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h-# header needs to be included as iconv_open is #define'd to something-# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us-# to give prototype text.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5-printf %s "checking for library containing iconv... " >&6; }-if test ${ac_cv_search_iconv+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_func_search_save_LIBS=$LIBS-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */--#include <stddef.h>-#include <iconv.h>--int-main (void)-{-iconv_t cd;- cd = iconv_open("", "");- iconv(cd,NULL,NULL,NULL,NULL);- iconv_close(cd);- ;- return 0;-}-_ACEOF-for ac_lib in '' iconv; do- if test -z "$ac_lib"; then- ac_res="none required"- else- ac_res=-l$ac_lib- LIBS="-l$ac_lib $ac_func_search_save_LIBS"- fi- if ac_fn_c_try_link "$LINENO"-then :- ac_cv_search_iconv=$ac_res-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam \- conftest$ac_exeext- if test ${ac_cv_search_iconv+y}-then :- break-fi-done-if test ${ac_cv_search_iconv+y}-then :--else $as_nop- ac_cv_search_iconv=no-fi-rm conftest.$ac_ext-LIBS=$ac_func_search_save_LIBS-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5-printf "%s\n" "$ac_cv_search_iconv" >&6; }-ac_res=$ac_cv_search_iconv-if test "$ac_res" != no-then :- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"- EXTRA_LIBS="$EXTRA_LIBS $ac_lib"-else $as_nop- as_fn_error $? "iconv is required on non-Windows platforms" "$LINENO" 5-fi--# If possible, we use libcharset instead of nl_langinfo(CODESET) to-# determine the current locale's character encoding. Allow the user-# to disable this with --without-libcharset if they don't want a-# dependency on libcharset.--# Check whether --with-libcharset was given.-if test ${with_libcharset+y}-then :- withval=$with_libcharset;-else $as_nop- with_libcharset=check-fi---if test "x$with_libcharset" != xno-then :- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing locale_charset" >&5-printf %s "checking for library containing locale_charset... " >&6; }-if test ${ac_cv_search_locale_charset+y}-then :- printf %s "(cached) " >&6-else $as_nop- ac_func_search_save_LIBS=$LIBS-cat confdefs.h - <<_ACEOF >conftest.$ac_ext-/* end confdefs.h. */-#include <libcharset.h>-int-main (void)-{-const char* charset = locale_charset();- ;- return 0;-}-_ACEOF-for ac_lib in '' charset; do- if test -z "$ac_lib"; then- ac_res="none required"- else- ac_res=-l$ac_lib- LIBS="-l$ac_lib $ac_func_search_save_LIBS"- fi- if ac_fn_c_try_link "$LINENO"-then :- ac_cv_search_locale_charset=$ac_res-fi-rm -f core conftest.err conftest.$ac_objext conftest.beam \- conftest$ac_exeext- if test ${ac_cv_search_locale_charset+y}-then :- break-fi-done-if test ${ac_cv_search_locale_charset+y}-then :--else $as_nop- ac_cv_search_locale_charset=no-fi-rm conftest.$ac_ext-LIBS=$ac_func_search_save_LIBS-fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_locale_charset" >&5-printf "%s\n" "$ac_cv_search_locale_charset" >&6; }-ac_res=$ac_cv_search_locale_charset-if test "$ac_res" != no-then :- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"--printf "%s\n" "#define HAVE_LIBCHARSET 1" >>confdefs.h-- EXTRA_LIBS="$EXTRA_LIBS $ac_lib"--fi-fi--fi--ac_fn_c_check_type "$LINENO" "struct MD5Context" "ac_cv_type_struct_MD5Context" "#include \"include/md5.h\"-"-if test "x$ac_cv_type_struct_MD5Context" = xyes-then :--else $as_nop- as_fn_error $? "internal error" "$LINENO" 5-fi--# The cast to long int works around a bug in the HP C Compiler-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.-# This bug is HP SR number 8606223364.-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of struct MD5Context" >&5-printf %s "checking size of struct MD5Context... " >&6; }-if test ${ac_cv_sizeof_struct_MD5Context+y}-then :- printf %s "(cached) " >&6-else $as_nop- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct MD5Context))" "ac_cv_sizeof_struct_MD5Context" "#include \"include/md5.h\"-"-then :--else $as_nop- if test "$ac_cv_type_struct_MD5Context" = yes; then- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}-as_fn_error 77 "cannot compute sizeof (struct MD5Context)-See \`config.log' for more details" "$LINENO" 5; }- else- ac_cv_sizeof_struct_MD5Context=0- fi-fi--fi-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_MD5Context" >&5-printf "%s\n" "$ac_cv_sizeof_struct_MD5Context" >&6; }----printf "%s\n" "#define SIZEOF_STRUCT_MD5CONTEXT $ac_cv_sizeof_struct_MD5Context" >>confdefs.h-----ac_config_files="$ac_config_files base.buildinfo"---cat >confcache <<\_ACEOF-# This file is a shell script that caches the results of configure-# tests run on this system so they can be shared between configure-# scripts and configure runs, see configure's option --config-cache.-# It is not useful on other systems. If it contains results you don't-# want to keep, you may remove or edit it.-#-# config.status only pays attention to the cache file if you give it-# the --recheck option to rerun configure.-#-# `ac_cv_env_foo' variables (set or unset) will be overridden when-# loading this file, other *unset* `ac_cv_foo' will be assigned the-# following values.--_ACEOF--# The following way of writing the cache mishandles newlines in values,-# but we know of no workaround that is simple, portable, and efficient.-# So, we kill variables containing newlines.-# Ultrix sh set writes to stderr and can't be redirected directly,-# and sets the high bit in the cache file unless we assign to the vars.-(- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do- eval ac_val=\$$ac_var- case $ac_val in #(- *${as_nl}*)- case $ac_var in #(- *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5-printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;- esac- case $ac_var in #(- _ | IFS | as_nl) ;; #(- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(- *) { eval $ac_var=; unset $ac_var;} ;;- esac ;;- esac- done-- (set) 2>&1 |- case $as_nl`(ac_space=' '; set) 2>&1` in #(- *${as_nl}ac_space=\ *)- # `set' does not quote correctly, so add quotes: double-quote- # substitution turns \\\\ into \\, and sed turns \\ into \.- sed -n \- "s/'/'\\\\''/g;- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"- ;; #(- *)- # `set' quotes correctly as required by POSIX, so do not add quotes.- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"- ;;- esac |- sort-) |- sed '- /^ac_cv_env_/b end- t clear- :clear- s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/- t end- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/- :end' >>confcache-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else- if test -w "$cache_file"; then- if test "x$cache_file" != "x/dev/null"; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5-printf "%s\n" "$as_me: updating cache $cache_file" >&6;}- if test ! -f "$cache_file" || test -h "$cache_file"; then- cat confcache >"$cache_file"- else- case $cache_file in #(- */* | ?:*)- mv -f confcache "$cache_file"$$ &&- mv -f "$cache_file"$$ "$cache_file" ;; #(- *)- mv -f confcache "$cache_file" ;;- esac- fi- fi- else- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5-printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}- fi-fi-rm -f confcache--test "x$prefix" = xNONE && prefix=$ac_default_prefix-# Let make expand exec_prefix.-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'--DEFS=-DHAVE_CONFIG_H--ac_libobjs=-ac_ltlibobjs=-U=-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue- # 1. Remove the extension, and $U if already installed.- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'- ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR- # will be set to the directory where LIBOBJS objects are built.- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'-done-LIBOBJS=$ac_libobjs--LTLIBOBJS=$ac_ltlibobjs----: "${CONFIG_STATUS=./config.status}"-ac_write_fail=0-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files $CONFIG_STATUS"-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5-printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}-as_write_fail=0-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1-#! $SHELL-# Generated by $as_me.-# Run this file to recreate the current configuration.-# Compiler output produced by configure, useful for debugging-# configure, is in config.log if it exists.--debug=false-ac_cs_recheck=false-ac_cs_silent=false--SHELL=\${CONFIG_SHELL-$SHELL}-export SHELL-_ASEOF-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1-## -------------------- ##-## M4sh Initialization. ##-## -------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-as_nop=:-if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1-then :- emulate sh- NULLCMD=:- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which- # is contrary to our usage. Disable this feature.- alias -g '${1+"$@"}'='"$@"'- setopt NO_GLOB_SUBST-else $as_nop- case `(set -o) 2>/dev/null` in #(- *posix*) :- set -o posix ;; #(- *) :- ;;-esac-fi----# Reset variables that may have inherited troublesome values from-# the environment.--# IFS needs to be set, to space, tab, and newline, in precisely that order.-# (If _AS_PATH_WALK were called with IFS unset, it would have the-# side effect of setting IFS to empty, thus disabling word splitting.)-# Quoting is to prevent editors from complaining about space-tab.-as_nl='-'-export as_nl-IFS=" "" $as_nl"--PS1='$ '-PS2='> '-PS4='+ '--# Ensure predictable behavior from utilities with locale-dependent output.-LC_ALL=C-export LC_ALL-LANGUAGE=C-export LANGUAGE--# We cannot yet rely on "unset" to work, but we need these variables-# to be unset--not just set to an empty or harmless value--now, to-# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct-# also avoids known problems related to "unset" and subshell syntax-# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).-for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH-do eval test \${$as_var+y} \- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :-done--# Ensure that fds 0, 1, and 2 are open.-if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi-if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi-if (exec 3>&2) ; then :; else exec 2>/dev/null; fi--# The user is always right.-if ${PATH_SEPARATOR+false} :; then- PATH_SEPARATOR=:- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||- PATH_SEPARATOR=';'- }-fi---# Find who we are. Look in the path if we contain no directory separator.-as_myself=-case $0 in #((- *[\\/]* ) as_myself=$0 ;;- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- case $as_dir in #(((- '') as_dir=./ ;;- */) ;;- *) as_dir=$as_dir/ ;;- esac- test -r "$as_dir$0" && as_myself=$as_dir$0 && break- done-IFS=$as_save_IFS-- ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then- as_myself=$0-fi-if test ! -f "$as_myself"; then- printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2- exit 1-fi----# as_fn_error STATUS ERROR [LINENO LOG_FD]-# -----------------------------------------# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the-# script with STATUS, using 1 if that was 0.-as_fn_error ()-{- as_status=$1; test $as_status -eq 0 && as_status=1- if test "$4"; then- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack- printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4- fi- printf "%s\n" "$as_me: error: $2" >&2- as_fn_exit $as_status-} # as_fn_error----# as_fn_set_status STATUS-# ------------------------# Set $? to STATUS, without forking.-as_fn_set_status ()-{- return $1-} # as_fn_set_status--# as_fn_exit STATUS-# ------------------# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.-as_fn_exit ()-{- set +e- as_fn_set_status $1- exit $1-} # as_fn_exit--# as_fn_unset VAR-# ----------------# Portably unset VAR.-as_fn_unset ()-{- { eval $1=; unset $1;}-}-as_unset=as_fn_unset--# as_fn_append VAR VALUE-# -----------------------# Append the text in VALUE to the end of the definition contained in VAR. Take-# advantage of any shell optimizations that allow amortized linear growth over-# repeated appends, instead of the typical quadratic growth present in naive-# implementations.-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null-then :- eval 'as_fn_append ()- {- eval $1+=\$2- }'-else $as_nop- as_fn_append ()- {- eval $1=\$$1\$2- }-fi # as_fn_append--# as_fn_arith ARG...-# -------------------# Perform arithmetic evaluation on the ARGs, and store the result in the-# global $as_val. Take advantage of shells that can avoid forks. The arguments-# must be portable across $(()) and expr.-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null-then :- eval 'as_fn_arith ()- {- as_val=$(( $* ))- }'-else $as_nop- as_fn_arith ()- {- as_val=`expr "$@" || test $? -eq 1`- }-fi # as_fn_arith---if expr a : '\(a\)' >/dev/null 2>&1 &&- test "X`expr 00001 : '.*\(...\)'`" = X001; then- as_expr=expr-else- as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then- as_basename=basename-else- as_basename=false-fi--if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then- as_dirname=dirname-else- as_dirname=false-fi--as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \- X"$0" : 'X\(//\)$' \| \- X"$0" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X/"$0" |- sed '/^.*\/\([^/][^/]*\)\/*$/{- s//\1/- q- }- /^X\/\(\/\/\)$/{- s//\1/- q- }- /^X\/\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`--# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits---# Determine whether it's possible to make 'echo' print without a newline.-# These variables are no longer used directly by Autoconf, but are AC_SUBSTed-# for compatibility with existing Makefiles.-ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in #(((((--n*)- case `echo 'xy\c'` in- *c*) ECHO_T=' ';; # ECHO_T is single tab character.- xy) ECHO_C='\c';;- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null- ECHO_T=' ';;- esac;;-*)- ECHO_N='-n';;-esac--# For backward compatibility with old third-party macros, we provide-# the shell variables $as_echo and $as_echo_n. New code should use-# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.-as_echo='printf %s\n'-as_echo_n='printf %s'--rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then- rm -f conf$$.dir/conf$$.file-else- rm -f conf$$.dir- mkdir conf$$.dir 2>/dev/null-fi-if (echo >conf$$.file) 2>/dev/null; then- if ln -s conf$$.file conf$$ 2>/dev/null; then- as_ln_s='ln -s'- # ... but there are two gotchas:- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.- # In both cases, we have to default to `cp -pR'.- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||- as_ln_s='cp -pR'- elif ln conf$$.file conf$$ 2>/dev/null; then- as_ln_s=ln- else- as_ln_s='cp -pR'- fi-else- as_ln_s='cp -pR'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null---# as_fn_mkdir_p-# --------------# Create "$as_dir" as a directory, including parents if necessary.-as_fn_mkdir_p ()-{-- case $as_dir in #(- -*) as_dir=./$as_dir;;- esac- test -d "$as_dir" || eval $as_mkdir_p || {- as_dirs=- while :; do- case $as_dir in #(- *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(- *) as_qdir=$as_dir;;- esac- as_dirs="'$as_qdir' $as_dirs"- as_dir=`$as_dirname -- "$as_dir" ||-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \- X"$as_dir" : 'X\(//\)[^/]' \| \- X"$as_dir" : 'X\(//\)$' \| \- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X"$as_dir" |- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{- s//\1/- q- }- /^X\(\/\/\)[^/].*/{- s//\1/- q- }- /^X\(\/\/\)$/{- s//\1/- q- }- /^X\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`- test -d "$as_dir" && break- done- test -z "$as_dirs" || eval "mkdir $as_dirs"- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"---} # as_fn_mkdir_p-if mkdir -p . 2>/dev/null; then- as_mkdir_p='mkdir -p "$as_dir"'-else- test -d ./-p && rmdir ./-p- as_mkdir_p=false-fi---# as_fn_executable_p FILE-# ------------------------# Test if FILE is an executable regular file.-as_fn_executable_p ()-{- test -f "$1" && test -x "$1"-} # as_fn_executable_p-as_test_x='test -x'-as_executable_p=as_fn_executable_p--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"---exec 6>&1-## ----------------------------------- ##-## Main body of $CONFIG_STATUS script. ##-## ----------------------------------- ##-_ASEOF-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# Save the log message, to keep $0 and so on meaningful, and to-# report actual input values of CONFIG_FILES etc. instead of their-# values after options handling.-ac_log="-This file was extended by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.71. Invocation command line was-- CONFIG_FILES = $CONFIG_FILES- CONFIG_HEADERS = $CONFIG_HEADERS- CONFIG_LINKS = $CONFIG_LINKS- CONFIG_COMMANDS = $CONFIG_COMMANDS- $ $0 $@--on `(hostname || uname -n) 2>/dev/null | sed 1q`-"--_ACEOF--case $ac_config_files in *"-"*) set x $ac_config_files; shift; ac_config_files=$*;;-esac--case $ac_config_headers in *"-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;-esac---cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-# Files that config.status was made for.-config_files="$ac_config_files"-config_headers="$ac_config_headers"--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-ac_cs_usage="\-\`$as_me' instantiates files and other configuration actions-from templates according to the current configuration. Unless the files-and actions are specified as TAGs, all are instantiated by default.--Usage: $0 [OPTION]... [TAG]...-- -h, --help print this help, then exit- -V, --version print version number and configuration settings, then exit- --config print configuration, then exit- -q, --quiet, --silent- do not print progress messages- -d, --debug don't remove temporary files- --recheck update $as_me by reconfiguring in the same conditions- --file=FILE[:TEMPLATE]- instantiate the configuration file FILE- --header=FILE[:TEMPLATE]- instantiate the configuration header FILE--Configuration files:-$config_files--Configuration headers:-$config_headers--Report bugs to <libraries@haskell.org>."--_ACEOF-ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`-ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-ac_cs_config='$ac_cs_config_escaped'-ac_cs_version="\\-Haskell base package config.status 1.0-configured by $0, generated by GNU Autoconf 2.71,- with options \\"\$ac_cs_config\\"--Copyright (C) 2021 Free Software Foundation, Inc.-This config.status script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it."--ac_pwd='$ac_pwd'-srcdir='$srcdir'-test -n "\$AWK" || AWK=awk-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# The default lists apply if the user does not specify any file.-ac_need_defaults=:-while test $# != 0-do- case $1 in- --*=?*)- ac_option=`expr "X$1" : 'X\([^=]*\)='`- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`- ac_shift=:- ;;- --*=)- ac_option=`expr "X$1" : 'X\([^=]*\)='`- ac_optarg=- ac_shift=:- ;;- *)- ac_option=$1- ac_optarg=$2- ac_shift=shift- ;;- esac-- case $ac_option in- # Handling of the options.- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)- ac_cs_recheck=: ;;- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )- printf "%s\n" "$ac_cs_version"; exit ;;- --config | --confi | --conf | --con | --co | --c )- printf "%s\n" "$ac_cs_config"; exit ;;- --debug | --debu | --deb | --de | --d | -d )- debug=: ;;- --file | --fil | --fi | --f )- $ac_shift- case $ac_optarg in- *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;- '') as_fn_error $? "missing file argument" ;;- esac- as_fn_append CONFIG_FILES " '$ac_optarg'"- ac_need_defaults=false;;- --header | --heade | --head | --hea )- $ac_shift- case $ac_optarg in- *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;- esac- as_fn_append CONFIG_HEADERS " '$ac_optarg'"- ac_need_defaults=false;;- --he | --h)- # Conflict between --help and --header- as_fn_error $? "ambiguous option: \`$1'-Try \`$0 --help' for more information.";;- --help | --hel | -h )- printf "%s\n" "$ac_cs_usage"; exit ;;- -q | -quiet | --quiet | --quie | --qui | --qu | --q \- | -silent | --silent | --silen | --sile | --sil | --si | --s)- ac_cs_silent=: ;;-- # This is an error.- -*) as_fn_error $? "unrecognized option: \`$1'-Try \`$0 --help' for more information." ;;-- *) as_fn_append ac_config_targets " $1"- ac_need_defaults=false ;;-- esac- shift-done--ac_configure_extra_args=--if $ac_cs_silent; then- exec 6>/dev/null- ac_configure_extra_args="$ac_configure_extra_args --silent"-fi--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-if \$ac_cs_recheck; then- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion- shift- \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6- CONFIG_SHELL='$SHELL'- export CONFIG_SHELL- exec "\$@"-fi--_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-exec 5>>config.log-{- echo- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX-## Running $as_me. ##-_ASBOX- printf "%s\n" "$ac_log"-} >&5--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1--# Handling of arguments.-for ac_config_target in $ac_config_targets-do- case $ac_config_target in- "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;- "include/EventConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/EventConfig.h" ;;- "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;-- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;- esac-done---# If the user did not use the arguments to specify the items to instantiate,-# then the envvar interface is used. Set only those that are not.-# We use the long form for the default assignment because of an extremely-# bizarre bug on SunOS 4.1.3.-if $ac_need_defaults; then- test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files- test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers-fi--# Have a temporary directory for convenience. Make it in the build tree-# simply because there is no reason against having it here, and in addition,-# creating and moving files from /tmp can sometimes cause problems.-# Hook for its removal unless debugging.-# Note that there is a small window in which the directory will not be cleaned:-# after its creation but before its name has been assigned to `$tmp'.-$debug ||-{- tmp= ac_tmp=- trap 'exit_status=$?- : "${ac_tmp:=$tmp}"- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status-' 0- trap 'as_fn_exit 1' 1 2 13 15-}-# Create a (secure) tmp directory for tmp files.--{- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&- test -d "$tmp"-} ||-{- tmp=./conf$$-$RANDOM- (umask 077 && mkdir "$tmp")-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5-ac_tmp=$tmp--# Set up the scripts for CONFIG_FILES section.-# No need to generate them if there are no CONFIG_FILES.-# This happens for instance with `./config.status config.h'.-if test -n "$CONFIG_FILES"; then---ac_cr=`echo X | tr X '\015'`-# On cygwin, bash can eat \r inside `` if the user requested igncr.-# But we know of no other shell where ac_cr would be empty at this-# point, so we can use a bashism as a fallback.-if test "x$ac_cr" = x; then- eval ac_cr=\$\'\\r\'-fi-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then- ac_cs_awk_cr='\\r'-else- ac_cs_awk_cr=$ac_cr-fi--echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&-_ACEOF---{- echo "cat >conf$$subs.awk <<_ACEOF" &&- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&- echo "_ACEOF"-} >conf$$subs.sh ||- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`-ac_delim='%!_!# '-for ac_last_try in false false false false false :; do- . ./conf$$subs.sh ||- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5-- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`- if test $ac_delim_n = $ac_delim_num; then- break- elif $ac_last_try; then- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5- else- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "- fi-done-rm -f conf$$subs.sh--cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&-_ACEOF-sed -n '-h-s/^/S["/; s/!.*/"]=/-p-g-s/^[^!]*!//-:repl-t repl-s/'"$ac_delim"'$//-t delim-:nl-h-s/\(.\{148\}\)..*/\1/-t more1-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/-p-n-b repl-:more1-s/["\\]/\\&/g; s/^/"/; s/$/"\\/-p-g-s/.\{148\}//-t nl-:delim-h-s/\(.\{148\}\)..*/\1/-t more2-s/["\\]/\\&/g; s/^/"/; s/$/"/-p-b-:more2-s/["\\]/\\&/g; s/^/"/; s/$/"\\/-p-g-s/.\{148\}//-t delim-' <conf$$subs.awk | sed '-/^[^""]/{- N- s/\n//-}-' >>$CONFIG_STATUS || ac_write_fail=1-rm -f conf$$subs.awk-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-_ACAWK-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&- for (key in S) S_is_set[key] = 1- FS = ""--}-{- line = $ 0- nfields = split(line, field, "@")- substed = 0- len = length(field[1])- for (i = 2; i < nfields; i++) {- key = field[i]- keylen = length(key)- if (S_is_set[key]) {- value = S[key]- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)- len += length(value) + length(field[++i])- substed = 1- } else- len += 1 + keylen- }-- print line-}--_ACAWK-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"-else- cat-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5-_ACEOF--# VPATH may cause trouble with some makes, so we remove sole $(srcdir),-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and-# trailing colons and then remove the whole line if VPATH becomes empty-# (actually we leave an empty line to preserve line numbers).-if test "x$srcdir" = x.; then- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{-h-s///-s/^/:/-s/[ ]*$/:/-s/:\$(srcdir):/:/g-s/:\${srcdir}:/:/g-s/:@srcdir@:/:/g-s/^:*//-s/:*$//-x-s/\(=[ ]*\).*/\1/-G-s/\n//-s/^[^=]*=[ ]*$//-}'-fi--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-fi # test -n "$CONFIG_FILES"--# Set up the scripts for CONFIG_HEADERS section.-# No need to generate them if there are no CONFIG_HEADERS.-# This happens for instance with `./config.status Makefile'.-if test -n "$CONFIG_HEADERS"; then-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||-BEGIN {-_ACEOF--# Transform confdefs.h into an awk script `defines.awk', embedded as-# here-document in config.status, that substitutes the proper values into-# config.h.in to produce config.h.--# Create a delimiter string that does not exist in confdefs.h, to ease-# handling of long lines.-ac_delim='%!_!# '-for ac_last_try in false false :; do- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`- if test -z "$ac_tt"; then- break- elif $ac_last_try; then- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5- else- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "- fi-done--# For the awk script, D is an array of macro values keyed by name,-# likewise P contains macro parameters if any. Preserve backslash-# newline sequences.--ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*-sed -n '-s/.\{148\}/&'"$ac_delim"'/g-t rset-:rset-s/^[ ]*#[ ]*define[ ][ ]*/ /-t def-d-:def-s/\\$//-t bsnl-s/["\\]/\\&/g-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\-D["\1"]=" \3"/p-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p-d-:bsnl-s/["\\]/\\&/g-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\-D["\1"]=" \3\\\\\\n"\\/p-t cont-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p-t cont-d-:cont-n-s/.\{148\}/&'"$ac_delim"'/g-t clear-:clear-s/\\$//-t bsnlc-s/["\\]/\\&/g; s/^/"/; s/$/"/p-d-:bsnlc-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p-b cont-' <confdefs.h | sed '-s/'"$ac_delim"'/"\\\-"/g' >>$CONFIG_STATUS || ac_write_fail=1--cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1- for (key in D) D_is_set[key] = 1- FS = ""-}-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {- line = \$ 0- split(line, arg, " ")- if (arg[1] == "#") {- defundef = arg[2]- mac1 = arg[3]- } else {- defundef = substr(arg[1], 2)- mac1 = arg[2]- }- split(mac1, mac2, "(") #)- macro = mac2[1]- prefix = substr(line, 1, index(line, defundef) - 1)- if (D_is_set[macro]) {- # Preserve the white space surrounding the "#".- print prefix "define", macro P[macro] D[macro]- next- } else {- # Replace #undef with comments. This is necessary, for example,- # in the case of _POSIX_SOURCE, which is predefined and required- # on some systems where configure will not decide to define it.- if (defundef == "undef") {- print "/*", prefix defundef, macro, "*/"- next- }- }-}-{ print }-_ACAWK-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5-fi # test -n "$CONFIG_HEADERS"---eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "-shift-for ac_tag-do- case $ac_tag in- :[FHLC]) ac_mode=$ac_tag; continue;;- esac- case $ac_mode$ac_tag in- :[FHL]*:*);;- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;- :[FH]-) ac_tag=-:-;;- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;- esac- ac_save_IFS=$IFS- IFS=:- set x $ac_tag- IFS=$ac_save_IFS- shift- ac_file=$1- shift-- case $ac_mode in- :L) ac_source=$1;;- :[FH])- ac_file_inputs=- for ac_f- do- case $ac_f in- -) ac_f="$ac_tmp/stdin";;- *) # Look for the file first in the build tree, then in the source tree- # (if the path is not absolute). The absolute path cannot be DOS-style,- # because $ac_f cannot contain `:'.- test -f "$ac_f" ||- case $ac_f in- [\\/$]*) false;;- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;- esac ||- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;- esac- case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac- as_fn_append ac_file_inputs " '$ac_f'"- done-- # Let's still pretend it is `configure' which instantiates (i.e., don't- # use $as_me), people would be surprised to read:- # /* config.h. Generated by config.status. */- configure_input='Generated from '`- printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'- `' by configure.'- if test x"$ac_file" != x-; then- configure_input="$ac_file. $configure_input"- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5-printf "%s\n" "$as_me: creating $ac_file" >&6;}- fi- # Neutralize special characters interpreted by sed in replacement strings.- case $configure_input in #(- *\&* | *\|* | *\\* )- ac_sed_conf_input=`printf "%s\n" "$configure_input" |- sed 's/[\\\\&|]/\\\\&/g'`;; #(- *) ac_sed_conf_input=$configure_input;;- esac-- case $ac_tag in- *:-:* | *:-) cat >"$ac_tmp/stdin" \- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;- esac- ;;- esac-- ac_dir=`$as_dirname -- "$ac_file" ||-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \- X"$ac_file" : 'X\(//\)[^/]' \| \- X"$ac_file" : 'X\(//\)$' \| \- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||-printf "%s\n" X"$ac_file" |- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{- s//\1/- q- }- /^X\(\/\/\)[^/].*/{- s//\1/- q- }- /^X\(\/\/\)$/{- s//\1/- q- }- /^X\(\/\).*/{- s//\1/- q- }- s/.*/./; q'`- as_dir="$ac_dir"; as_fn_mkdir_p- ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)- ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`- # A ".." for each directory in $ac_dir_suffix.- ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`- case $ac_top_builddir_sub in- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;- esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in- .) # We are building in place.- ac_srcdir=.- ac_top_srcdir=$ac_top_builddir_sub- ac_abs_top_srcdir=$ac_pwd ;;- [\\/]* | ?:[\\/]* ) # Absolute name.- ac_srcdir=$srcdir$ac_dir_suffix;- ac_top_srcdir=$srcdir- ac_abs_top_srcdir=$srcdir ;;- *) # Relative name.- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix- ac_top_srcdir=$ac_top_build_prefix$srcdir- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix--- case $ac_mode in- :F)- #- # CONFIG_FILE- #--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-# If the template does not know about datarootdir, expand it.-# FIXME: This hack should be removed a few years after 2.60.-ac_datarootdir_hack=; ac_datarootdir_seen=-ac_sed_dataroot='-/datarootdir/ {- p- q-}-/@datadir@/p-/@docdir@/p-/@infodir@/p-/@localedir@/p-/@mandir@/p'-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in-*datarootdir*) ac_datarootdir_seen=yes;;-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5-printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}-_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1- ac_datarootdir_hack='- s&@datadir@&$datadir&g- s&@docdir@&$docdir&g- s&@infodir@&$infodir&g- s&@localedir@&$localedir&g- s&@mandir@&$mandir&g- s&\\\${datarootdir}&$datarootdir&g' ;;-esac-_ACEOF--# Neutralize VPATH when `$srcdir' = `.'.-# Shell code in configure.ac might set extrasub.-# FIXME: do we really want to maintain this feature?-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1-ac_sed_extra="$ac_vpsub-$extrasub-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1-:t-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b-s|@configure_input@|$ac_sed_conf_input|;t t-s&@top_builddir@&$ac_top_builddir_sub&;t t-s&@top_build_prefix@&$ac_top_build_prefix&;t t-s&@srcdir@&$ac_srcdir&;t t-s&@abs_srcdir@&$ac_abs_srcdir&;t t-s&@top_srcdir@&$ac_top_srcdir&;t t-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t-s&@builddir@&$ac_builddir&;t t-s&@abs_builddir@&$ac_abs_builddir&;t t-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t-$ac_datarootdir_hack-"-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5--test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \- "$ac_tmp/out"`; test -z "$ac_out"; } &&- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined. Please make sure it is defined" >&5-printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined. Please make sure it is defined" >&2;}-- rm -f "$ac_tmp/stdin"- case $ac_file in- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;- esac \- || as_fn_error $? "could not create $ac_file" "$LINENO" 5- ;;- :H)- #- # CONFIG_HEADER- #- if test x"$ac_file" != x-; then- {- printf "%s\n" "/* $configure_input */" >&1 \- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"- } >"$ac_tmp/config.h" \- || as_fn_error $? "could not create $ac_file" "$LINENO" 5- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5-printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}- else- rm -f "$ac_file"- mv "$ac_tmp/config.h" "$ac_file" \- || as_fn_error $? "could not create $ac_file" "$LINENO" 5- fi- else- printf "%s\n" "/* $configure_input */" >&1 \- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \- || as_fn_error $? "could not create -" "$LINENO" 5- fi- ;;--- esac--done # for ac_tag---as_fn_exit 0-_ACEOF-ac_clean_files=$ac_clean_files_save--test $ac_write_fail = 0 ||- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5---# configure is writing to config.log, and then calls config.status.-# config.status does its own redirection, appending to config.log.-# Unfortunately, on DOS this fails, as config.log is still kept open-# by configure, so config.status won't be able to write to it; its-# output is simply discarded. So we exec the FD to /dev/null,-# effectively closing config.log, so it can be properly (re)opened and-# appended to by config.status. When coming back to configure, we-# need to make the FD available again.-if test "$no_create" != yes; then- ac_cs_success=:- ac_config_status_args=- test "$silent" = yes &&- ac_config_status_args="$ac_config_status_args --quiet"- exec 5>/dev/null- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false- exec 5>>config.log- # Use ||, not &&, to avoid exiting from the if with $? = 1, which- # would make configure fail if this is the last instruction.- $ac_cs_success || as_fn_exit 1-fi-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5-printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}-fi-+# Generated by GNU Autoconf 2.69 for Haskell base package 1.0.+#+# Report bugs to <libraries@haskell.org>.+#+#+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.+#+#+# This configure script is free software; the Free Software Foundation+# gives unlimited permission to copy, distribute and modify it.+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+ emulate sh+ NULLCMD=:+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+ # is contrary to our usage. Disable this feature.+ alias -g '${1+"$@"}'='"$@"'+ setopt NO_GLOB_SUBST+else+ case `(set -o) 2>/dev/null` in #(+ *posix*) :+ set -o posix ;; #(+ *) :+ ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+ as_echo='print -r --'+ as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+ as_echo='printf %s\n'+ as_echo_n='printf %s'+else+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+ as_echo_n='/usr/ucb/echo -n'+ else+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+ as_echo_n_body='eval+ arg=$1;+ case $arg in #(+ *"$as_nl"*)+ expr "X$arg" : "X\\(.*\\)$as_nl";+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+ esac;+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+ '+ export as_echo_n_body+ as_echo_n='sh -c $as_echo_n_body as_echo'+ fi+ export as_echo_body+ as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+ PATH_SEPARATOR=:+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+ PATH_SEPARATOR=';'+ }+fi+++# IFS+# We need space, tab and new line, in precisely that order. Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" "" $as_nl"++# Find who we are. Look in the path if we contain no directory separator.+as_myself=+case $0 in #((+ *[\\/]* ) as_myself=$0 ;;+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+ done+IFS=$as_save_IFS++ ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+ as_myself=$0+fi+if test ! -f "$as_myself"; then+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+ exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there. '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH++# Use a proper internal environment variable to ensure we don't fall+ # into an infinite loop, continuously re-executing ourselves.+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then+ _as_can_reexec=no; export _as_can_reexec;+ # We cannot yet assume a decent shell, so we have to provide a+# neutralization value for shells without unset; and this also+# works around shells that cannot unset nonexistent variables.+# Preserve -v and -x to the replacement shell.+BASH_ENV=/dev/null+ENV=/dev/null+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV+case $- in # ((((+ *v*x* | *x*v* ) as_opts=-vx ;;+ *v* ) as_opts=-v ;;+ *x* ) as_opts=-x ;;+ * ) as_opts= ;;+esac+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}+# Admittedly, this is quite paranoid, since all the known shells bail+# out after a failed `exec'.+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2+as_fn_exit 255+ fi+ # We don't want this to propagate to other subprocesses.+ { _as_can_reexec=; unset _as_can_reexec;}+if test "x$CONFIG_SHELL" = x; then+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :+ emulate sh+ NULLCMD=:+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which+ # is contrary to our usage. Disable this feature.+ alias -g '\${1+\"\$@\"}'='\"\$@\"'+ setopt NO_GLOB_SUBST+else+ case \`(set -o) 2>/dev/null\` in #(+ *posix*) :+ set -o posix ;; #(+ *) :+ ;;+esac+fi+"+ as_required="as_fn_return () { (exit \$1); }+as_fn_success () { as_fn_return 0; }+as_fn_failure () { as_fn_return 1; }+as_fn_ret_success () { return 0; }+as_fn_ret_failure () { return 1; }++exitcode=0+as_fn_success || { exitcode=1; echo as_fn_success failed.; }+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :++else+ exitcode=1; echo positional parameters were not saved.+fi+test x\$exitcode = x0 || exit 1+test -x / || exit 1"+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1+test \$(( 1 + 1 )) = 2 || exit 1"+ if (eval "$as_required") 2>/dev/null; then :+ as_have_required=yes+else+ as_have_required=no+fi+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :++else+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+as_found=false+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ as_found=:+ case $as_dir in #(+ /*)+ for as_base in sh bash ksh sh5; do+ # Try only shells that exist, to save several forks.+ as_shell=$as_dir/$as_base+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :+ CONFIG_SHELL=$as_shell as_have_required=yes+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :+ break 2+fi+fi+ done;;+ esac+ as_found=false+done+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :+ CONFIG_SHELL=$SHELL as_have_required=yes+fi; }+IFS=$as_save_IFS+++ if test "x$CONFIG_SHELL" != x; then :+ export CONFIG_SHELL+ # We cannot yet assume a decent shell, so we have to provide a+# neutralization value for shells without unset; and this also+# works around shells that cannot unset nonexistent variables.+# Preserve -v and -x to the replacement shell.+BASH_ENV=/dev/null+ENV=/dev/null+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV+case $- in # ((((+ *v*x* | *x*v* ) as_opts=-vx ;;+ *v* ) as_opts=-v ;;+ *x* ) as_opts=-x ;;+ * ) as_opts= ;;+esac+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}+# Admittedly, this is quite paranoid, since all the known shells bail+# out after a failed `exec'.+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2+exit 255+fi++ if test x$as_have_required = xno; then :+ $as_echo "$0: This script requires a shell more modern than all"+ $as_echo "$0: the shells that I found on your system."+ if test x${ZSH_VERSION+set} = xset ; then+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."+ else+ $as_echo "$0: Please tell bug-autoconf@gnu.org and+$0: libraries@haskell.org about your system, including any+$0: error possibly output before this message. Then install+$0: a modern shell, or manually run the script under such a+$0: shell if you do have one."+ fi+ exit 1+fi+fi+fi+SHELL=${CONFIG_SHELL-/bin/sh}+export SHELL+# Unset more variables known to interfere with behavior of common tools.+CLICOLOR_FORCE= GREP_OPTIONS=+unset CLICOLOR_FORCE GREP_OPTIONS++## --------------------- ##+## M4sh Shell Functions. ##+## --------------------- ##+# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+ { eval $1=; unset $1;}+}+as_unset=as_fn_unset++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+ return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+ set +e+ as_fn_set_status $1+ exit $1+} # as_fn_exit++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++ case $as_dir in #(+ -*) as_dir=./$as_dir;;+ esac+ test -d "$as_dir" || eval $as_mkdir_p || {+ as_dirs=+ while :; do+ case $as_dir in #(+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+ *) as_qdir=$as_dir;;+ esac+ as_dirs="'$as_qdir' $as_dirs"+ as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$as_dir" : 'X\(//\)[^/]' \| \+ X"$as_dir" : 'X\(//\)$' \| \+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+ s//\1/+ q+ }+ /^X\(\/\/\)[^/].*/{+ s//\1/+ q+ }+ /^X\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`+ test -d "$as_dir" && break+ done+ test -z "$as_dirs" || eval "mkdir $as_dirs"+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"+++} # as_fn_mkdir_p++# as_fn_executable_p FILE+# -----------------------+# Test if FILE is an executable regular file.+as_fn_executable_p ()+{+ test -f "$1" && test -x "$1"+} # as_fn_executable_p+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+ eval 'as_fn_append ()+ {+ eval $1+=\$2+ }'+else+ as_fn_append ()+ {+ eval $1=\$$1\$2+ }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+ eval 'as_fn_arith ()+ {+ as_val=$(( $* ))+ }'+else+ as_fn_arith ()+ {+ as_val=`expr "$@" || test $? -eq 1`+ }+fi # as_fn_arith+++# as_fn_error STATUS ERROR [LINENO LOG_FD]+# ----------------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with STATUS, using 1 if that was 0.+as_fn_error ()+{+ as_status=$1; test $as_status -eq 0 && as_status=1+ if test "$4"; then+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4+ fi+ $as_echo "$as_me: error: $2" >&2+ as_fn_exit $as_status+} # as_fn_error++if expr a : '\(a\)' >/dev/null 2>&1 &&+ test "X`expr 00001 : '.*\(...\)'`" = X001; then+ as_expr=expr+else+ as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+ as_basename=basename+else+ as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+ as_dirname=dirname+else+ as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+ X"$0" : 'X\(//\)$' \| \+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+ sed '/^.*\/\([^/][^/]*\)\/*$/{+ s//\1/+ q+ }+ /^X\/\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\/\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits+++ as_lineno_1=$LINENO as_lineno_1a=$LINENO+ as_lineno_2=$LINENO as_lineno_2a=$LINENO+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)+ sed -n '+ p+ /[$]LINENO/=+ ' <$as_myself |+ sed '+ s/[$]LINENO.*/&-/+ t lineno+ b+ :lineno+ N+ :loop+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/+ t loop+ s/-\n.*//+ ' >$as_me.lineno &&+ chmod +x "$as_me.lineno" ||+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }++ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have+ # already done that, so ensure we don't try to do so again and fall+ # in an infinite loop. This has already happened in practice.+ _as_can_reexec=no; export _as_can_reexec+ # Don't try to exec as it changes $[0], causing all sort of problems+ # (the dirname of $[0] is not the place where we might find the+ # original and so on. Autoconf is especially sensitive to this).+ . "./$as_me.lineno"+ # Exit status is that of the last command.+ exit+}++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+ case `echo 'xy\c'` in+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.+ xy) ECHO_C='\c';;+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null+ ECHO_T=' ';;+ esac;;+*)+ ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+ rm -f conf$$.dir/conf$$.file+else+ rm -f conf$$.dir+ mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+ if ln -s conf$$.file conf$$ 2>/dev/null; then+ as_ln_s='ln -s'+ # ... but there are two gotchas:+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+ # In both cases, we have to default to `cp -pR'.+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+ as_ln_s='cp -pR'+ elif ln conf$$.file conf$$ 2>/dev/null; then+ as_ln_s=ln+ else+ as_ln_s='cp -pR'+ fi+else+ as_ln_s='cp -pR'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null++if mkdir -p . 2>/dev/null; then+ as_mkdir_p='mkdir -p "$as_dir"'+else+ test -d ./-p && rmdir ./-p+ as_mkdir_p=false+fi++as_test_x='test -x'+as_executable_p=as_fn_executable_p++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++test -n "$DJDIR" || exec 7<&0 </dev/null+exec 6>&1++# Name of the host.+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,+# so uname gets run too.+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`++#+# Initializations.+#+ac_default_prefix=/usr/local+ac_clean_files=+ac_config_libobj_dir=.+LIBOBJS=+cross_compiling=no+subdirs=+MFLAGS=+MAKEFLAGS=++# Identity of this package.+PACKAGE_NAME='Haskell base package'+PACKAGE_TARNAME='base'+PACKAGE_VERSION='1.0'+PACKAGE_STRING='Haskell base package 1.0'+PACKAGE_BUGREPORT='libraries@haskell.org'+PACKAGE_URL=''++ac_unique_file="include/HsBase.h"+# Factoring default headers for most tests.+ac_includes_default="\+#include <stdio.h>+#ifdef HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif+#ifdef HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif+#ifdef STDC_HEADERS+# include <stdlib.h>+# include <stddef.h>+#else+# ifdef HAVE_STDLIB_H+# include <stdlib.h>+# endif+#endif+#ifdef HAVE_STRING_H+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H+# include <memory.h>+# endif+# include <string.h>+#endif+#ifdef HAVE_STRINGS_H+# include <strings.h>+#endif+#ifdef HAVE_INTTYPES_H+# include <inttypes.h>+#endif+#ifdef HAVE_STDINT_H+# include <stdint.h>+#endif+#ifdef HAVE_UNISTD_H+# include <unistd.h>+#endif"++ac_subst_vars='LTLIBOBJS+LIBOBJS+EXTRA_LIBS+ICONV_LIB_DIRS+ICONV_INCLUDE_DIRS+EGREP+GREP+CPP+OBJEXT+EXEEXT+ac_ct_CC+CPPFLAGS+LDFLAGS+CFLAGS+CC+target_alias+host_alias+build_alias+LIBS+ECHO_T+ECHO_N+ECHO_C+DEFS+mandir+localedir+libdir+psdir+pdfdir+dvidir+htmldir+infodir+docdir+oldincludedir+includedir+localstatedir+sharedstatedir+sysconfdir+datadir+datarootdir+libexecdir+sbindir+bindir+program_transform_name+prefix+exec_prefix+PACKAGE_URL+PACKAGE_BUGREPORT+PACKAGE_STRING+PACKAGE_VERSION+PACKAGE_TARNAME+PACKAGE_NAME+PATH_SEPARATOR+SHELL'+ac_subst_files=''+ac_user_opts='+enable_option_checking+enable_largefile+with_iconv_includes+with_iconv_libraries+with_libcharset+'+ ac_precious_vars='build_alias+host_alias+target_alias+CC+CFLAGS+LDFLAGS+LIBS+CPPFLAGS+CPP'+++# Initialize some variables set by options.+ac_init_help=+ac_init_version=false+ac_unrecognized_opts=+ac_unrecognized_sep=+# The variables have the same names as the options, with+# dashes changed to underlines.+cache_file=/dev/null+exec_prefix=NONE+no_create=+no_recursion=+prefix=NONE+program_prefix=NONE+program_suffix=NONE+program_transform_name=s,x,x,+silent=+site=+srcdir=+verbose=+x_includes=NONE+x_libraries=NONE++# Installation directory options.+# These are left unexpanded so users can "make install exec_prefix=/foo"+# and all the variables that are supposed to be based on exec_prefix+# by default will actually change.+# Use braces instead of parens because sh, perl, etc. also accept them.+# (The list follows the same order as the GNU Coding Standards.)+bindir='${exec_prefix}/bin'+sbindir='${exec_prefix}/sbin'+libexecdir='${exec_prefix}/libexec'+datarootdir='${prefix}/share'+datadir='${datarootdir}'+sysconfdir='${prefix}/etc'+sharedstatedir='${prefix}/com'+localstatedir='${prefix}/var'+includedir='${prefix}/include'+oldincludedir='/usr/include'+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'+infodir='${datarootdir}/info'+htmldir='${docdir}'+dvidir='${docdir}'+pdfdir='${docdir}'+psdir='${docdir}'+libdir='${exec_prefix}/lib'+localedir='${datarootdir}/locale'+mandir='${datarootdir}/man'++ac_prev=+ac_dashdash=+for ac_option+do+ # If the previous option needs an argument, assign it.+ if test -n "$ac_prev"; then+ eval $ac_prev=\$ac_option+ ac_prev=+ continue+ fi++ case $ac_option in+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;+ *=) ac_optarg= ;;+ *) ac_optarg=yes ;;+ esac++ # Accept the important Cygnus configure options, so we can diagnose typos.++ case $ac_dashdash$ac_option in+ --)+ ac_dashdash=yes ;;++ -bindir | --bindir | --bindi | --bind | --bin | --bi)+ ac_prev=bindir ;;+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)+ bindir=$ac_optarg ;;++ -build | --build | --buil | --bui | --bu)+ ac_prev=build_alias ;;+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)+ build_alias=$ac_optarg ;;++ -cache-file | --cache-file | --cache-fil | --cache-fi \+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)+ ac_prev=cache_file ;;+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)+ cache_file=$ac_optarg ;;++ --config-cache | -C)+ cache_file=config.cache ;;++ -datadir | --datadir | --datadi | --datad)+ ac_prev=datadir ;;+ -datadir=* | --datadir=* | --datadi=* | --datad=*)+ datadir=$ac_optarg ;;++ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \+ | --dataroo | --dataro | --datar)+ ac_prev=datarootdir ;;+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)+ datarootdir=$ac_optarg ;;++ -disable-* | --disable-*)+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+ as_fn_error $? "invalid feature name: $ac_useropt"+ ac_useropt_orig=$ac_useropt+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+ case $ac_user_opts in+ *"+"enable_$ac_useropt"+"*) ;;+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"+ ac_unrecognized_sep=', ';;+ esac+ eval enable_$ac_useropt=no ;;++ -docdir | --docdir | --docdi | --doc | --do)+ ac_prev=docdir ;;+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)+ docdir=$ac_optarg ;;++ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)+ ac_prev=dvidir ;;+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)+ dvidir=$ac_optarg ;;++ -enable-* | --enable-*)+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+ as_fn_error $? "invalid feature name: $ac_useropt"+ ac_useropt_orig=$ac_useropt+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+ case $ac_user_opts in+ *"+"enable_$ac_useropt"+"*) ;;+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"+ ac_unrecognized_sep=', ';;+ esac+ eval enable_$ac_useropt=\$ac_optarg ;;++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \+ | --exec | --exe | --ex)+ ac_prev=exec_prefix ;;+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \+ | --exec=* | --exe=* | --ex=*)+ exec_prefix=$ac_optarg ;;++ -gas | --gas | --ga | --g)+ # Obsolete; use --with-gas.+ with_gas=yes ;;++ -help | --help | --hel | --he | -h)+ ac_init_help=long ;;+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)+ ac_init_help=recursive ;;+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)+ ac_init_help=short ;;++ -host | --host | --hos | --ho)+ ac_prev=host_alias ;;+ -host=* | --host=* | --hos=* | --ho=*)+ host_alias=$ac_optarg ;;++ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)+ ac_prev=htmldir ;;+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \+ | --ht=*)+ htmldir=$ac_optarg ;;++ -includedir | --includedir | --includedi | --included | --include \+ | --includ | --inclu | --incl | --inc)+ ac_prev=includedir ;;+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \+ | --includ=* | --inclu=* | --incl=* | --inc=*)+ includedir=$ac_optarg ;;++ -infodir | --infodir | --infodi | --infod | --info | --inf)+ ac_prev=infodir ;;+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)+ infodir=$ac_optarg ;;++ -libdir | --libdir | --libdi | --libd)+ ac_prev=libdir ;;+ -libdir=* | --libdir=* | --libdi=* | --libd=*)+ libdir=$ac_optarg ;;++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \+ | --libexe | --libex | --libe)+ ac_prev=libexecdir ;;+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \+ | --libexe=* | --libex=* | --libe=*)+ libexecdir=$ac_optarg ;;++ -localedir | --localedir | --localedi | --localed | --locale)+ ac_prev=localedir ;;+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)+ localedir=$ac_optarg ;;++ -localstatedir | --localstatedir | --localstatedi | --localstated \+ | --localstate | --localstat | --localsta | --localst | --locals)+ ac_prev=localstatedir ;;+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)+ localstatedir=$ac_optarg ;;++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)+ ac_prev=mandir ;;+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)+ mandir=$ac_optarg ;;++ -nfp | --nfp | --nf)+ # Obsolete; use --without-fp.+ with_fp=no ;;++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \+ | --no-cr | --no-c | -n)+ no_create=yes ;;++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)+ no_recursion=yes ;;++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \+ | --oldin | --oldi | --old | --ol | --o)+ ac_prev=oldincludedir ;;+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)+ oldincludedir=$ac_optarg ;;++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)+ ac_prev=prefix ;;+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)+ prefix=$ac_optarg ;;++ -program-prefix | --program-prefix | --program-prefi | --program-pref \+ | --program-pre | --program-pr | --program-p)+ ac_prev=program_prefix ;;+ -program-prefix=* | --program-prefix=* | --program-prefi=* \+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)+ program_prefix=$ac_optarg ;;++ -program-suffix | --program-suffix | --program-suffi | --program-suff \+ | --program-suf | --program-su | --program-s)+ ac_prev=program_suffix ;;+ -program-suffix=* | --program-suffix=* | --program-suffi=* \+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)+ program_suffix=$ac_optarg ;;++ -program-transform-name | --program-transform-name \+ | --program-transform-nam | --program-transform-na \+ | --program-transform-n | --program-transform- \+ | --program-transform | --program-transfor \+ | --program-transfo | --program-transf \+ | --program-trans | --program-tran \+ | --progr-tra | --program-tr | --program-t)+ ac_prev=program_transform_name ;;+ -program-transform-name=* | --program-transform-name=* \+ | --program-transform-nam=* | --program-transform-na=* \+ | --program-transform-n=* | --program-transform-=* \+ | --program-transform=* | --program-transfor=* \+ | --program-transfo=* | --program-transf=* \+ | --program-trans=* | --program-tran=* \+ | --progr-tra=* | --program-tr=* | --program-t=*)+ program_transform_name=$ac_optarg ;;++ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)+ ac_prev=pdfdir ;;+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)+ pdfdir=$ac_optarg ;;++ -psdir | --psdir | --psdi | --psd | --ps)+ ac_prev=psdir ;;+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+ psdir=$ac_optarg ;;++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil)+ silent=yes ;;++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)+ ac_prev=sbindir ;;+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \+ | --sbi=* | --sb=*)+ sbindir=$ac_optarg ;;++ -sharedstatedir | --sharedstatedir | --sharedstatedi \+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \+ | --sharedst | --shareds | --shared | --share | --shar \+ | --sha | --sh)+ ac_prev=sharedstatedir ;;+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \+ | --sha=* | --sh=*)+ sharedstatedir=$ac_optarg ;;++ -site | --site | --sit)+ ac_prev=site ;;+ -site=* | --site=* | --sit=*)+ site=$ac_optarg ;;++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)+ ac_prev=srcdir ;;+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)+ srcdir=$ac_optarg ;;++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \+ | --syscon | --sysco | --sysc | --sys | --sy)+ ac_prev=sysconfdir ;;+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)+ sysconfdir=$ac_optarg ;;++ -target | --target | --targe | --targ | --tar | --ta | --t)+ ac_prev=target_alias ;;+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)+ target_alias=$ac_optarg ;;++ -v | -verbose | --verbose | --verbos | --verbo | --verb)+ verbose=yes ;;++ -version | --version | --versio | --versi | --vers | -V)+ ac_init_version=: ;;++ -with-* | --with-*)+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+ as_fn_error $? "invalid package name: $ac_useropt"+ ac_useropt_orig=$ac_useropt+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+ case $ac_user_opts in+ *"+"with_$ac_useropt"+"*) ;;+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"+ ac_unrecognized_sep=', ';;+ esac+ eval with_$ac_useropt=\$ac_optarg ;;++ -without-* | --without-*)+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`+ # Reject names that are not valid shell variable names.+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+ as_fn_error $? "invalid package name: $ac_useropt"+ ac_useropt_orig=$ac_useropt+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+ case $ac_user_opts in+ *"+"with_$ac_useropt"+"*) ;;+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"+ ac_unrecognized_sep=', ';;+ esac+ eval with_$ac_useropt=no ;;++ --x)+ # Obsolete; use --with-x.+ with_x=yes ;;++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \+ | --x-incl | --x-inc | --x-in | --x-i)+ ac_prev=x_includes ;;+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)+ x_includes=$ac_optarg ;;++ -x-libraries | --x-libraries | --x-librarie | --x-librari \+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)+ ac_prev=x_libraries ;;+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)+ x_libraries=$ac_optarg ;;++ -*) as_fn_error $? "unrecognized option: \`$ac_option'+Try \`$0 --help' for more information"+ ;;++ *=*)+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`+ # Reject names that are not valid shell variable names.+ case $ac_envvar in #(+ '' | [0-9]* | *[!_$as_cr_alnum]* )+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;+ esac+ eval $ac_envvar=\$ac_optarg+ export $ac_envvar ;;++ *)+ # FIXME: should be removed in autoconf 3.0.+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"+ ;;++ esac+done++if test -n "$ac_prev"; then+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`+ as_fn_error $? "missing argument to $ac_option"+fi++if test -n "$ac_unrecognized_opts"; then+ case $enable_option_checking in+ no) ;;+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;+ esac+fi++# Check all directory arguments for consistency.+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \+ datadir sysconfdir sharedstatedir localstatedir includedir \+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \+ libdir localedir mandir+do+ eval ac_val=\$$ac_var+ # Remove trailing slashes.+ case $ac_val in+ */ )+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`+ eval $ac_var=\$ac_val;;+ esac+ # Be sure to have absolute directory names.+ case $ac_val in+ [\\/$]* | ?:[\\/]* ) continue;;+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;+ esac+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"+done++# There might be people who depend on the old broken behavior: `$host'+# used to hold the argument of --host etc.+# FIXME: To remove some day.+build=$build_alias+host=$host_alias+target=$target_alias++# FIXME: To remove some day.+if test "x$host_alias" != x; then+ if test "x$build_alias" = x; then+ cross_compiling=maybe+ elif test "x$build_alias" != "x$host_alias"; then+ cross_compiling=yes+ fi+fi++ac_tool_prefix=+test -n "$host_alias" && ac_tool_prefix=$host_alias-++test "$silent" = yes && exec 6>/dev/null+++ac_pwd=`pwd` && test -n "$ac_pwd" &&+ac_ls_di=`ls -di .` &&+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||+ as_fn_error $? "working directory cannot be determined"+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||+ as_fn_error $? "pwd does not report name of working directory"+++# Find the source files, if location was not specified.+if test -z "$srcdir"; then+ ac_srcdir_defaulted=yes+ # Try the directory containing this script, then the parent directory.+ ac_confdir=`$as_dirname -- "$as_myself" ||+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$as_myself" : 'X\(//\)[^/]' \| \+ X"$as_myself" : 'X\(//\)$' \| \+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_myself" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+ s//\1/+ q+ }+ /^X\(\/\/\)[^/].*/{+ s//\1/+ q+ }+ /^X\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`+ srcdir=$ac_confdir+ if test ! -r "$srcdir/$ac_unique_file"; then+ srcdir=..+ fi+else+ ac_srcdir_defaulted=no+fi+if test ! -r "$srcdir/$ac_unique_file"; then+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"+fi+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"+ac_abs_confdir=`(+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"+ pwd)`+# When building in place, set srcdir=.+if test "$ac_abs_confdir" = "$ac_pwd"; then+ srcdir=.+fi+# Remove unnecessary trailing slashes from srcdir.+# Double slashes in file names in object file debugging info+# mess up M-x gdb in Emacs.+case $srcdir in+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;+esac+for ac_var in $ac_precious_vars; do+ eval ac_env_${ac_var}_set=\${${ac_var}+set}+ eval ac_env_${ac_var}_value=\$${ac_var}+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}+ eval ac_cv_env_${ac_var}_value=\$${ac_var}+done++#+# Report the --help message.+#+if test "$ac_init_help" = "long"; then+ # Omit some internal or obsolete options to make the list less imposing.+ # This message is too long to be a string in the A/UX 3.1 sh.+ cat <<_ACEOF+\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.++Usage: $0 [OPTION]... [VAR=VALUE]...++To assign environment variables (e.g., CC, CFLAGS...), specify them as+VAR=VALUE. See below for descriptions of some of the useful variables.++Defaults for the options are specified in brackets.++Configuration:+ -h, --help display this help and exit+ --help=short display options specific to this package+ --help=recursive display the short help of all the included packages+ -V, --version display version information and exit+ -q, --quiet, --silent do not print \`checking ...' messages+ --cache-file=FILE cache test results in FILE [disabled]+ -C, --config-cache alias for \`--cache-file=config.cache'+ -n, --no-create do not create output files+ --srcdir=DIR find the sources in DIR [configure dir or \`..']++Installation directories:+ --prefix=PREFIX install architecture-independent files in PREFIX+ [$ac_default_prefix]+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX+ [PREFIX]++By default, \`make install' will install all the files in+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify+an installation prefix other than \`$ac_default_prefix' using \`--prefix',+for instance \`--prefix=\$HOME'.++For better control, use the options below.++Fine tuning of the installation directories:+ --bindir=DIR user executables [EPREFIX/bin]+ --sbindir=DIR system admin executables [EPREFIX/sbin]+ --libexecdir=DIR program executables [EPREFIX/libexec]+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]+ --libdir=DIR object code libraries [EPREFIX/lib]+ --includedir=DIR C header files [PREFIX/include]+ --oldincludedir=DIR C header files for non-gcc [/usr/include]+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]+ --infodir=DIR info documentation [DATAROOTDIR/info]+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]+ --mandir=DIR man documentation [DATAROOTDIR/man]+ --docdir=DIR documentation root [DATAROOTDIR/doc/base]+ --htmldir=DIR html documentation [DOCDIR]+ --dvidir=DIR dvi documentation [DOCDIR]+ --pdfdir=DIR pdf documentation [DOCDIR]+ --psdir=DIR ps documentation [DOCDIR]+_ACEOF++ cat <<\_ACEOF+_ACEOF+fi++if test -n "$ac_init_help"; then+ case $ac_init_help in+ short | recursive ) echo "Configuration of Haskell base package 1.0:";;+ esac+ cat <<\_ACEOF++Optional Features:+ --disable-option-checking ignore unrecognized --enable/--with options+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]+ --disable-largefile omit support for large files++Optional Packages:+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)+ --with-iconv-includes directory containing iconv.h+ --with-iconv-libraries directory containing iconv library+ --with-libcharset Use libcharset [default=only if available]++Some influential environment variables:+ CC C compiler command+ CFLAGS C compiler flags+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a+ nonstandard directory <lib dir>+ LIBS libraries to pass to the linker, e.g. -l<library>+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if+ you have headers in a nonstandard directory <include dir>+ CPP C preprocessor++Use these variables to override the choices made by `configure' or to help+it to find libraries and programs with nonstandard names/locations.++Report bugs to <libraries@haskell.org>.+_ACEOF+ac_status=$?+fi++if test "$ac_init_help" = "recursive"; then+ # If there are subdirs, report their specific --help.+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue+ test -d "$ac_dir" ||+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||+ continue+ ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+ # A ".." for each directory in $ac_dir_suffix.+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+ case $ac_top_builddir_sub in+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;+ esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+ .) # We are building in place.+ ac_srcdir=.+ ac_top_srcdir=$ac_top_builddir_sub+ ac_abs_top_srcdir=$ac_pwd ;;+ [\\/]* | ?:[\\/]* ) # Absolute name.+ ac_srcdir=$srcdir$ac_dir_suffix;+ ac_top_srcdir=$srcdir+ ac_abs_top_srcdir=$srcdir ;;+ *) # Relative name.+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+ ac_top_srcdir=$ac_top_build_prefix$srcdir+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix++ cd "$ac_dir" || { ac_status=$?; continue; }+ # Check for guested configure.+ if test -f "$ac_srcdir/configure.gnu"; then+ echo &&+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive+ elif test -f "$ac_srcdir/configure"; then+ echo &&+ $SHELL "$ac_srcdir/configure" --help=recursive+ else+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2+ fi || ac_status=$?+ cd "$ac_pwd" || { ac_status=$?; break; }+ done+fi++test -n "$ac_init_help" && exit $ac_status+if $ac_init_version; then+ cat <<\_ACEOF+Haskell base package configure 1.0+generated by GNU Autoconf 2.69++Copyright (C) 2012 Free Software Foundation, Inc.+This configure script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it.+_ACEOF+ exit+fi++## ------------------------ ##+## Autoconf initialization. ##+## ------------------------ ##++# ac_fn_c_try_compile LINENO+# --------------------------+# Try to compile conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_compile ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ rm -f conftest.$ac_objext+ if { { ac_try="$ac_compile"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_compile") 2>conftest.err+ ac_status=$?+ if test -s conftest.err; then+ grep -v '^ *+' conftest.err >conftest.er1+ cat conftest.er1 >&5+ mv -f conftest.er1 conftest.err+ fi+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; } && {+ test -z "$ac_c_werror_flag" ||+ test ! -s conftest.err+ } && test -s conftest.$ac_objext; then :+ ac_retval=0+else+ $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ ac_retval=1+fi+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+ as_fn_set_status $ac_retval++} # ac_fn_c_try_compile++# ac_fn_c_try_cpp LINENO+# ----------------------+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_cpp ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ if { { ac_try="$ac_cpp conftest.$ac_ext"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err+ ac_status=$?+ if test -s conftest.err; then+ grep -v '^ *+' conftest.err >conftest.er1+ cat conftest.er1 >&5+ mv -f conftest.er1 conftest.err+ fi+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; } > conftest.i && {+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||+ test ! -s conftest.err+ }; then :+ ac_retval=0+else+ $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ ac_retval=1+fi+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+ as_fn_set_status $ac_retval++} # ac_fn_c_try_cpp++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists, giving a warning if it cannot be compiled using+# the include files in INCLUDES and setting the cache variable VAR+# accordingly.+ac_fn_c_check_header_mongrel ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ if eval \${$3+:} false; then :+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+else+ # Is the header compilable?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5+$as_echo_n "checking $2 usability... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_header_compiler=yes+else+ ac_header_compiler=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5+$as_echo "$ac_header_compiler" >&6; }++# Is the header present?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5+$as_echo_n "checking $2 presence... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <$2>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+ ac_header_preproc=yes+else+ ac_header_preproc=no+fi+rm -f conftest.err conftest.i conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5+$as_echo "$ac_header_preproc" >&6; }++# So? What about this header?+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((+ yes:no: )+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+ ;;+ no:yes:* )+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+( $as_echo "## ------------------------------------ ##+## Report this to libraries@haskell.org ##+## ------------------------------------ ##"+ ) | sed "s/^/$as_me: WARNING: /" >&2+ ;;+esac+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+else+ eval "$3=\$ac_header_compiler"+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+fi+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_header_mongrel++# ac_fn_c_try_run LINENO+# ----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes+# that executables *can* be run.+ac_fn_c_try_run ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ if { { ac_try="$ac_link"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_link") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'+ { { case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_try") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }; }; then :+ ac_retval=0+else+ $as_echo "$as_me: program exited with status $ac_status" >&5+ $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ ac_retval=$ac_status+fi+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+ as_fn_set_status $ac_retval++} # ac_fn_c_try_run++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists and can be compiled using the include files in+# INCLUDES, setting the cache variable VAR accordingly.+ac_fn_c_check_header_compile ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ eval "$3=yes"+else+ eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_header_compile++# ac_fn_c_check_type LINENO TYPE VAR INCLUDES+# -------------------------------------------+# Tests whether TYPE exists after having included INCLUDES, setting cache+# variable VAR accordingly.+ac_fn_c_check_type ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+else+ eval "$3=no"+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+if (sizeof ($2))+ return 0;+ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+if (sizeof (($2)))+ return 0;+ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+ eval "$3=yes"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_type++# ac_fn_c_try_link LINENO+# -----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_link ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ rm -f conftest.$ac_objext conftest$ac_exeext+ if { { ac_try="$ac_link"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_link") 2>conftest.err+ ac_status=$?+ if test -s conftest.err; then+ grep -v '^ *+' conftest.err >conftest.er1+ cat conftest.er1 >&5+ mv -f conftest.er1 conftest.err+ fi+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; } && {+ test -z "$ac_c_werror_flag" ||+ test ! -s conftest.err+ } && test -s conftest$ac_exeext && {+ test "$cross_compiling" = yes ||+ test -x conftest$ac_exeext+ }; then :+ ac_retval=0+else+ $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ ac_retval=1+fi+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would+ # interfere with the next link command; also delete a directory that is+ # left behind by Apple's compiler. We do this before executing the actions.+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+ as_fn_set_status $ac_retval++} # ac_fn_c_try_link++# ac_fn_c_check_func LINENO FUNC VAR+# ----------------------------------+# Tests whether FUNC exists, setting the cache variable VAR accordingly+ac_fn_c_check_func ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.+ For example, HP-UX 11i <limits.h> declares gettimeofday. */+#define $2 innocuous_$2++/* System header to define __stub macros and hopefully few prototypes,+ which can conflict with char $2 (); below.+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ <limits.h> exists even on freestanding compilers. */++#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif++#undef $2++/* Override any GCC internal prototype to avoid an error.+ Use char because int might match the return type of a GCC+ builtin and then its argument prototype would still apply. */+#ifdef __cplusplus+extern "C"+#endif+char $2 ();+/* The GNU C library defines this for functions which it implements+ to always fail with ENOSYS. Some functions are actually named+ something starting with __ and the normal name is an alias. */+#if defined __stub_$2 || defined __stub___$2+choke me+#endif++int+main ()+{+return $2 ();+ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_link "$LINENO"; then :+ eval "$3=yes"+else+ eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext \+ conftest$ac_exeext conftest.$ac_ext+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_func++# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES+# --------------------------------------------+# Tries to find the compile-time value of EXPR in a program that includes+# INCLUDES, setting VAR accordingly. Returns whether the value could be+# computed+ac_fn_c_compute_int ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ if test "$cross_compiling" = yes; then+ # Depending upon the size, compute the lo and hi bounds.+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= 0)];+test_array [0] = 0;+return test_array [0];++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_lo=0 ac_mid=0+ while :; do+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0;+return test_array [0];++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_hi=$ac_mid; break+else+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val+ if test $ac_lo -le $ac_mid; then+ ac_lo= ac_hi=+ break+ fi+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ done+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) < 0)];+test_array [0] = 0;+return test_array [0];++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_hi=-1 ac_mid=-1+ while :; do+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= $ac_mid)];+test_array [0] = 0;+return test_array [0];++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_lo=$ac_mid; break+else+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val+ if test $ac_mid -le $ac_hi; then+ ac_lo= ac_hi=+ break+ fi+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ done+else+ ac_lo= ac_hi=+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+# Binary search between lo and hi bounds.+while test "x$ac_lo" != "x$ac_hi"; do+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0;+return test_array [0];++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_hi=$ac_mid+else+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+done+case $ac_lo in #((+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;+'') ac_retval=1 ;;+esac+ else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+static long int longval () { return $2; }+static unsigned long int ulongval () { return $2; }+#include <stdio.h>+#include <stdlib.h>+int+main ()+{++ FILE *f = fopen ("conftest.val", "w");+ if (! f)+ return 1;+ if (($2) < 0)+ {+ long int i = longval ();+ if (i != ($2))+ return 1;+ fprintf (f, "%ld", i);+ }+ else+ {+ unsigned long int i = ulongval ();+ if (i != ($2))+ return 1;+ fprintf (f, "%lu", i);+ }+ /* Do not output a trailing newline, as this causes \r\n confusion+ on some platforms. */+ return ferror (f) || fclose (f) != 0;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0+else+ ac_retval=1+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+ conftest.$ac_objext conftest.beam conftest.$ac_ext+rm -f conftest.val++ fi+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno+ as_fn_set_status $ac_retval++} # ac_fn_c_compute_int++# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES+# ---------------------------------------------+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR+# accordingly.+ac_fn_c_check_decl ()+{+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ as_decl_name=`echo $2|sed 's/ *(.*//'`+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }+if eval \${$3+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+$4+int+main ()+{+#ifndef $as_decl_name+#ifdef __cplusplus+ (void) $as_decl_use;+#else+ (void) $as_decl_name;+#endif+#endif++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ eval "$3=yes"+else+ eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno++} # ac_fn_c_check_decl+cat >config.log <<_ACEOF+This file contains any messages produced by compilers while+running configure, to aid debugging if configure makes a mistake.++It was created by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.69. Invocation command line was++ $ $0 $@++_ACEOF+exec 5>>config.log+{+cat <<_ASUNAME+## --------- ##+## Platform. ##+## --------- ##++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`+uname -m = `(uname -m) 2>/dev/null || echo unknown`+uname -r = `(uname -r) 2>/dev/null || echo unknown`+uname -s = `(uname -s) 2>/dev/null || echo unknown`+uname -v = `(uname -v) 2>/dev/null || echo unknown`++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`++_ASUNAME++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ $as_echo "PATH: $as_dir"+ done+IFS=$as_save_IFS++} >&5++cat >&5 <<_ACEOF+++## ----------- ##+## Core tests. ##+## ----------- ##++_ACEOF+++# Keep a trace of the command line.+# Strip out --no-create and --no-recursion so they do not pile up.+# Strip out --silent because we don't want to record it for future runs.+# Also quote any args containing shell meta-characters.+# Make two passes to allow for proper duplicate-argument suppression.+ac_configure_args=+ac_configure_args0=+ac_configure_args1=+ac_must_keep_next=false+for ac_pass in 1 2+do+ for ac_arg+ do+ case $ac_arg in+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil)+ continue ;;+ *\'*)+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;+ esac+ case $ac_pass in+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;+ 2)+ as_fn_append ac_configure_args1 " '$ac_arg'"+ if test $ac_must_keep_next = true; then+ ac_must_keep_next=false # Got value, back to normal.+ else+ case $ac_arg in+ *=* | --config-cache | -C | -disable-* | --disable-* \+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \+ | -with-* | --with-* | -without-* | --without-* | --x)+ case "$ac_configure_args0 " in+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;+ esac+ ;;+ -* ) ac_must_keep_next=true ;;+ esac+ fi+ as_fn_append ac_configure_args " '$ac_arg'"+ ;;+ esac+ done+done+{ ac_configure_args0=; unset ac_configure_args0;}+{ ac_configure_args1=; unset ac_configure_args1;}++# When interrupted or exit'd, cleanup temporary files, and complete+# config.log. We remove comments because anyway the quotes in there+# would cause problems or look ugly.+# WARNING: Use '\'' to represent an apostrophe within the trap.+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.+trap 'exit_status=$?+ # Save into config.log some information that might help in debugging.+ {+ echo++ $as_echo "## ---------------- ##+## Cache variables. ##+## ---------------- ##"+ echo+ # The following way of writing the cache mishandles newlines in values,+(+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do+ eval ac_val=\$$ac_var+ case $ac_val in #(+ *${as_nl}*)+ case $ac_var in #(+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+ esac+ case $ac_var in #(+ _ | IFS | as_nl) ;; #(+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+ *) { eval $ac_var=; unset $ac_var;} ;;+ esac ;;+ esac+ done+ (set) 2>&1 |+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(+ *${as_nl}ac_space=\ *)+ sed -n \+ "s/'\''/'\''\\\\'\'''\''/g;+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"+ ;; #(+ *)+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+ ;;+ esac |+ sort+)+ echo++ $as_echo "## ----------------- ##+## Output variables. ##+## ----------------- ##"+ echo+ for ac_var in $ac_subst_vars+ do+ eval ac_val=\$$ac_var+ case $ac_val in+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+ esac+ $as_echo "$ac_var='\''$ac_val'\''"+ done | sort+ echo++ if test -n "$ac_subst_files"; then+ $as_echo "## ------------------- ##+## File substitutions. ##+## ------------------- ##"+ echo+ for ac_var in $ac_subst_files+ do+ eval ac_val=\$$ac_var+ case $ac_val in+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+ esac+ $as_echo "$ac_var='\''$ac_val'\''"+ done | sort+ echo+ fi++ if test -s confdefs.h; then+ $as_echo "## ----------- ##+## confdefs.h. ##+## ----------- ##"+ echo+ cat confdefs.h+ echo+ fi+ test "$ac_signal" != 0 &&+ $as_echo "$as_me: caught signal $ac_signal"+ $as_echo "$as_me: exit $exit_status"+ } >&5+ rm -f core *.core core.conftest.* &&+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&+ exit $exit_status+' 0+for ac_signal in 1 2 13 15; do+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal+done+ac_signal=0++# confdefs.h avoids OS command line length limits that DEFS can exceed.+rm -f -r conftest* confdefs.h++$as_echo "/* confdefs.h */" > confdefs.h++# Predefined preprocessor variables.++cat >>confdefs.h <<_ACEOF+#define PACKAGE_NAME "$PACKAGE_NAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_VERSION "$PACKAGE_VERSION"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_STRING "$PACKAGE_STRING"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_URL "$PACKAGE_URL"+_ACEOF+++# Let the site file select an alternate cache file if it wants to.+# Prefer an explicitly selected file to automatically selected ones.+ac_site_file1=NONE+ac_site_file2=NONE+if test -n "$CONFIG_SITE"; then+ # We do not want a PATH search for config.site.+ case $CONFIG_SITE in #((+ -*) ac_site_file1=./$CONFIG_SITE;;+ */*) ac_site_file1=$CONFIG_SITE;;+ *) ac_site_file1=./$CONFIG_SITE;;+ esac+elif test "x$prefix" != xNONE; then+ ac_site_file1=$prefix/share/config.site+ ac_site_file2=$prefix/etc/config.site+else+ ac_site_file1=$ac_default_prefix/share/config.site+ ac_site_file2=$ac_default_prefix/etc/config.site+fi+for ac_site_file in "$ac_site_file1" "$ac_site_file2"+do+ test "x$ac_site_file" = xNONE && continue+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5+$as_echo "$as_me: loading site script $ac_site_file" >&6;}+ sed 's/^/| /' "$ac_site_file" >&5+ . "$ac_site_file" \+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "failed to load site script $ac_site_file+See \`config.log' for more details" "$LINENO" 5; }+ fi+done++if test -r "$cache_file"; then+ # Some versions of bash will fail to source /dev/null (special files+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5+$as_echo "$as_me: loading cache $cache_file" >&6;}+ case $cache_file in+ [\\/]* | ?:[\\/]* ) . "$cache_file";;+ *) . "./$cache_file";;+ esac+ fi+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5+$as_echo "$as_me: creating cache $cache_file" >&6;}+ >$cache_file+fi++# Check that the precious variables saved in the cache have kept the same+# value.+ac_cache_corrupted=false+for ac_var in $ac_precious_vars; do+ eval ac_old_set=\$ac_cv_env_${ac_var}_set+ eval ac_new_set=\$ac_env_${ac_var}_set+ eval ac_old_val=\$ac_cv_env_${ac_var}_value+ eval ac_new_val=\$ac_env_${ac_var}_value+ case $ac_old_set,$ac_new_set in+ set,)+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}+ ac_cache_corrupted=: ;;+ ,set)+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}+ ac_cache_corrupted=: ;;+ ,);;+ *)+ if test "x$ac_old_val" != "x$ac_new_val"; then+ # differences in whitespace do not lead to failure.+ ac_old_val_w=`echo x $ac_old_val`+ ac_new_val_w=`echo x $ac_new_val`+ if test "$ac_old_val_w" != "$ac_new_val_w"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}+ ac_cache_corrupted=:+ else+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}+ eval $ac_var=\$ac_old_val+ fi+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}+ fi;;+ esac+ # Pass precious variables to config.status.+ if test "$ac_new_set" = set; then+ case $ac_new_val in+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;+ *) ac_arg=$ac_var=$ac_new_val ;;+ esac+ case " $ac_configure_args " in+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;+ esac+ fi+done+if $ac_cache_corrupted; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5+fi+## -------------------- ##+## Main body of script. ##+## -------------------- ##++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu++++# Safety check: Ensure that we are in the correct source directory.+++ac_config_headers="$ac_config_headers include/HsBaseConfig.h include/EventConfig.h"+++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+if test -n "$ac_tool_prefix"; then+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.+set dummy ${ac_tool_prefix}gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="${ac_tool_prefix}gcc"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$ac_cv_prog_CC"; then+ ac_ct_CC=$CC+ # Extract the first word of "gcc", so it can be a program name with args.+set dummy gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_ac_ct_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$ac_ct_CC"; then+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_ac_ct_CC="gcc"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi++ if test "x$ac_ct_CC" = x; then+ CC=""+ else+ case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+ CC=$ac_ct_CC+ fi+else+ CC="$ac_cv_prog_CC"+fi++if test -z "$CC"; then+ if test -n "$ac_tool_prefix"; then+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.+set dummy ${ac_tool_prefix}cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="${ac_tool_prefix}cc"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++ fi+fi+if test -z "$CC"; then+ # Extract the first word of "cc", so it can be a program name with args.+set dummy cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+ ac_prog_rejected=no+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then+ ac_prog_rejected=yes+ continue+ fi+ ac_cv_prog_CC="cc"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++if test $ac_prog_rejected = yes; then+ # We found a bogon in the path, so make sure we never use it.+ set dummy $ac_cv_prog_CC+ shift+ if test $# != 0; then+ # We chose a different compiler from the bogus one.+ # However, it has the same basename, so the bogon will be chosen+ # first if we set CC to just the basename; use the full file name.+ shift+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"+ fi+fi+fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$CC"; then+ if test -n "$ac_tool_prefix"; then+ for ac_prog in cl.exe+ do+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.+set dummy $ac_tool_prefix$ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$CC"; then+ ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++ test -n "$CC" && break+ done+fi+if test -z "$CC"; then+ ac_ct_CC=$CC+ for ac_prog in cl.exe+do+ # Extract the first word of "$ac_prog", so it can be a program name with args.+set dummy $ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_prog_ac_ct_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -n "$ac_ct_CC"; then+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_prog_ac_ct_CC="$ac_prog"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++ test -n "$ac_ct_CC" && break+done++ if test "x$ac_ct_CC" = x; then+ CC=""+ else+ case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+ CC=$ac_ct_CC+ fi+fi++fi+++test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "no acceptable C compiler found in \$PATH+See \`config.log' for more details" "$LINENO" 5; }++# Provide some information about the compiler.+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5+set X $ac_compile+ac_compiler=$2+for ac_option in --version -v -V -qversion; do+ { { ac_try="$ac_compiler $ac_option >&5"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err+ ac_status=$?+ if test -s conftest.err; then+ sed '10a\+... rest of stderr output deleted ...+ 10q' conftest.err >conftest.er1+ cat conftest.er1 >&5+ fi+ rm -f conftest.er1 conftest.err+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }+done++cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"+# Try to create an executable without -o first, disregard a.out.+# It will help us diagnose broken compilers, and finding out an intuition+# of exeext.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5+$as_echo_n "checking whether the C compiler works... " >&6; }+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`++# The possible output files:+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"++ac_rmfiles=+for ac_file in $ac_files+do+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;+ esac+done+rm -f $ac_rmfiles++if { { ac_try="$ac_link_default"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_link_default") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }; then :+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'+# in a Makefile. We should not override ac_cv_exeext if it was cached,+# so that the user can short-circuit this test for compilers unknown to+# Autoconf.+for ac_file in $ac_files ''+do+ test -f "$ac_file" || continue+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )+ ;;+ [ab].out )+ # We found the default executable, but exeext='' is most+ # certainly right.+ break;;+ *.* )+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;+ then :; else+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+ fi+ # We set ac_cv_exeext here because the later test for it is not+ # safe: cross compilers may not add the suffix if given an `-o'+ # argument, so we may need to know it at that point already.+ # Even if this section looks crufty: it has the advantage of+ # actually working.+ break;;+ * )+ break;;+ esac+done+test "$ac_cv_exeext" = no && ac_cv_exeext=++else+ ac_file=''+fi+if test -z "$ac_file"; then :+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+$as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "C compiler cannot create executables+See \`config.log' for more details" "$LINENO" 5; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5+$as_echo "yes" >&6; }+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5+$as_echo_n "checking for C compiler default output file name... " >&6; }+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5+$as_echo "$ac_file" >&6; }+ac_exeext=$ac_cv_exeext++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5+$as_echo_n "checking for suffix of executables... " >&6; }+if { { ac_try="$ac_link"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_link") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }; then :+ # If both `conftest.exe' and `conftest' are `present' (well, observable)+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will+# work properly (i.e., refer to `conftest.exe'), while it won't with+# `rm'.+for ac_file in conftest.exe conftest conftest.*; do+ test -f "$ac_file" || continue+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+ break;;+ * ) break;;+ esac+done+else+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot compute suffix of executables: cannot compile and link+See \`config.log' for more details" "$LINENO" 5; }+fi+rm -f conftest conftest$ac_cv_exeext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5+$as_echo "$ac_cv_exeext" >&6; }++rm -f conftest.$ac_ext+EXEEXT=$ac_cv_exeext+ac_exeext=$EXEEXT+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <stdio.h>+int+main ()+{+FILE *f = fopen ("conftest.out", "w");+ return ferror (f) || fclose (f) != 0;++ ;+ return 0;+}+_ACEOF+ac_clean_files="$ac_clean_files conftest.out"+# Check that the compiler produces executables we can run. If not, either+# the compiler is broken, or we cross compile.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5+$as_echo_n "checking whether we are cross compiling... " >&6; }+if test "$cross_compiling" != yes; then+ { { ac_try="$ac_link"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_link") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }+ if { ac_try='./conftest$ac_cv_exeext'+ { { case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_try") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }; }; then+ cross_compiling=no+ else+ if test "$cross_compiling" = maybe; then+ cross_compiling=yes+ else+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot run C compiled programs.+If you meant to cross compile, use \`--host'.+See \`config.log' for more details" "$LINENO" 5; }+ fi+ fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5+$as_echo "$cross_compiling" >&6; }++rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5+$as_echo_n "checking for suffix of object files... " >&6; }+if ${ac_cv_objext+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+rm -f conftest.o conftest.obj+if { { ac_try="$ac_compile"+case "(($ac_try" in+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+ *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+ (eval "$ac_compile") 2>&5+ ac_status=$?+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+ test $ac_status = 0; }; then :+ for ac_file in conftest.o conftest.obj conftest.*; do+ test -f "$ac_file" || continue;+ case $ac_file in+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`+ break;;+ esac+done+else+ $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "cannot compute suffix of object files: cannot compile+See \`config.log' for more details" "$LINENO" 5; }+fi+rm -f conftest.$ac_cv_objext conftest.$ac_ext+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5+$as_echo "$ac_cv_objext" >&6; }+OBJEXT=$ac_cv_objext+ac_objext=$OBJEXT+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }+if ${ac_cv_c_compiler_gnu+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{+#ifndef __GNUC__+ choke me+#endif++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_compiler_gnu=yes+else+ ac_compiler_gnu=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ac_cv_c_compiler_gnu=$ac_compiler_gnu++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5+$as_echo "$ac_cv_c_compiler_gnu" >&6; }+if test $ac_compiler_gnu = yes; then+ GCC=yes+else+ GCC=+fi+ac_test_CFLAGS=${CFLAGS+set}+ac_save_CFLAGS=$CFLAGS+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5+$as_echo_n "checking whether $CC accepts -g... " >&6; }+if ${ac_cv_prog_cc_g+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_save_c_werror_flag=$ac_c_werror_flag+ ac_c_werror_flag=yes+ ac_cv_prog_cc_g=no+ CFLAGS="-g"+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_prog_cc_g=yes+else+ CFLAGS=""+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+ ac_c_werror_flag=$ac_save_c_werror_flag+ CFLAGS="-g"+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_prog_cc_g=yes+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ ac_c_werror_flag=$ac_save_c_werror_flag+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5+$as_echo "$ac_cv_prog_cc_g" >&6; }+if test "$ac_test_CFLAGS" = set; then+ CFLAGS=$ac_save_CFLAGS+elif test $ac_cv_prog_cc_g = yes; then+ if test "$GCC" = yes; then+ CFLAGS="-g -O2"+ else+ CFLAGS="-g"+ fi+else+ if test "$GCC" = yes; then+ CFLAGS="-O2"+ else+ CFLAGS=+ fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }+if ${ac_cv_prog_cc_c89+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_cv_prog_cc_c89=no+ac_save_CC=$CC+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <stdarg.h>+#include <stdio.h>+struct stat;+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */+struct buf { int x; };+FILE * (*rcsopen) (struct buf *, struct stat *, int);+static char *e (p, i)+ char **p;+ int i;+{+ return p[i];+}+static char *f (char * (*g) (char **, int), char **p, ...)+{+ char *s;+ va_list v;+ va_start (v,p);+ s = g (p, va_arg (v,int));+ va_end (v);+ return s;+}++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has+ function prototypes and stuff, but not '\xHH' hex character constants.+ These don't provoke an error unfortunately, instead are silently treated+ as 'x'. The following induces an error, until -std is added to get+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an+ array size at least. It's necessary to write '\x00'==0 to get something+ that's true only with -std. */+int osf4_cc_array ['\x00' == 0 ? 1 : -1];++/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters+ inside strings and character constants. */+#define FOO(x) 'x'+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];++int test (int i, double x);+struct s1 {int (*f) (int a);};+struct s2 {int (*f) (double a);};+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);+int argc;+char **argv;+int+main ()+{+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];+ ;+ return 0;+}+_ACEOF+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"+do+ CC="$ac_save_CC $ac_arg"+ if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_prog_cc_c89=$ac_arg+fi+rm -f core conftest.err conftest.$ac_objext+ test "x$ac_cv_prog_cc_c89" != "xno" && break+done+rm -f conftest.$ac_ext+CC=$ac_save_CC++fi+# AC_CACHE_VAL+case "x$ac_cv_prog_cc_c89" in+ x)+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5+$as_echo "none needed" >&6; } ;;+ xno)+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5+$as_echo "unsupported" >&6; } ;;+ *)+ CC="$CC $ac_cv_prog_cc_c89"+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;+esac+if test "x$ac_cv_prog_cc_c89" != xno; then :++fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5+$as_echo_n "checking how to run the C preprocessor... " >&6; }+# On Suns, sometimes $CPP names a directory.+if test -n "$CPP" && test -d "$CPP"; then+ CPP=+fi+if test -z "$CPP"; then+ if ${ac_cv_prog_CPP+:} false; then :+ $as_echo_n "(cached) " >&6+else+ # Double quotes because CPP needs to be expanded+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"+ do+ ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+ # Use a header file that comes with gcc, so configuring glibc+ # with a fresh cross-compiler works.+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ # <limits.h> exists even on freestanding compilers.+ # On the NeXT, cc -E runs the code through the compiler's parser,+ # not just through cpp. "Syntax error" is here to catch this case.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+ Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+ # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.i conftest.$ac_ext++ # OK, works on sane cases. Now check whether nonexistent headers+ # can be detected and how.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+ # Broken: success on invalid input.+continue+else+ # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.i conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.i conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :+ break+fi++ done+ ac_cv_prog_CPP=$CPP++fi+ CPP=$ac_cv_prog_CPP+else+ ac_cv_prog_CPP=$CPP+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5+$as_echo "$CPP" >&6; }+ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+ # Use a header file that comes with gcc, so configuring glibc+ # with a fresh cross-compiler works.+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+ # <limits.h> exists even on freestanding compilers.+ # On the NeXT, cc -E runs the code through the compiler's parser,+ # not just through cpp. "Syntax error" is here to catch this case.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+ Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+ # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.i conftest.$ac_ext++ # OK, works on sane cases. Now check whether nonexistent headers+ # can be detected and how.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+ # Broken: success on invalid input.+continue+else+ # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.i conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.i conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :++else+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check+See \`config.log' for more details" "$LINENO" 5; }+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }+if ${ac_cv_path_GREP+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if test -z "$GREP"; then+ ac_path_GREP_found=false+ # Loop through the user's path and test for each of PROGNAME-LIST+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_prog in grep ggrep; do+ for ac_exec_ext in '' $ac_executable_extensions; do+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"+ as_fn_executable_p "$ac_path_GREP" || continue+# Check for GNU ac_path_GREP and select it if it is found.+ # Check for GNU $ac_path_GREP+case `"$ac_path_GREP" --version 2>&1` in+*GNU*)+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;+*)+ ac_count=0+ $as_echo_n 0123456789 >"conftest.in"+ while :+ do+ cat "conftest.in" "conftest.in" >"conftest.tmp"+ mv "conftest.tmp" "conftest.in"+ cp "conftest.in" "conftest.nl"+ $as_echo 'GREP' >> "conftest.nl"+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+ as_fn_arith $ac_count + 1 && ac_count=$as_val+ if test $ac_count -gt ${ac_path_GREP_max-0}; then+ # Best one so far, save it but keep looking for a better one+ ac_cv_path_GREP="$ac_path_GREP"+ ac_path_GREP_max=$ac_count+ fi+ # 10*(2^10) chars as input seems more than enough+ test $ac_count -gt 10 && break+ done+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++ $ac_path_GREP_found && break 3+ done+ done+ done+IFS=$as_save_IFS+ if test -z "$ac_cv_path_GREP"; then+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+ fi+else+ ac_cv_path_GREP=$GREP+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5+$as_echo "$ac_cv_path_GREP" >&6; }+ GREP="$ac_cv_path_GREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5+$as_echo_n "checking for egrep... " >&6; }+if ${ac_cv_path_EGREP+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1+ then ac_cv_path_EGREP="$GREP -E"+ else+ if test -z "$EGREP"; then+ ac_path_EGREP_found=false+ # Loop through the user's path and test for each of PROGNAME-LIST+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_prog in egrep; do+ for ac_exec_ext in '' $ac_executable_extensions; do+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"+ as_fn_executable_p "$ac_path_EGREP" || continue+# Check for GNU ac_path_EGREP and select it if it is found.+ # Check for GNU $ac_path_EGREP+case `"$ac_path_EGREP" --version 2>&1` in+*GNU*)+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;+*)+ ac_count=0+ $as_echo_n 0123456789 >"conftest.in"+ while :+ do+ cat "conftest.in" "conftest.in" >"conftest.tmp"+ mv "conftest.tmp" "conftest.in"+ cp "conftest.in" "conftest.nl"+ $as_echo 'EGREP' >> "conftest.nl"+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+ as_fn_arith $ac_count + 1 && ac_count=$as_val+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then+ # Best one so far, save it but keep looking for a better one+ ac_cv_path_EGREP="$ac_path_EGREP"+ ac_path_EGREP_max=$ac_count+ fi+ # 10*(2^10) chars as input seems more than enough+ test $ac_count -gt 10 && break+ done+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++ $ac_path_EGREP_found && break 3+ done+ done+ done+IFS=$as_save_IFS+ if test -z "$ac_cv_path_EGREP"; then+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+ fi+else+ ac_cv_path_EGREP=$EGREP+fi++ fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5+$as_echo "$ac_cv_path_EGREP" >&6; }+ EGREP="$ac_cv_path_EGREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5+$as_echo_n "checking for ANSI C header files... " >&6; }+if ${ac_cv_header_stdc+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <stdlib.h>+#include <stdarg.h>+#include <string.h>+#include <float.h>++int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_header_stdc=yes+else+ ac_cv_header_stdc=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++if test $ac_cv_header_stdc = yes; then+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <string.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+ $EGREP "memchr" >/dev/null 2>&1; then :++else+ ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+ $EGREP "free" >/dev/null 2>&1; then :++else+ ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.+ if test "$cross_compiling" = yes; then :+ :+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <ctype.h>+#include <stdlib.h>+#if ((' ' & 0x0FF) == 0x020)+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))+#else+# define ISLOWER(c) \+ (('a' <= (c) && (c) <= 'i') \+ || ('j' <= (c) && (c) <= 'r') \+ || ('s' <= (c) && (c) <= 'z'))+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))+#endif++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))+int+main ()+{+ int i;+ for (i = 0; i < 256; i++)+ if (XOR (islower (i), ISLOWER (i))+ || toupper (i) != TOUPPER (i))+ return 2;+ return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :++else+ ac_cv_header_stdc=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+ conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5+$as_echo "$ac_cv_header_stdc" >&6; }+if test $ac_cv_header_stdc = yes; then++$as_echo "#define STDC_HEADERS 1" >>confdefs.h++fi++# On IRIX 5.3, sys/types and inttypes.h are conflicting.+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \+ inttypes.h stdint.h unistd.h+do :+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default+"+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :+ cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done++++ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"+if test "x$ac_cv_header_minix_config_h" = xyes; then :+ MINIX=yes+else+ MINIX=+fi+++ if test "$MINIX" = yes; then++$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h+++$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h+++$as_echo "#define _MINIX 1" >>confdefs.h++ fi+++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }+if ${ac_cv_safe_to_define___extensions__+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++# define __EXTENSIONS__ 1+ $ac_includes_default+int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_safe_to_define___extensions__=yes+else+ ac_cv_safe_to_define___extensions__=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }+ test $ac_cv_safe_to_define___extensions__ = yes &&+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h++ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h++ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h++ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h++ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h++++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WINDOWS platform" >&5+$as_echo_n "checking for WINDOWS platform... " >&6; }+case $host_alias in+ *mingw32*|*mingw64*|*cygwin*|*msys*)+ WINDOWS=YES;;+ *)+ WINDOWS=NO;;+esac+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDOWS" >&5+$as_echo "$WINDOWS" >&6; }++# do we have long longs?+ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"+if test "x$ac_cv_type_long_long" = xyes; then :++cat >>confdefs.h <<_ACEOF+#define HAVE_LONG_LONG 1+_ACEOF+++fi+++# check for specific header (.h) files that we are interested in+for ac_header in ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/file.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h sys/socket.h+do :+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :+ cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done+++# Enable large file support. Do this before testing the types ino_t, off_t, and+# rlim_t, because it will affect the result of that test.+# Check whether --enable-largefile was given.+if test "${enable_largefile+set}" = set; then :+ enableval=$enable_largefile;+fi++if test "$enable_largefile" != no; then++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }+if ${ac_cv_sys_largefile_CC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_cv_sys_largefile_CC=no+ if test "$GCC" != yes; then+ ac_save_CC=$CC+ while :; do+ # IRIX 6.2 and later do not support large files by default,+ # so use the C compiler's -n32 option if that helps.+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+ We can't simply define LARGE_OFF_T to be 9223372036854775807,+ since some C++ compilers masquerading as C compilers+ incorrectly reject 9223372036854775807. */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+ && LARGE_OFF_T % 2147483647 == 1)+ ? 1 : -1];+int+main ()+{++ ;+ return 0;+}+_ACEOF+ if ac_fn_c_try_compile "$LINENO"; then :+ break+fi+rm -f core conftest.err conftest.$ac_objext+ CC="$CC -n32"+ if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_sys_largefile_CC=' -n32'; break+fi+rm -f core conftest.err conftest.$ac_objext+ break+ done+ CC=$ac_save_CC+ rm -f conftest.$ac_ext+ fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5+$as_echo "$ac_cv_sys_largefile_CC" >&6; }+ if test "$ac_cv_sys_largefile_CC" != no; then+ CC=$CC$ac_cv_sys_largefile_CC+ fi++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }+if ${ac_cv_sys_file_offset_bits+:} false; then :+ $as_echo_n "(cached) " >&6+else+ while :; do+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+ We can't simply define LARGE_OFF_T to be 9223372036854775807,+ since some C++ compilers masquerading as C compilers+ incorrectly reject 9223372036854775807. */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+ && LARGE_OFF_T % 2147483647 == 1)+ ? 1 : -1];+int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_sys_file_offset_bits=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#define _FILE_OFFSET_BITS 64+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+ We can't simply define LARGE_OFF_T to be 9223372036854775807,+ since some C++ compilers masquerading as C compilers+ incorrectly reject 9223372036854775807. */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+ && LARGE_OFF_T % 2147483647 == 1)+ ? 1 : -1];+int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_sys_file_offset_bits=64; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ ac_cv_sys_file_offset_bits=unknown+ break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }+case $ac_cv_sys_file_offset_bits in #(+ no | unknown) ;;+ *)+cat >>confdefs.h <<_ACEOF+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits+_ACEOF+;;+esac+rm -rf conftest*+ if test $ac_cv_sys_file_offset_bits = unknown; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }+if ${ac_cv_sys_large_files+:} false; then :+ $as_echo_n "(cached) " >&6+else+ while :; do+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+ We can't simply define LARGE_OFF_T to be 9223372036854775807,+ since some C++ compilers masquerading as C compilers+ incorrectly reject 9223372036854775807. */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+ && LARGE_OFF_T % 2147483647 == 1)+ ? 1 : -1];+int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_sys_large_files=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#define _LARGE_FILES 1+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+ We can't simply define LARGE_OFF_T to be 9223372036854775807,+ since some C++ compilers masquerading as C compilers+ incorrectly reject 9223372036854775807. */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+ && LARGE_OFF_T % 2147483647 == 1)+ ? 1 : -1];+int+main ()+{++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ ac_cv_sys_large_files=1; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ ac_cv_sys_large_files=unknown+ break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5+$as_echo "$ac_cv_sys_large_files" >&6; }+case $ac_cv_sys_large_files in #(+ no | unknown) ;;+ *)+cat >>confdefs.h <<_ACEOF+#define _LARGE_FILES $ac_cv_sys_large_files+_ACEOF+;;+esac+rm -rf conftest*+ fi+++fi+++for ac_header in wctype.h+do :+ ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default"+if test "x$ac_cv_header_wctype_h" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_WCTYPE_H 1+_ACEOF+ for ac_func in iswspace+do :+ ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace"+if test "x$ac_cv_func_iswspace" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_ISWSPACE 1+_ACEOF++fi+done++fi++done+++for ac_func in lstat+do :+ ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat"+if test "x$ac_cv_func_lstat" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_LSTAT 1+_ACEOF++fi+done++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }+if ${ac_cv_lib_rt_clock_gettime+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lrt $LIBS"+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++/* Override any GCC internal prototype to avoid an error.+ Use char because int might match the return type of a GCC+ builtin and then its argument prototype would still apply. */+#ifdef __cplusplus+extern "C"+#endif+char clock_gettime ();+int+main ()+{+return clock_gettime ();+ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_link "$LINENO"; then :+ ac_cv_lib_rt_clock_gettime=yes+else+ ac_cv_lib_rt_clock_gettime=no+fi+rm -f core conftest.err conftest.$ac_objext \+ conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_LIBRT 1+_ACEOF++ LIBS="-lrt $LIBS"++fi++for ac_func in clock_gettime+do :+ ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"+if test "x$ac_cv_func_clock_gettime" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_CLOCK_GETTIME 1+_ACEOF++fi+done++for ac_func in getclock getrusage times+do :+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+ cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done++for ac_func in _chsize ftruncate+do :+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+ cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++for ac_func in epoll_ctl eventfd kevent kevent64 kqueue poll+do :+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :+ cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++# event-related fun++if test "$ac_cv_header_sys_epoll_h" = yes && test "$ac_cv_func_epoll_ctl" = yes; then++$as_echo "#define HAVE_EPOLL 1" >>confdefs.h++fi++if test "$ac_cv_header_sys_event_h" = yes && test "$ac_cv_func_kqueue" = yes; then++$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h+++ # The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.filter" >&5+$as_echo_n "checking size of kev.filter... " >&6; }+if ${ac_cv_sizeof_kev_filter+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.filter))" "ac_cv_sizeof_kev_filter" "#include <sys/event.h>+struct kevent kev;+"; then :++else+ if test "$ac_cv_type_kev_filter" = yes; then+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (kev.filter)+See \`config.log' for more details" "$LINENO" 5; }+ else+ ac_cv_sizeof_kev_filter=0+ fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_filter" >&5+$as_echo "$ac_cv_sizeof_kev_filter" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_KEV_FILTER $ac_cv_sizeof_kev_filter+_ACEOF++++ # The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kev.flags" >&5+$as_echo_n "checking size of kev.flags... " >&6; }+if ${ac_cv_sizeof_kev_flags+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kev.flags))" "ac_cv_sizeof_kev_flags" "#include <sys/event.h>+struct kevent kev;+"; then :++else+ if test "$ac_cv_type_kev_flags" = yes; then+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (kev.flags)+See \`config.log' for more details" "$LINENO" 5; }+ else+ ac_cv_sizeof_kev_flags=0+ fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kev_flags" >&5+$as_echo "$ac_cv_sizeof_kev_flags" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_KEV_FLAGS $ac_cv_sizeof_kev_flags+_ACEOF+++fi++if test "$ac_cv_header_poll_h" = yes && test "$ac_cv_func_poll" = yes; then++$as_echo "#define HAVE_POLL 1" >>confdefs.h++fi++# Linux open file descriptor locks+ac_fn_c_check_decl "$LINENO" "F_OFD_SETLK" "ac_cv_have_decl_F_OFD_SETLK" "+ #include <unistd.h>+ #include <fcntl.h>++"+if test "x$ac_cv_have_decl_F_OFD_SETLK" = xyes; then :+++$as_echo "#define HAVE_OFD_LOCKING 1" >>confdefs.h+++fi+++# flock+for ac_func in flock+do :+ ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"+if test "x$ac_cv_func_flock" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_FLOCK 1+_ACEOF++fi+done++if test "$ac_cv_header_sys_file_h" = yes && test "$ac_cv_func_flock" = yes; then++$as_echo "#define HAVE_FLOCK 1" >>confdefs.h++fi++# unsetenv+for ac_func in unsetenv+do :+ ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"+if test "x$ac_cv_func_unsetenv" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE_UNSETENV 1+_ACEOF++fi+done+++### POSIX.1003.1 unsetenv returns 0 or -1 (EINVAL), but older implementations+### in common use return void.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of unsetenv" >&5+$as_echo_n "checking return type of unsetenv... " >&6; }+if ${fptools_cv_func_unsetenv_return_type+:} false; then :+ $as_echo_n "(cached) " >&6+else+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+ $EGREP "void[ ]+unsetenv" >/dev/null 2>&1; then :+ fptools_cv_func_unsetenv_return_type=void+else+ fptools_cv_func_unsetenv_return_type=int+fi+rm -f conftest*++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_func_unsetenv_return_type" >&5+$as_echo "$fptools_cv_func_unsetenv_return_type" >&6; }+case "$fptools_cv_func_unsetenv_return_type" in+ "void" )++$as_echo "#define UNSETENV_RETURNS_VOID 1" >>confdefs.h++ ;;+esac++++# Check whether --with-iconv-includes was given.+if test "${with_iconv_includes+set}" = set; then :+ withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval $CPPFLAGS"+else+ ICONV_INCLUDE_DIRS=+fi++++# Check whether --with-iconv-libraries was given.+if test "${with_iconv_libraries+set}" = set; then :+ withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval $LDFLAGS"+else+ ICONV_LIB_DIRS=+fi++++++# map standard C types and ISO types to Haskell types+++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for char" >&5+$as_echo_n "checking Haskell type for char... " >&6; }+ if ${fptools_cv_htype_char+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_char=yes+ if ac_fn_c_compute_int "$LINENO" "(char)0.2 - (char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+char val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_char="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_char=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_char=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_char=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_char=LDouble+ else+ fptools_cv_htype_sup_char=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((char)(-1)) < ((char)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(char) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_char=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_char="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_char="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_char" = no+ then++ fptools_cv_htype_char=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_char" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_char" >&5+$as_echo "$fptools_cv_htype_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CHAR $fptools_cv_htype_char+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for signed char" >&5+$as_echo_n "checking Haskell type for signed char... " >&6; }+ if ${fptools_cv_htype_signed_char+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_signed_char=yes+ if ac_fn_c_compute_int "$LINENO" "(signed char)0.2 - (signed char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+signed char val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_signed_char="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_signed_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_signed_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_signed_char=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_signed_char=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_signed_char=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_signed_char=LDouble+ else+ fptools_cv_htype_sup_signed_char=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((signed char)(-1)) < ((signed char)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_signed_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(signed char) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_signed_char=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_signed_char="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_signed_char="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_signed_char" = no+ then++ fptools_cv_htype_signed_char=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_signed_char" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_signed_char" >&5+$as_echo "$fptools_cv_htype_signed_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned char" >&5+$as_echo_n "checking Haskell type for unsigned char... " >&6; }+ if ${fptools_cv_htype_unsigned_char+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_unsigned_char=yes+ if ac_fn_c_compute_int "$LINENO" "(unsigned char)0.2 - (unsigned char)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+unsigned char val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_unsigned_char="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_char=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_unsigned_char=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_char=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_char=LDouble+ else+ fptools_cv_htype_sup_unsigned_char=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((unsigned char)(-1)) < ((unsigned char)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_char=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned char) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_char=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_unsigned_char="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_unsigned_char="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_unsigned_char" = no+ then++ fptools_cv_htype_unsigned_char=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_unsigned_char" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_char" >&5+$as_echo "$fptools_cv_htype_unsigned_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for short" >&5+$as_echo_n "checking Haskell type for short... " >&6; }+ if ${fptools_cv_htype_short+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_short=yes+ if ac_fn_c_compute_int "$LINENO" "(short)0.2 - (short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+short val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_short="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(short) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_short=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_short=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_short=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_short=LDouble+ else+ fptools_cv_htype_sup_short=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((short)(-1)) < ((short)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(short) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_short=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_short="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_short="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_short" = no+ then++ fptools_cv_htype_short=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_short" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_short" >&5+$as_echo "$fptools_cv_htype_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SHORT $fptools_cv_htype_short+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned short" >&5+$as_echo_n "checking Haskell type for unsigned short... " >&6; }+ if ${fptools_cv_htype_unsigned_short+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_unsigned_short=yes+ if ac_fn_c_compute_int "$LINENO" "(unsigned short)0.2 - (unsigned short)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+unsigned short val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_unsigned_short="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_short=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_unsigned_short=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_short=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_short=LDouble+ else+ fptools_cv_htype_sup_unsigned_short=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((unsigned short)(-1)) < ((unsigned short)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_short=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned short) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_short=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_unsigned_short="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_unsigned_short="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_unsigned_short" = no+ then++ fptools_cv_htype_unsigned_short=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_unsigned_short" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_short" >&5+$as_echo "$fptools_cv_htype_unsigned_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for int" >&5+$as_echo_n "checking Haskell type for int... " >&6; }+ if ${fptools_cv_htype_int+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_int=yes+ if ac_fn_c_compute_int "$LINENO" "(int)0.2 - (int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+int val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_int="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(int) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_int=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_int=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_int=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_int=LDouble+ else+ fptools_cv_htype_sup_int=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((int)(-1)) < ((int)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(int) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_int=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_int="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_int="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_int" = no+ then++ fptools_cv_htype_int=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_int" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_int" >&5+$as_echo "$fptools_cv_htype_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INT $fptools_cv_htype_int+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned int" >&5+$as_echo_n "checking Haskell type for unsigned int... " >&6; }+ if ${fptools_cv_htype_unsigned_int+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_unsigned_int=yes+ if ac_fn_c_compute_int "$LINENO" "(unsigned int)0.2 - (unsigned int)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+unsigned int val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_unsigned_int="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_int=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_unsigned_int=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_int=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_int=LDouble+ else+ fptools_cv_htype_sup_unsigned_int=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((unsigned int)(-1)) < ((unsigned int)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_int=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned int) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_int=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_unsigned_int="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_unsigned_int="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_unsigned_int" = no+ then++ fptools_cv_htype_unsigned_int=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_unsigned_int" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_int" >&5+$as_echo "$fptools_cv_htype_unsigned_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long" >&5+$as_echo_n "checking Haskell type for long... " >&6; }+ if ${fptools_cv_htype_long+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_long=yes+ if ac_fn_c_compute_int "$LINENO" "(long)0.2 - (long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+long val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_long="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_long=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_long=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_long=LDouble+ else+ fptools_cv_htype_sup_long=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((long)(-1)) < ((long)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_long="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_long="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_long" = no+ then++ fptools_cv_htype_long=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_long" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long" >&5+$as_echo "$fptools_cv_htype_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG $fptools_cv_htype_long+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long" >&5+$as_echo_n "checking Haskell type for unsigned long... " >&6; }+ if ${fptools_cv_htype_unsigned_long+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_unsigned_long=yes+ if ac_fn_c_compute_int "$LINENO" "(unsigned long)0.2 - (unsigned long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+unsigned long val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_unsigned_long="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_unsigned_long=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_long=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_long=LDouble+ else+ fptools_cv_htype_sup_unsigned_long=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((unsigned long)(-1)) < ((unsigned long)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_unsigned_long="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_unsigned_long="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_unsigned_long" = no+ then++ fptools_cv_htype_unsigned_long=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_unsigned_long" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long+_ACEOF++ fi+++if test "$ac_cv_type_long_long" = yes; then+++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long long" >&5+$as_echo_n "checking Haskell type for long long... " >&6; }+ if ${fptools_cv_htype_long_long+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_long_long=yes+ if ac_fn_c_compute_int "$LINENO" "(long long)0.2 - (long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+long long val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_long_long="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long_long=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_long_long=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_long_long=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_long_long=LDouble+ else+ fptools_cv_htype_sup_long_long=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((long long)(-1)) < ((long long)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(long long) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_long_long=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_long_long="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_long_long="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_long_long" = no+ then++ fptools_cv_htype_long_long=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_long_long" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long_long" >&5+$as_echo "$fptools_cv_htype_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG_LONG $fptools_cv_htype_long_long+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long long" >&5+$as_echo_n "checking Haskell type for unsigned long long... " >&6; }+ if ${fptools_cv_htype_unsigned_long_long+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_unsigned_long_long=yes+ if ac_fn_c_compute_int "$LINENO" "(unsigned long long)0.2 - (unsigned long long)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+unsigned long long val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_unsigned_long_long="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long_long=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_unsigned_long_long=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_long_long=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_unsigned_long_long=LDouble+ else+ fptools_cv_htype_sup_unsigned_long_long=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((unsigned long long)(-1)) < ((unsigned long long)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long_long=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(unsigned long long) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_unsigned_long_long=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_unsigned_long_long="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_unsigned_long_long="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_unsigned_long_long" = no+ then++ fptools_cv_htype_unsigned_long_long=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long+_ACEOF++ fi+++fi+++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for bool" >&5+$as_echo_n "checking Haskell type for bool... " >&6; }+ if ${fptools_cv_htype_bool+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_bool=yes+ if ac_fn_c_compute_int "$LINENO" "(bool)0.2 - (bool)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+bool val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_bool="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_bool=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_bool=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(bool) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_bool=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_bool=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_bool=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_bool=LDouble+ else+ fptools_cv_htype_sup_bool=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((bool)(-1)) < ((bool)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_bool=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(bool) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_bool=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_bool="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_bool="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_bool" = no+ then++ fptools_cv_htype_bool=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_bool" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_bool" >&5+$as_echo "$fptools_cv_htype_bool" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_BOOL $fptools_cv_htype_bool+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for float" >&5+$as_echo_n "checking Haskell type for float... " >&6; }+ if ${fptools_cv_htype_float+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_float=yes+ if ac_fn_c_compute_int "$LINENO" "(float)0.2 - (float)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+float val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_float="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_float=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_float=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(float) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_float=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_float=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_float=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_float=LDouble+ else+ fptools_cv_htype_sup_float=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((float)(-1)) < ((float)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_float=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(float) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_float=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_float="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_float="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_float" = no+ then++ fptools_cv_htype_float=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_float" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_float" >&5+$as_echo "$fptools_cv_htype_float" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_FLOAT $fptools_cv_htype_float+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for double" >&5+$as_echo_n "checking Haskell type for double... " >&6; }+ if ${fptools_cv_htype_double+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_double=yes+ if ac_fn_c_compute_int "$LINENO" "(double)0.2 - (double)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+double val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_double="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_double=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_double=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(double) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_double=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_double=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_double=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_double=LDouble+ else+ fptools_cv_htype_sup_double=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((double)(-1)) < ((double)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_double=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(double) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_double=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_double="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_double="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_double" = no+ then++ fptools_cv_htype_double=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_double" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_double" >&5+$as_echo "$fptools_cv_htype_double" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DOUBLE $fptools_cv_htype_double+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ptrdiff_t" >&5+$as_echo_n "checking Haskell type for ptrdiff_t... " >&6; }+ if ${fptools_cv_htype_ptrdiff_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_ptrdiff_t=yes+ if ac_fn_c_compute_int "$LINENO" "(ptrdiff_t)0.2 - (ptrdiff_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+ptrdiff_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_ptrdiff_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ptrdiff_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ptrdiff_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ptrdiff_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_ptrdiff_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_ptrdiff_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_ptrdiff_t=LDouble+ else+ fptools_cv_htype_sup_ptrdiff_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((ptrdiff_t)(-1)) < ((ptrdiff_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ptrdiff_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ptrdiff_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ptrdiff_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_ptrdiff_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_ptrdiff_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_ptrdiff_t" = no+ then++ fptools_cv_htype_ptrdiff_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ptrdiff_t" >&5+$as_echo "$fptools_cv_htype_ptrdiff_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for size_t" >&5+$as_echo_n "checking Haskell type for size_t... " >&6; }+ if ${fptools_cv_htype_size_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_size_t=yes+ if ac_fn_c_compute_int "$LINENO" "(size_t)0.2 - (size_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+size_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_size_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_size_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_size_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_size_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_size_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_size_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_size_t=LDouble+ else+ fptools_cv_htype_sup_size_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((size_t)(-1)) < ((size_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_size_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(size_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_size_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_size_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_size_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_size_t" = no+ then++ fptools_cv_htype_size_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_size_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_size_t" >&5+$as_echo "$fptools_cv_htype_size_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIZE_T $fptools_cv_htype_size_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for wchar_t" >&5+$as_echo_n "checking Haskell type for wchar_t... " >&6; }+ if ${fptools_cv_htype_wchar_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_wchar_t=yes+ if ac_fn_c_compute_int "$LINENO" "(wchar_t)0.2 - (wchar_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+wchar_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_wchar_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_wchar_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_wchar_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_wchar_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_wchar_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_wchar_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_wchar_t=LDouble+ else+ fptools_cv_htype_sup_wchar_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((wchar_t)(-1)) < ((wchar_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_wchar_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(wchar_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_wchar_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_wchar_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_wchar_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_wchar_t" = no+ then++ fptools_cv_htype_wchar_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_wchar_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wchar_t" >&5+$as_echo "$fptools_cv_htype_wchar_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for sig_atomic_t" >&5+$as_echo_n "checking Haskell type for sig_atomic_t... " >&6; }+ if ${fptools_cv_htype_sig_atomic_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_sig_atomic_t=yes+ if ac_fn_c_compute_int "$LINENO" "(sig_atomic_t)0.2 - (sig_atomic_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+sig_atomic_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_sig_atomic_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_sig_atomic_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_sig_atomic_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_sig_atomic_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_sig_atomic_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_sig_atomic_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_sig_atomic_t=LDouble+ else+ fptools_cv_htype_sup_sig_atomic_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((sig_atomic_t)(-1)) < ((sig_atomic_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_sig_atomic_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(sig_atomic_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_sig_atomic_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_sig_atomic_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_sig_atomic_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_sig_atomic_t" = no+ then++ fptools_cv_htype_sig_atomic_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_sig_atomic_t" >&5+$as_echo "$fptools_cv_htype_sig_atomic_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for clock_t" >&5+$as_echo_n "checking Haskell type for clock_t... " >&6; }+ if ${fptools_cv_htype_clock_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_clock_t=yes+ if ac_fn_c_compute_int "$LINENO" "(clock_t)0.2 - (clock_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+clock_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_clock_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clock_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clock_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clock_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_clock_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_clock_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_clock_t=LDouble+ else+ fptools_cv_htype_sup_clock_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((clock_t)(-1)) < ((clock_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clock_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clock_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clock_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_clock_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_clock_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_clock_t" = no+ then++ fptools_cv_htype_clock_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_clock_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clock_t" >&5+$as_echo "$fptools_cv_htype_clock_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for time_t" >&5+$as_echo_n "checking Haskell type for time_t... " >&6; }+ if ${fptools_cv_htype_time_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_time_t=yes+ if ac_fn_c_compute_int "$LINENO" "(time_t)0.2 - (time_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+time_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_time_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_time_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_time_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_time_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_time_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_time_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_time_t=LDouble+ else+ fptools_cv_htype_sup_time_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((time_t)(-1)) < ((time_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_time_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(time_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_time_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_time_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_time_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_time_t" = no+ then++ fptools_cv_htype_time_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_time_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_time_t" >&5+$as_echo "$fptools_cv_htype_time_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TIME_T $fptools_cv_htype_time_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for useconds_t" >&5+$as_echo_n "checking Haskell type for useconds_t... " >&6; }+ if ${fptools_cv_htype_useconds_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_useconds_t=yes+ if ac_fn_c_compute_int "$LINENO" "(useconds_t)0.2 - (useconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+useconds_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_useconds_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_useconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_useconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_useconds_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_useconds_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_useconds_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_useconds_t=LDouble+ else+ fptools_cv_htype_sup_useconds_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((useconds_t)(-1)) < ((useconds_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_useconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(useconds_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_useconds_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_useconds_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_useconds_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_useconds_t" = no+ then++ fptools_cv_htype_useconds_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_useconds_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_useconds_t" >&5+$as_echo "$fptools_cv_htype_useconds_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_USECONDS_T $fptools_cv_htype_useconds_t+_ACEOF++ fi++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for suseconds_t" >&5+$as_echo_n "checking Haskell type for suseconds_t... " >&6; }+ if ${fptools_cv_htype_suseconds_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_suseconds_t=yes+ if ac_fn_c_compute_int "$LINENO" "(suseconds_t)0.2 - (suseconds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+suseconds_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_suseconds_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_suseconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_suseconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_suseconds_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_suseconds_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_suseconds_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_suseconds_t=LDouble+ else+ fptools_cv_htype_sup_suseconds_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((suseconds_t)(-1)) < ((suseconds_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_suseconds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(suseconds_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_suseconds_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_suseconds_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_suseconds_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_suseconds_t" = no+ then+ if test "$WINDOWS" = "YES"+ then+ fptools_cv_htype_suseconds_t=Int32+ fptools_cv_htype_sup_suseconds_t=yes+ else+ as_fn_error $? "type not found" "$LINENO" 5+ fi+ fi++ if test "$fptools_cv_htype_sup_suseconds_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_suseconds_t" >&5+$as_echo "$fptools_cv_htype_suseconds_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SUSECONDS_T $fptools_cv_htype_suseconds_t+_ACEOF++ fi++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for dev_t" >&5+$as_echo_n "checking Haskell type for dev_t... " >&6; }+ if ${fptools_cv_htype_dev_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_dev_t=yes+ if ac_fn_c_compute_int "$LINENO" "(dev_t)0.2 - (dev_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+dev_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_dev_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_dev_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_dev_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_dev_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_dev_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_dev_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_dev_t=LDouble+ else+ fptools_cv_htype_sup_dev_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((dev_t)(-1)) < ((dev_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_dev_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(dev_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_dev_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_dev_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_dev_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_dev_t" = no+ then++ fptools_cv_htype_dev_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_dev_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_dev_t" >&5+$as_echo "$fptools_cv_htype_dev_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DEV_T $fptools_cv_htype_dev_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ino_t" >&5+$as_echo_n "checking Haskell type for ino_t... " >&6; }+ if ${fptools_cv_htype_ino_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_ino_t=yes+ if ac_fn_c_compute_int "$LINENO" "(ino_t)0.2 - (ino_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+ino_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_ino_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ino_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ino_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ino_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_ino_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_ino_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_ino_t=LDouble+ else+ fptools_cv_htype_sup_ino_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((ino_t)(-1)) < ((ino_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ino_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ino_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ino_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_ino_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_ino_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_ino_t" = no+ then++ fptools_cv_htype_ino_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_ino_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ino_t" >&5+$as_echo "$fptools_cv_htype_ino_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INO_T $fptools_cv_htype_ino_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for mode_t" >&5+$as_echo_n "checking Haskell type for mode_t... " >&6; }+ if ${fptools_cv_htype_mode_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_mode_t=yes+ if ac_fn_c_compute_int "$LINENO" "(mode_t)0.2 - (mode_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+mode_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_mode_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_mode_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_mode_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_mode_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_mode_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_mode_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_mode_t=LDouble+ else+ fptools_cv_htype_sup_mode_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((mode_t)(-1)) < ((mode_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_mode_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(mode_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_mode_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_mode_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_mode_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_mode_t" = no+ then++ fptools_cv_htype_mode_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_mode_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_mode_t" >&5+$as_echo "$fptools_cv_htype_mode_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_MODE_T $fptools_cv_htype_mode_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for off_t" >&5+$as_echo_n "checking Haskell type for off_t... " >&6; }+ if ${fptools_cv_htype_off_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_off_t=yes+ if ac_fn_c_compute_int "$LINENO" "(off_t)0.2 - (off_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+off_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_off_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_off_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_off_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_off_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_off_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_off_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_off_t=LDouble+ else+ fptools_cv_htype_sup_off_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((off_t)(-1)) < ((off_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_off_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(off_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_off_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_off_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_off_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_off_t" = no+ then++ fptools_cv_htype_off_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_off_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_off_t" >&5+$as_echo "$fptools_cv_htype_off_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_OFF_T $fptools_cv_htype_off_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for pid_t" >&5+$as_echo_n "checking Haskell type for pid_t... " >&6; }+ if ${fptools_cv_htype_pid_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_pid_t=yes+ if ac_fn_c_compute_int "$LINENO" "(pid_t)0.2 - (pid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+pid_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_pid_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_pid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_pid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_pid_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_pid_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_pid_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_pid_t=LDouble+ else+ fptools_cv_htype_sup_pid_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((pid_t)(-1)) < ((pid_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_pid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(pid_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_pid_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_pid_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_pid_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_pid_t" = no+ then++ fptools_cv_htype_pid_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_pid_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_pid_t" >&5+$as_echo "$fptools_cv_htype_pid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PID_T $fptools_cv_htype_pid_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for gid_t" >&5+$as_echo_n "checking Haskell type for gid_t... " >&6; }+ if ${fptools_cv_htype_gid_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_gid_t=yes+ if ac_fn_c_compute_int "$LINENO" "(gid_t)0.2 - (gid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+gid_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_gid_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_gid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_gid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_gid_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_gid_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_gid_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_gid_t=LDouble+ else+ fptools_cv_htype_sup_gid_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((gid_t)(-1)) < ((gid_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_gid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(gid_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_gid_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_gid_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_gid_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_gid_t" = no+ then++ fptools_cv_htype_gid_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_gid_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_gid_t" >&5+$as_echo "$fptools_cv_htype_gid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_GID_T $fptools_cv_htype_gid_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uid_t" >&5+$as_echo_n "checking Haskell type for uid_t... " >&6; }+ if ${fptools_cv_htype_uid_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_uid_t=yes+ if ac_fn_c_compute_int "$LINENO" "(uid_t)0.2 - (uid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+uid_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_uid_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uid_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_uid_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_uid_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_uid_t=LDouble+ else+ fptools_cv_htype_sup_uid_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((uid_t)(-1)) < ((uid_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uid_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uid_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_uid_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_uid_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_uid_t" = no+ then++ fptools_cv_htype_uid_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_uid_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uid_t" >&5+$as_echo "$fptools_cv_htype_uid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UID_T $fptools_cv_htype_uid_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for cc_t" >&5+$as_echo_n "checking Haskell type for cc_t... " >&6; }+ if ${fptools_cv_htype_cc_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_cc_t=yes+ if ac_fn_c_compute_int "$LINENO" "(cc_t)0.2 - (cc_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+cc_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_cc_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_cc_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_cc_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_cc_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_cc_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_cc_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_cc_t=LDouble+ else+ fptools_cv_htype_sup_cc_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((cc_t)(-1)) < ((cc_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_cc_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(cc_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_cc_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_cc_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_cc_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_cc_t" = no+ then++ fptools_cv_htype_cc_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_cc_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_cc_t" >&5+$as_echo "$fptools_cv_htype_cc_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CC_T $fptools_cv_htype_cc_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for speed_t" >&5+$as_echo_n "checking Haskell type for speed_t... " >&6; }+ if ${fptools_cv_htype_speed_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_speed_t=yes+ if ac_fn_c_compute_int "$LINENO" "(speed_t)0.2 - (speed_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+speed_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_speed_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_speed_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_speed_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_speed_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_speed_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_speed_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_speed_t=LDouble+ else+ fptools_cv_htype_sup_speed_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((speed_t)(-1)) < ((speed_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_speed_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(speed_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_speed_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_speed_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_speed_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_speed_t" = no+ then++ fptools_cv_htype_speed_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_speed_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_speed_t" >&5+$as_echo "$fptools_cv_htype_speed_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SPEED_T $fptools_cv_htype_speed_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for tcflag_t" >&5+$as_echo_n "checking Haskell type for tcflag_t... " >&6; }+ if ${fptools_cv_htype_tcflag_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_tcflag_t=yes+ if ac_fn_c_compute_int "$LINENO" "(tcflag_t)0.2 - (tcflag_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+tcflag_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_tcflag_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_tcflag_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_tcflag_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_tcflag_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_tcflag_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_tcflag_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_tcflag_t=LDouble+ else+ fptools_cv_htype_sup_tcflag_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((tcflag_t)(-1)) < ((tcflag_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_tcflag_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(tcflag_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_tcflag_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_tcflag_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_tcflag_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_tcflag_t" = no+ then++ fptools_cv_htype_tcflag_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_tcflag_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_tcflag_t" >&5+$as_echo "$fptools_cv_htype_tcflag_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for nlink_t" >&5+$as_echo_n "checking Haskell type for nlink_t... " >&6; }+ if ${fptools_cv_htype_nlink_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_nlink_t=yes+ if ac_fn_c_compute_int "$LINENO" "(nlink_t)0.2 - (nlink_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+nlink_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_nlink_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nlink_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nlink_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nlink_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_nlink_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_nlink_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_nlink_t=LDouble+ else+ fptools_cv_htype_sup_nlink_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((nlink_t)(-1)) < ((nlink_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nlink_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nlink_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nlink_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_nlink_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_nlink_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_nlink_t" = no+ then++ fptools_cv_htype_nlink_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_nlink_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nlink_t" >&5+$as_echo "$fptools_cv_htype_nlink_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ssize_t" >&5+$as_echo_n "checking Haskell type for ssize_t... " >&6; }+ if ${fptools_cv_htype_ssize_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_ssize_t=yes+ if ac_fn_c_compute_int "$LINENO" "(ssize_t)0.2 - (ssize_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+ssize_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_ssize_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ssize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ssize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ssize_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_ssize_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_ssize_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_ssize_t=LDouble+ else+ fptools_cv_htype_sup_ssize_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((ssize_t)(-1)) < ((ssize_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ssize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(ssize_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_ssize_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_ssize_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_ssize_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_ssize_t" = no+ then++ fptools_cv_htype_ssize_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_ssize_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ssize_t" >&5+$as_echo "$fptools_cv_htype_ssize_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for rlim_t" >&5+$as_echo_n "checking Haskell type for rlim_t... " >&6; }+ if ${fptools_cv_htype_rlim_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_rlim_t=yes+ if ac_fn_c_compute_int "$LINENO" "(rlim_t)0.2 - (rlim_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+rlim_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_rlim_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_rlim_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_rlim_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_rlim_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_rlim_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_rlim_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_rlim_t=LDouble+ else+ fptools_cv_htype_sup_rlim_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((rlim_t)(-1)) < ((rlim_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_rlim_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(rlim_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_rlim_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_rlim_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_rlim_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_rlim_t" = no+ then++ fptools_cv_htype_rlim_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_rlim_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_rlim_t" >&5+$as_echo "$fptools_cv_htype_rlim_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for blksize_t" >&5+$as_echo_n "checking Haskell type for blksize_t... " >&6; }+ if ${fptools_cv_htype_blksize_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_blksize_t=yes+ if ac_fn_c_compute_int "$LINENO" "(blksize_t)0.2 - (blksize_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+blksize_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_blksize_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blksize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blksize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blksize_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_blksize_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_blksize_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_blksize_t=LDouble+ else+ fptools_cv_htype_sup_blksize_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((blksize_t)(-1)) < ((blksize_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blksize_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blksize_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blksize_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_blksize_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_blksize_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_blksize_t" = no+ then++ fptools_cv_htype_blksize_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_blksize_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_blksize_t" >&5+$as_echo "$fptools_cv_htype_blksize_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_BLKSIZE_T $fptools_cv_htype_blksize_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for blkcnt_t" >&5+$as_echo_n "checking Haskell type for blkcnt_t... " >&6; }+ if ${fptools_cv_htype_blkcnt_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_blkcnt_t=yes+ if ac_fn_c_compute_int "$LINENO" "(blkcnt_t)0.2 - (blkcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+blkcnt_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_blkcnt_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blkcnt_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_blkcnt_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_blkcnt_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_blkcnt_t=LDouble+ else+ fptools_cv_htype_sup_blkcnt_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((blkcnt_t)(-1)) < ((blkcnt_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(blkcnt_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_blkcnt_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_blkcnt_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_blkcnt_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_blkcnt_t" = no+ then++ fptools_cv_htype_blkcnt_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_blkcnt_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_blkcnt_t" >&5+$as_echo "$fptools_cv_htype_blkcnt_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_BLKCNT_T $fptools_cv_htype_blkcnt_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for clockid_t" >&5+$as_echo_n "checking Haskell type for clockid_t... " >&6; }+ if ${fptools_cv_htype_clockid_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_clockid_t=yes+ if ac_fn_c_compute_int "$LINENO" "(clockid_t)0.2 - (clockid_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+clockid_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_clockid_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clockid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clockid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clockid_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_clockid_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_clockid_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_clockid_t=LDouble+ else+ fptools_cv_htype_sup_clockid_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((clockid_t)(-1)) < ((clockid_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clockid_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(clockid_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_clockid_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_clockid_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_clockid_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_clockid_t" = no+ then++ fptools_cv_htype_clockid_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_clockid_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clockid_t" >&5+$as_echo "$fptools_cv_htype_clockid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CLOCKID_T $fptools_cv_htype_clockid_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for fsblkcnt_t" >&5+$as_echo_n "checking Haskell type for fsblkcnt_t... " >&6; }+ if ${fptools_cv_htype_fsblkcnt_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_fsblkcnt_t=yes+ if ac_fn_c_compute_int "$LINENO" "(fsblkcnt_t)0.2 - (fsblkcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+fsblkcnt_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_fsblkcnt_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsblkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsblkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsblkcnt_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_fsblkcnt_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_fsblkcnt_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_fsblkcnt_t=LDouble+ else+ fptools_cv_htype_sup_fsblkcnt_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((fsblkcnt_t)(-1)) < ((fsblkcnt_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsblkcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsblkcnt_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsblkcnt_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_fsblkcnt_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_fsblkcnt_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_fsblkcnt_t" = no+ then++ fptools_cv_htype_fsblkcnt_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_fsblkcnt_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_fsblkcnt_t" >&5+$as_echo "$fptools_cv_htype_fsblkcnt_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_FSBLKCNT_T $fptools_cv_htype_fsblkcnt_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for fsfilcnt_t" >&5+$as_echo_n "checking Haskell type for fsfilcnt_t... " >&6; }+ if ${fptools_cv_htype_fsfilcnt_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_fsfilcnt_t=yes+ if ac_fn_c_compute_int "$LINENO" "(fsfilcnt_t)0.2 - (fsfilcnt_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+fsfilcnt_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_fsfilcnt_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsfilcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsfilcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsfilcnt_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_fsfilcnt_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_fsfilcnt_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_fsfilcnt_t=LDouble+ else+ fptools_cv_htype_sup_fsfilcnt_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((fsfilcnt_t)(-1)) < ((fsfilcnt_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsfilcnt_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(fsfilcnt_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_fsfilcnt_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_fsfilcnt_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_fsfilcnt_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_fsfilcnt_t" = no+ then++ fptools_cv_htype_fsfilcnt_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_fsfilcnt_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_fsfilcnt_t" >&5+$as_echo "$fptools_cv_htype_fsfilcnt_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_FSFILCNT_T $fptools_cv_htype_fsfilcnt_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for id_t" >&5+$as_echo_n "checking Haskell type for id_t... " >&6; }+ if ${fptools_cv_htype_id_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_id_t=yes+ if ac_fn_c_compute_int "$LINENO" "(id_t)0.2 - (id_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+id_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_id_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_id_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_id_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_id_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_id_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_id_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_id_t=LDouble+ else+ fptools_cv_htype_sup_id_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((id_t)(-1)) < ((id_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_id_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(id_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_id_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_id_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_id_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_id_t" = no+ then++ fptools_cv_htype_id_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_id_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_id_t" >&5+$as_echo "$fptools_cv_htype_id_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_ID_T $fptools_cv_htype_id_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for key_t" >&5+$as_echo_n "checking Haskell type for key_t... " >&6; }+ if ${fptools_cv_htype_key_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_key_t=yes+ if ac_fn_c_compute_int "$LINENO" "(key_t)0.2 - (key_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+key_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_key_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_key_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_key_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_key_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_key_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_key_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_key_t=LDouble+ else+ fptools_cv_htype_sup_key_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((key_t)(-1)) < ((key_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_key_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(key_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_key_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_key_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_key_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_key_t" = no+ then++ fptools_cv_htype_key_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_key_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_key_t" >&5+$as_echo "$fptools_cv_htype_key_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_KEY_T $fptools_cv_htype_key_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for timer_t" >&5+$as_echo_n "checking Haskell type for timer_t... " >&6; }+ if ${fptools_cv_htype_timer_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_timer_t=yes+ if ac_fn_c_compute_int "$LINENO" "(timer_t)0.2 - (timer_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+timer_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_timer_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_timer_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_timer_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_timer_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_timer_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_timer_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_timer_t=LDouble+ else+ fptools_cv_htype_sup_timer_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((timer_t)(-1)) < ((timer_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_timer_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(timer_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_timer_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_timer_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_timer_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_timer_t" = no+ then++ fptools_cv_htype_timer_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_timer_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_timer_t" >&5+$as_echo "$fptools_cv_htype_timer_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TIMER_T $fptools_cv_htype_timer_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for socklen_t" >&5+$as_echo_n "checking Haskell type for socklen_t... " >&6; }+ if ${fptools_cv_htype_socklen_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_socklen_t=yes+ if ac_fn_c_compute_int "$LINENO" "(socklen_t)0.2 - (socklen_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+socklen_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_socklen_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_socklen_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_socklen_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_socklen_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_socklen_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_socklen_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_socklen_t=LDouble+ else+ fptools_cv_htype_sup_socklen_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((socklen_t)(-1)) < ((socklen_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_socklen_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(socklen_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_socklen_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_socklen_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_socklen_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_socklen_t" = no+ then++ fptools_cv_htype_socklen_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_socklen_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_socklen_t" >&5+$as_echo "$fptools_cv_htype_socklen_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SOCKLEN_T $fptools_cv_htype_socklen_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for nfds_t" >&5+$as_echo_n "checking Haskell type for nfds_t... " >&6; }+ if ${fptools_cv_htype_nfds_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_nfds_t=yes+ if ac_fn_c_compute_int "$LINENO" "(nfds_t)0.2 - (nfds_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+nfds_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_nfds_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nfds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nfds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nfds_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_nfds_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_nfds_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_nfds_t=LDouble+ else+ fptools_cv_htype_sup_nfds_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((nfds_t)(-1)) < ((nfds_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nfds_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(nfds_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_nfds_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_nfds_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_nfds_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_nfds_t" = no+ then++ fptools_cv_htype_nfds_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_nfds_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nfds_t" >&5+$as_echo "$fptools_cv_htype_nfds_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_NFDS_T $fptools_cv_htype_nfds_t+_ACEOF++ fi++++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intptr_t" >&5+$as_echo_n "checking Haskell type for intptr_t... " >&6; }+ if ${fptools_cv_htype_intptr_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_intptr_t=yes+ if ac_fn_c_compute_int "$LINENO" "(intptr_t)0.2 - (intptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+intptr_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_intptr_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intptr_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_intptr_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_intptr_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_intptr_t=LDouble+ else+ fptools_cv_htype_sup_intptr_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((intptr_t)(-1)) < ((intptr_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intptr_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intptr_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_intptr_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_intptr_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_intptr_t" = no+ then++ fptools_cv_htype_intptr_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_intptr_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intptr_t" >&5+$as_echo "$fptools_cv_htype_intptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintptr_t" >&5+$as_echo_n "checking Haskell type for uintptr_t... " >&6; }+ if ${fptools_cv_htype_uintptr_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_uintptr_t=yes+ if ac_fn_c_compute_int "$LINENO" "(uintptr_t)0.2 - (uintptr_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+uintptr_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_uintptr_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintptr_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_uintptr_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_uintptr_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_uintptr_t=LDouble+ else+ fptools_cv_htype_sup_uintptr_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((uintptr_t)(-1)) < ((uintptr_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintptr_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintptr_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintptr_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_uintptr_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_uintptr_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_uintptr_t" = no+ then++ fptools_cv_htype_uintptr_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_uintptr_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintptr_t" >&5+$as_echo "$fptools_cv_htype_uintptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intmax_t" >&5+$as_echo_n "checking Haskell type for intmax_t... " >&6; }+ if ${fptools_cv_htype_intmax_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_intmax_t=yes+ if ac_fn_c_compute_int "$LINENO" "(intmax_t)0.2 - (intmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+intmax_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_intmax_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intmax_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_intmax_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_intmax_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_intmax_t=LDouble+ else+ fptools_cv_htype_sup_intmax_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((intmax_t)(-1)) < ((intmax_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(intmax_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_intmax_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_intmax_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_intmax_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_intmax_t" = no+ then++ fptools_cv_htype_intmax_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_intmax_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intmax_t" >&5+$as_echo "$fptools_cv_htype_intmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t+_ACEOF++ fi+++++++++++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintmax_t" >&5+$as_echo_n "checking Haskell type for uintmax_t... " >&6; }+ if ${fptools_cv_htype_uintmax_t+:} false; then :+ $as_echo_n "(cached) " >&6+else++ fptools_cv_htype_sup_uintmax_t=yes+ if ac_fn_c_compute_int "$LINENO" "(uintmax_t)0.2 - (uintmax_t)0.4 < 0 ? 0 : 1" "HTYPE_IS_INTEGRAL" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ HTYPE_IS_INTEGRAL=0+fi+++ if test "$HTYPE_IS_INTEGRAL" -eq 0+ then+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>++int+main ()+{+uintmax_t val; *val;++ ;+ return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+ HTYPE_IS_POINTER=yes+else+ HTYPE_IS_POINTER=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++ if test "$HTYPE_IS_POINTER" = yes+ then+ fptools_cv_htype_uintmax_t="Ptr ()"+ else+ if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(float)" "HTYPE_IS_FLOAT" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(double)" "HTYPE_IS_DOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) == sizeof(long double)" "HTYPE_IS_LDOUBLE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintmax_t=no+fi++ if test "$HTYPE_IS_FLOAT" -eq 1+ then+ fptools_cv_htype_uintmax_t=Float+ elif test "$HTYPE_IS_DOUBLE" -eq 1+ then+ fptools_cv_htype_uintmax_t=Double+ elif test "$HTYPE_IS_LDOUBLE" -eq 1+ then+ fptools_cv_htype_uintmax_t=LDouble+ else+ fptools_cv_htype_sup_uintmax_t=no+ fi+ fi+ else+ if ac_fn_c_compute_int "$LINENO" "((uintmax_t)(-1)) < ((uintmax_t)0)" "HTYPE_IS_SIGNED" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintmax_t=no+fi++ if ac_fn_c_compute_int "$LINENO" "sizeof(uintmax_t) * 8" "HTYPE_SIZE" "+#include <stdbool.h>+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+# include <stdint.h>+# endif+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#if HAVE_POLL_H+# include <poll.h>+#endif++#if HAVE_SYS_SOCKET_H+# include <sys/socket.h>+#endif++#include <stdlib.h>+"; then :++else+ fptools_cv_htype_sup_uintmax_t=no+fi++ if test "$HTYPE_IS_SIGNED" -eq 0+ then+ fptools_cv_htype_uintmax_t="Word$HTYPE_SIZE"+ else+ fptools_cv_htype_uintmax_t="Int$HTYPE_SIZE"+ fi+ fi++fi++ if test "$fptools_cv_htype_sup_uintmax_t" = no+ then++ fptools_cv_htype_uintmax_t=NotReallyAType+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }++ fi++ if test "$fptools_cv_htype_sup_uintmax_t" = yes; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintmax_t" >&5+$as_echo "$fptools_cv_htype_uintmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t+_ACEOF++ fi++++# test errno values+for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR ENOTSUP+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if eval \${$as_fp_Cache+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result" "#include <stdio.h>+#include <errno.h>+"; then :++else+ fp_check_const_result='-1'+fi++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++# we need SIGINT in TopHandler.lhs+for fp_const_name in SIGINT+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if eval \${$as_fp_Cache+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result" "+#if HAVE_SIGNAL_H+#include <signal.h>+#endif+"; then :++else+ fp_check_const_result='-1'+fi++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of O_BINARY" >&5+$as_echo_n "checking value of O_BINARY... " >&6; }+if ${fp_cv_const_O_BINARY+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "O_BINARY" "fp_check_const_result" "#include <fcntl.h>+"; then :++else+ fp_check_const_result=0+fi++fp_cv_const_O_BINARY=$fp_check_const_result+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_const_O_BINARY" >&5+$as_echo "$fp_cv_const_O_BINARY" >&6; }+cat >>confdefs.h <<_ACEOF+#define CONST_O_BINARY $fp_cv_const_O_BINARY+_ACEOF+++# We don't use iconv or libcharset on Windows, but if configure finds+# them then it can cause problems. So we don't even try looking if+# we are on Windows.+# See http://www.haskell.org/pipermail/cvs-ghc/2011-September/065980.html+if test "$WINDOWS" = "NO"+then++# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h+# header needs to be included as iconv_open is #define'd to something+# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us+# to give prototype text.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5+$as_echo_n "checking for library containing iconv... " >&6; }+if ${ac_cv_search_iconv+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */++#include <stddef.h>+#include <iconv.h>++int+main ()+{+iconv_t cd;+ cd = iconv_open("", "");+ iconv(cd,NULL,NULL,NULL,NULL);+ iconv_close(cd);+ ;+ return 0;+}+_ACEOF+for ac_lib in '' iconv; do+ if test -z "$ac_lib"; then+ ac_res="none required"+ else+ ac_res=-l$ac_lib+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"+ fi+ if ac_fn_c_try_link "$LINENO"; then :+ ac_cv_search_iconv=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+ conftest$ac_exeext+ if ${ac_cv_search_iconv+:} false; then :+ break+fi+done+if ${ac_cv_search_iconv+:} false; then :++else+ ac_cv_search_iconv=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5+$as_echo "$ac_cv_search_iconv" >&6; }+ac_res=$ac_cv_search_iconv+if test "$ac_res" != no; then :+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"+ EXTRA_LIBS="$EXTRA_LIBS $ac_lib"+else+ as_fn_error $? "iconv is required on non-Windows platforms" "$LINENO" 5+fi++# If possible, we use libcharset instead of nl_langinfo(CODESET) to+# determine the current locale's character encoding. Allow the user+# to disable this with --without-libcharset if they don't want a+# dependency on libcharset.++# Check whether --with-libcharset was given.+if test "${with_libcharset+set}" = set; then :+ withval=$with_libcharset;+else+ with_libcharset=check+fi+++if test "x$with_libcharset" != xno; then :+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing locale_charset" >&5+$as_echo_n "checking for library containing locale_charset... " >&6; }+if ${ac_cv_search_locale_charset+:} false; then :+ $as_echo_n "(cached) " >&6+else+ ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h. */+#include <libcharset.h>+int+main ()+{+const char* charset = locale_charset();+ ;+ return 0;+}+_ACEOF+for ac_lib in '' charset; do+ if test -z "$ac_lib"; then+ ac_res="none required"+ else+ ac_res=-l$ac_lib+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"+ fi+ if ac_fn_c_try_link "$LINENO"; then :+ ac_cv_search_locale_charset=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+ conftest$ac_exeext+ if ${ac_cv_search_locale_charset+:} false; then :+ break+fi+done+if ${ac_cv_search_locale_charset+:} false; then :++else+ ac_cv_search_locale_charset=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_locale_charset" >&5+$as_echo "$ac_cv_search_locale_charset" >&6; }+ac_res=$ac_cv_search_locale_charset+if test "$ac_res" != no; then :+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"++$as_echo "#define HAVE_LIBCHARSET 1" >>confdefs.h++ EXTRA_LIBS="$EXTRA_LIBS $ac_lib"++fi+fi++fi++ac_fn_c_check_type "$LINENO" "struct MD5Context" "ac_cv_type_struct_MD5Context" "#include \"include/md5.h\"+"+if test "x$ac_cv_type_struct_MD5Context" = xyes; then :++else+ as_fn_error $? "internal error" "$LINENO" 5+fi++# The cast to long int works around a bug in the HP C Compiler+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.+# This bug is HP SR number 8606223364.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct MD5Context" >&5+$as_echo_n "checking size of struct MD5Context... " >&6; }+if ${ac_cv_sizeof_struct_MD5Context+:} false; then :+ $as_echo_n "(cached) " >&6+else+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct MD5Context))" "ac_cv_sizeof_struct_MD5Context" "#include \"include/md5.h\"+"; then :++else+ if test "$ac_cv_type_struct_MD5Context" = yes; then+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error 77 "cannot compute sizeof (struct MD5Context)+See \`config.log' for more details" "$LINENO" 5; }+ else+ ac_cv_sizeof_struct_MD5Context=0+ fi+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_MD5Context" >&5+$as_echo "$ac_cv_sizeof_struct_MD5Context" >&6; }++++cat >>confdefs.h <<_ACEOF+#define SIZEOF_STRUCT_MD5CONTEXT $ac_cv_sizeof_struct_MD5Context+_ACEOF+++++ac_config_files="$ac_config_files base.buildinfo"+++cat >confcache <<\_ACEOF+# This file is a shell script that caches the results of configure+# tests run on this system so they can be shared between configure+# scripts and configure runs, see configure's option --config-cache.+# It is not useful on other systems. If it contains results you don't+# want to keep, you may remove or edit it.+#+# config.status only pays attention to the cache file if you give it+# the --recheck option to rerun configure.+#+# `ac_cv_env_foo' variables (set or unset) will be overridden when+# loading this file, other *unset* `ac_cv_foo' will be assigned the+# following values.++_ACEOF++# The following way of writing the cache mishandles newlines in values,+# but we know of no workaround that is simple, portable, and efficient.+# So, we kill variables containing newlines.+# Ultrix sh set writes to stderr and can't be redirected directly,+# and sets the high bit in the cache file unless we assign to the vars.+(+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do+ eval ac_val=\$$ac_var+ case $ac_val in #(+ *${as_nl}*)+ case $ac_var in #(+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+ esac+ case $ac_var in #(+ _ | IFS | as_nl) ;; #(+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+ *) { eval $ac_var=; unset $ac_var;} ;;+ esac ;;+ esac+ done++ (set) 2>&1 |+ case $as_nl`(ac_space=' '; set) 2>&1` in #(+ *${as_nl}ac_space=\ *)+ # `set' does not quote correctly, so add quotes: double-quote+ # substitution turns \\\\ into \\, and sed turns \\ into \.+ sed -n \+ "s/'/'\\\\''/g;+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"+ ;; #(+ *)+ # `set' quotes correctly as required by POSIX, so do not add quotes.+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+ ;;+ esac |+ sort+) |+ sed '+ /^ac_cv_env_/b end+ t clear+ :clear+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/+ t end+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/+ :end' >>confcache+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else+ if test -w "$cache_file"; then+ if test "x$cache_file" != "x/dev/null"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5+$as_echo "$as_me: updating cache $cache_file" >&6;}+ if test ! -f "$cache_file" || test -h "$cache_file"; then+ cat confcache >"$cache_file"+ else+ case $cache_file in #(+ */* | ?:*)+ mv -f confcache "$cache_file"$$ &&+ mv -f "$cache_file"$$ "$cache_file" ;; #(+ *)+ mv -f confcache "$cache_file" ;;+ esac+ fi+ fi+ else+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}+ fi+fi+rm -f confcache++test "x$prefix" = xNONE && prefix=$ac_default_prefix+# Let make expand exec_prefix.+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'++DEFS=-DHAVE_CONFIG_H++ac_libobjs=+ac_ltlibobjs=+U=+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue+ # 1. Remove the extension, and $U if already installed.+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR+ # will be set to the directory where LIBOBJS objects are built.+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'+done+LIBOBJS=$ac_libobjs++LTLIBOBJS=$ac_ltlibobjs++++: "${CONFIG_STATUS=./config.status}"+ac_write_fail=0+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files $CONFIG_STATUS"+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}+as_write_fail=0+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1+#! $SHELL+# Generated by $as_me.+# Run this file to recreate the current configuration.+# Compiler output produced by configure, useful for debugging+# configure, is in config.log if it exists.++debug=false+ac_cs_recheck=false+ac_cs_silent=false++SHELL=\${CONFIG_SHELL-$SHELL}+export SHELL+_ASEOF+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+ emulate sh+ NULLCMD=:+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+ # is contrary to our usage. Disable this feature.+ alias -g '${1+"$@"}'='"$@"'+ setopt NO_GLOB_SUBST+else+ case `(set -o) 2>/dev/null` in #(+ *posix*) :+ set -o posix ;; #(+ *) :+ ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+ as_echo='print -r --'+ as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+ as_echo='printf %s\n'+ as_echo_n='printf %s'+else+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+ as_echo_n='/usr/ucb/echo -n'+ else+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+ as_echo_n_body='eval+ arg=$1;+ case $arg in #(+ *"$as_nl"*)+ expr "X$arg" : "X\\(.*\\)$as_nl";+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+ esac;+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+ '+ export as_echo_n_body+ as_echo_n='sh -c $as_echo_n_body as_echo'+ fi+ export as_echo_body+ as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+ PATH_SEPARATOR=:+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+ PATH_SEPARATOR=';'+ }+fi+++# IFS+# We need space, tab and new line, in precisely that order. Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" "" $as_nl"++# Find who we are. Look in the path if we contain no directory separator.+as_myself=+case $0 in #((+ *[\\/]* ) as_myself=$0 ;;+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+ done+IFS=$as_save_IFS++ ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+ as_myself=$0+fi+if test ! -f "$as_myself"; then+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+ exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there. '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH+++# as_fn_error STATUS ERROR [LINENO LOG_FD]+# ----------------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with STATUS, using 1 if that was 0.+as_fn_error ()+{+ as_status=$1; test $as_status -eq 0 && as_status=1+ if test "$4"; then+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4+ fi+ $as_echo "$as_me: error: $2" >&2+ as_fn_exit $as_status+} # as_fn_error+++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+ return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+ set +e+ as_fn_set_status $1+ exit $1+} # as_fn_exit++# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+ { eval $1=; unset $1;}+}+as_unset=as_fn_unset+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+ eval 'as_fn_append ()+ {+ eval $1+=\$2+ }'+else+ as_fn_append ()+ {+ eval $1=\$$1\$2+ }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+ eval 'as_fn_arith ()+ {+ as_val=$(( $* ))+ }'+else+ as_fn_arith ()+ {+ as_val=`expr "$@" || test $? -eq 1`+ }+fi # as_fn_arith+++if expr a : '\(a\)' >/dev/null 2>&1 &&+ test "X`expr 00001 : '.*\(...\)'`" = X001; then+ as_expr=expr+else+ as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+ as_basename=basename+else+ as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+ as_dirname=dirname+else+ as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+ X"$0" : 'X\(//\)$' \| \+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+ sed '/^.*\/\([^/][^/]*\)\/*$/{+ s//\1/+ q+ }+ /^X\/\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\/\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+ case `echo 'xy\c'` in+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.+ xy) ECHO_C='\c';;+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null+ ECHO_T=' ';;+ esac;;+*)+ ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+ rm -f conf$$.dir/conf$$.file+else+ rm -f conf$$.dir+ mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+ if ln -s conf$$.file conf$$ 2>/dev/null; then+ as_ln_s='ln -s'+ # ... but there are two gotchas:+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+ # In both cases, we have to default to `cp -pR'.+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+ as_ln_s='cp -pR'+ elif ln conf$$.file conf$$ 2>/dev/null; then+ as_ln_s=ln+ else+ as_ln_s='cp -pR'+ fi+else+ as_ln_s='cp -pR'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null+++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++ case $as_dir in #(+ -*) as_dir=./$as_dir;;+ esac+ test -d "$as_dir" || eval $as_mkdir_p || {+ as_dirs=+ while :; do+ case $as_dir in #(+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+ *) as_qdir=$as_dir;;+ esac+ as_dirs="'$as_qdir' $as_dirs"+ as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$as_dir" : 'X\(//\)[^/]' \| \+ X"$as_dir" : 'X\(//\)$' \| \+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+ s//\1/+ q+ }+ /^X\(\/\/\)[^/].*/{+ s//\1/+ q+ }+ /^X\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`+ test -d "$as_dir" && break+ done+ test -z "$as_dirs" || eval "mkdir $as_dirs"+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"+++} # as_fn_mkdir_p+if mkdir -p . 2>/dev/null; then+ as_mkdir_p='mkdir -p "$as_dir"'+else+ test -d ./-p && rmdir ./-p+ as_mkdir_p=false+fi+++# as_fn_executable_p FILE+# -----------------------+# Test if FILE is an executable regular file.+as_fn_executable_p ()+{+ test -f "$1" && test -x "$1"+} # as_fn_executable_p+as_test_x='test -x'+as_executable_p=as_fn_executable_p++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++exec 6>&1+## ----------------------------------- ##+## Main body of $CONFIG_STATUS script. ##+## ----------------------------------- ##+_ASEOF+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# Save the log message, to keep $0 and so on meaningful, and to+# report actual input values of CONFIG_FILES etc. instead of their+# values after options handling.+ac_log="+This file was extended by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.69. Invocation command line was++ CONFIG_FILES = $CONFIG_FILES+ CONFIG_HEADERS = $CONFIG_HEADERS+ CONFIG_LINKS = $CONFIG_LINKS+ CONFIG_COMMANDS = $CONFIG_COMMANDS+ $ $0 $@++on `(hostname || uname -n) 2>/dev/null | sed 1q`+"++_ACEOF++case $ac_config_files in *"+"*) set x $ac_config_files; shift; ac_config_files=$*;;+esac++case $ac_config_headers in *"+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;+esac+++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+# Files that config.status was made for.+config_files="$ac_config_files"+config_headers="$ac_config_headers"++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+ac_cs_usage="\+\`$as_me' instantiates files and other configuration actions+from templates according to the current configuration. Unless the files+and actions are specified as TAGs, all are instantiated by default.++Usage: $0 [OPTION]... [TAG]...++ -h, --help print this help, then exit+ -V, --version print version number and configuration settings, then exit+ --config print configuration, then exit+ -q, --quiet, --silent+ do not print progress messages+ -d, --debug don't remove temporary files+ --recheck update $as_me by reconfiguring in the same conditions+ --file=FILE[:TEMPLATE]+ instantiate the configuration file FILE+ --header=FILE[:TEMPLATE]+ instantiate the configuration header FILE++Configuration files:+$config_files++Configuration headers:+$config_headers++Report bugs to <libraries@haskell.org>."++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"+ac_cs_version="\\+Haskell base package config.status 1.0+configured by $0, generated by GNU Autoconf 2.69,+ with options \\"\$ac_cs_config\\"++Copyright (C) 2012 Free Software Foundation, Inc.+This config.status script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it."++ac_pwd='$ac_pwd'+srcdir='$srcdir'+test -n "\$AWK" || AWK=awk+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# The default lists apply if the user does not specify any file.+ac_need_defaults=:+while test $# != 0+do+ case $1 in+ --*=?*)+ ac_option=`expr "X$1" : 'X\([^=]*\)='`+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`+ ac_shift=:+ ;;+ --*=)+ ac_option=`expr "X$1" : 'X\([^=]*\)='`+ ac_optarg=+ ac_shift=:+ ;;+ *)+ ac_option=$1+ ac_optarg=$2+ ac_shift=shift+ ;;+ esac++ case $ac_option in+ # Handling of the options.+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)+ ac_cs_recheck=: ;;+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )+ $as_echo "$ac_cs_version"; exit ;;+ --config | --confi | --conf | --con | --co | --c )+ $as_echo "$ac_cs_config"; exit ;;+ --debug | --debu | --deb | --de | --d | -d )+ debug=: ;;+ --file | --fil | --fi | --f )+ $ac_shift+ case $ac_optarg in+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+ '') as_fn_error $? "missing file argument" ;;+ esac+ as_fn_append CONFIG_FILES " '$ac_optarg'"+ ac_need_defaults=false;;+ --header | --heade | --head | --hea )+ $ac_shift+ case $ac_optarg in+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+ esac+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"+ ac_need_defaults=false;;+ --he | --h)+ # Conflict between --help and --header+ as_fn_error $? "ambiguous option: \`$1'+Try \`$0 --help' for more information.";;+ --help | --hel | -h )+ $as_echo "$ac_cs_usage"; exit ;;+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \+ | -silent | --silent | --silen | --sile | --sil | --si | --s)+ ac_cs_silent=: ;;++ # This is an error.+ -*) as_fn_error $? "unrecognized option: \`$1'+Try \`$0 --help' for more information." ;;++ *) as_fn_append ac_config_targets " $1"+ ac_need_defaults=false ;;++ esac+ shift+done++ac_configure_extra_args=++if $ac_cs_silent; then+ exec 6>/dev/null+ ac_configure_extra_args="$ac_configure_extra_args --silent"+fi++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+if \$ac_cs_recheck; then+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion+ shift+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6+ CONFIG_SHELL='$SHELL'+ export CONFIG_SHELL+ exec "\$@"+fi++_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+exec 5>>config.log+{+ echo+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX+## Running $as_me. ##+_ASBOX+ $as_echo "$ac_log"+} >&5++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1++# Handling of arguments.+for ac_config_target in $ac_config_targets+do+ case $ac_config_target in+ "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;+ "include/EventConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/EventConfig.h" ;;+ "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;++ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;+ esac+done+++# If the user did not use the arguments to specify the items to instantiate,+# then the envvar interface is used. Set only those that are not.+# We use the long form for the default assignment because of an extremely+# bizarre bug on SunOS 4.1.3.+if $ac_need_defaults; then+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers+fi++# Have a temporary directory for convenience. Make it in the build tree+# simply because there is no reason against having it here, and in addition,+# creating and moving files from /tmp can sometimes cause problems.+# Hook for its removal unless debugging.+# Note that there is a small window in which the directory will not be cleaned:+# after its creation but before its name has been assigned to `$tmp'.+$debug ||+{+ tmp= ac_tmp=+ trap 'exit_status=$?+ : "${ac_tmp:=$tmp}"+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status+' 0+ trap 'as_fn_exit 1' 1 2 13 15+}+# Create a (secure) tmp directory for tmp files.++{+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&+ test -d "$tmp"+} ||+{+ tmp=./conf$$-$RANDOM+ (umask 077 && mkdir "$tmp")+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5+ac_tmp=$tmp++# Set up the scripts for CONFIG_FILES section.+# No need to generate them if there are no CONFIG_FILES.+# This happens for instance with `./config.status config.h'.+if test -n "$CONFIG_FILES"; then+++ac_cr=`echo X | tr X '\015'`+# On cygwin, bash can eat \r inside `` if the user requested igncr.+# But we know of no other shell where ac_cr would be empty at this+# point, so we can use a bashism as a fallback.+if test "x$ac_cr" = x; then+ eval ac_cr=\$\'\\r\'+fi+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then+ ac_cs_awk_cr='\\r'+else+ ac_cs_awk_cr=$ac_cr+fi++echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&+_ACEOF+++{+ echo "cat >conf$$subs.awk <<_ACEOF" &&+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&+ echo "_ACEOF"+} >conf$$subs.sh ||+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`+ac_delim='%!_!# '+for ac_last_try in false false false false false :; do+ . ./conf$$subs.sh ||+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5++ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`+ if test $ac_delim_n = $ac_delim_num; then+ break+ elif $ac_last_try; then+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5+ else+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+ fi+done+rm -f conf$$subs.sh++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&+_ACEOF+sed -n '+h+s/^/S["/; s/!.*/"]=/+p+g+s/^[^!]*!//+:repl+t repl+s/'"$ac_delim"'$//+t delim+:nl+h+s/\(.\{148\}\)..*/\1/+t more1+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/+p+n+b repl+:more1+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t nl+:delim+h+s/\(.\{148\}\)..*/\1/+t more2+s/["\\]/\\&/g; s/^/"/; s/$/"/+p+b+:more2+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t delim+' <conf$$subs.awk | sed '+/^[^""]/{+ N+ s/\n//+}+' >>$CONFIG_STATUS || ac_write_fail=1+rm -f conf$$subs.awk+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACAWK+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&+ for (key in S) S_is_set[key] = 1+ FS = ""++}+{+ line = $ 0+ nfields = split(line, field, "@")+ substed = 0+ len = length(field[1])+ for (i = 2; i < nfields; i++) {+ key = field[i]+ keylen = length(key)+ if (S_is_set[key]) {+ value = S[key]+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)+ len += length(value) + length(field[++i])+ substed = 1+ } else+ len += 1 + keylen+ }++ print line+}++_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"+else+ cat+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5+_ACEOF++# VPATH may cause trouble with some makes, so we remove sole $(srcdir),+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and+# trailing colons and then remove the whole line if VPATH becomes empty+# (actually we leave an empty line to preserve line numbers).+if test "x$srcdir" = x.; then+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{+h+s///+s/^/:/+s/[ ]*$/:/+s/:\$(srcdir):/:/g+s/:\${srcdir}:/:/g+s/:@srcdir@:/:/g+s/^:*//+s/:*$//+x+s/\(=[ ]*\).*/\1/+G+s/\n//+s/^[^=]*=[ ]*$//+}'+fi++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+fi # test -n "$CONFIG_FILES"++# Set up the scripts for CONFIG_HEADERS section.+# No need to generate them if there are no CONFIG_HEADERS.+# This happens for instance with `./config.status Makefile'.+if test -n "$CONFIG_HEADERS"; then+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||+BEGIN {+_ACEOF++# Transform confdefs.h into an awk script `defines.awk', embedded as+# here-document in config.status, that substitutes the proper values into+# config.h.in to produce config.h.++# Create a delimiter string that does not exist in confdefs.h, to ease+# handling of long lines.+ac_delim='%!_!# '+for ac_last_try in false false :; do+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`+ if test -z "$ac_tt"; then+ break+ elif $ac_last_try; then+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5+ else+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+ fi+done++# For the awk script, D is an array of macro values keyed by name,+# likewise P contains macro parameters if any. Preserve backslash+# newline sequences.++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*+sed -n '+s/.\{148\}/&'"$ac_delim"'/g+t rset+:rset+s/^[ ]*#[ ]*define[ ][ ]*/ /+t def+d+:def+s/\\$//+t bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3"/p+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p+d+:bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3\\\\\\n"\\/p+t cont+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p+t cont+d+:cont+n+s/.\{148\}/&'"$ac_delim"'/g+t clear+:clear+s/\\$//+t bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/"/p+d+:bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p+b cont+' <confdefs.h | sed '+s/'"$ac_delim"'/"\\\+"/g' >>$CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ for (key in D) D_is_set[key] = 1+ FS = ""+}+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {+ line = \$ 0+ split(line, arg, " ")+ if (arg[1] == "#") {+ defundef = arg[2]+ mac1 = arg[3]+ } else {+ defundef = substr(arg[1], 2)+ mac1 = arg[2]+ }+ split(mac1, mac2, "(") #)+ macro = mac2[1]+ prefix = substr(line, 1, index(line, defundef) - 1)+ if (D_is_set[macro]) {+ # Preserve the white space surrounding the "#".+ print prefix "define", macro P[macro] D[macro]+ next+ } else {+ # Replace #undef with comments. This is necessary, for example,+ # in the case of _POSIX_SOURCE, which is predefined and required+ # on some systems where configure will not decide to define it.+ if (defundef == "undef") {+ print "/*", prefix defundef, macro, "*/"+ next+ }+ }+}+{ print }+_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5+fi # test -n "$CONFIG_HEADERS"+++eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "+shift+for ac_tag+do+ case $ac_tag in+ :[FHLC]) ac_mode=$ac_tag; continue;;+ esac+ case $ac_mode$ac_tag in+ :[FHL]*:*);;+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;+ :[FH]-) ac_tag=-:-;;+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;+ esac+ ac_save_IFS=$IFS+ IFS=:+ set x $ac_tag+ IFS=$ac_save_IFS+ shift+ ac_file=$1+ shift++ case $ac_mode in+ :L) ac_source=$1;;+ :[FH])+ ac_file_inputs=+ for ac_f+ do+ case $ac_f in+ -) ac_f="$ac_tmp/stdin";;+ *) # Look for the file first in the build tree, then in the source tree+ # (if the path is not absolute). The absolute path cannot be DOS-style,+ # because $ac_f cannot contain `:'.+ test -f "$ac_f" ||+ case $ac_f in+ [\\/$]*) false;;+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;+ esac ||+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;+ esac+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac+ as_fn_append ac_file_inputs " '$ac_f'"+ done++ # Let's still pretend it is `configure' which instantiates (i.e., don't+ # use $as_me), people would be surprised to read:+ # /* config.h. Generated by config.status. */+ configure_input='Generated from '`+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'+ `' by configure.'+ if test x"$ac_file" != x-; then+ configure_input="$ac_file. $configure_input"+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5+$as_echo "$as_me: creating $ac_file" >&6;}+ fi+ # Neutralize special characters interpreted by sed in replacement strings.+ case $configure_input in #(+ *\&* | *\|* | *\\* )+ ac_sed_conf_input=`$as_echo "$configure_input" |+ sed 's/[\\\\&|]/\\\\&/g'`;; #(+ *) ac_sed_conf_input=$configure_input;;+ esac++ case $ac_tag in+ *:-:* | *:-) cat >"$ac_tmp/stdin" \+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;+ esac+ ;;+ esac++ ac_dir=`$as_dirname -- "$ac_file" ||+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+ X"$ac_file" : 'X\(//\)[^/]' \| \+ X"$ac_file" : 'X\(//\)$' \| \+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$ac_file" |+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+ s//\1/+ q+ }+ /^X\(\/\/\)[^/].*/{+ s//\1/+ q+ }+ /^X\(\/\/\)$/{+ s//\1/+ q+ }+ /^X\(\/\).*/{+ s//\1/+ q+ }+ s/.*/./; q'`+ as_dir="$ac_dir"; as_fn_mkdir_p+ ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+ # A ".." for each directory in $ac_dir_suffix.+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+ case $ac_top_builddir_sub in+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;+ esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+ .) # We are building in place.+ ac_srcdir=.+ ac_top_srcdir=$ac_top_builddir_sub+ ac_abs_top_srcdir=$ac_pwd ;;+ [\\/]* | ?:[\\/]* ) # Absolute name.+ ac_srcdir=$srcdir$ac_dir_suffix;+ ac_top_srcdir=$srcdir+ ac_abs_top_srcdir=$srcdir ;;+ *) # Relative name.+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+ ac_top_srcdir=$ac_top_build_prefix$srcdir+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix+++ case $ac_mode in+ :F)+ #+ # CONFIG_FILE+ #++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# If the template does not know about datarootdir, expand it.+# FIXME: This hack should be removed a few years after 2.60.+ac_datarootdir_hack=; ac_datarootdir_seen=+ac_sed_dataroot='+/datarootdir/ {+ p+ q+}+/@datadir@/p+/@docdir@/p+/@infodir@/p+/@localedir@/p+/@mandir@/p'+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in+*datarootdir*) ac_datarootdir_seen=yes;;+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}+_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ ac_datarootdir_hack='+ s&@datadir@&$datadir&g+ s&@docdir@&$docdir&g+ s&@infodir@&$infodir&g+ s&@localedir@&$localedir&g+ s&@mandir@&$mandir&g+ s&\\\${datarootdir}&$datarootdir&g' ;;+esac+_ACEOF++# Neutralize VPATH when `$srcdir' = `.'.+# Shell code in configure.ac might set extrasub.+# FIXME: do we really want to maintain this feature?+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_sed_extra="$ac_vpsub+$extrasub+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+:t+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b+s|@configure_input@|$ac_sed_conf_input|;t t+s&@top_builddir@&$ac_top_builddir_sub&;t t+s&@top_build_prefix@&$ac_top_build_prefix&;t t+s&@srcdir@&$ac_srcdir&;t t+s&@abs_srcdir@&$ac_abs_srcdir&;t t+s&@top_srcdir@&$ac_top_srcdir&;t t+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t+s&@builddir@&$ac_builddir&;t t+s&@abs_builddir@&$ac_abs_builddir&;t t+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t+$ac_datarootdir_hack+"+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \+ "$ac_tmp/out"`; test -z "$ac_out"; } &&+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined. Please make sure it is defined" >&5+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined. Please make sure it is defined" >&2;}++ rm -f "$ac_tmp/stdin"+ case $ac_file in+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;+ esac \+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5+ ;;+ :H)+ #+ # CONFIG_HEADER+ #+ if test x"$ac_file" != x-; then+ {+ $as_echo "/* $configure_input */" \+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"+ } >"$ac_tmp/config.h" \+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5+$as_echo "$as_me: $ac_file is unchanged" >&6;}+ else+ rm -f "$ac_file"+ mv "$ac_tmp/config.h" "$ac_file" \+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5+ fi+ else+ $as_echo "/* $configure_input */" \+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \+ || as_fn_error $? "could not create -" "$LINENO" 5+ fi+ ;;+++ esac++done # for ac_tag+++as_fn_exit 0+_ACEOF+ac_clean_files=$ac_clean_files_save++test $ac_write_fail = 0 ||+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5+++# configure is writing to config.log, and then calls config.status.+# config.status does its own redirection, appending to config.log.+# Unfortunately, on DOS this fails, as config.log is still kept open+# by configure, so config.status won't be able to write to it; its+# output is simply discarded. So we exec the FD to /dev/null,+# effectively closing config.log, so it can be properly (re)opened and+# appended to by config.status. When coming back to configure, we+# need to make the FD available again.+if test "$no_create" != yes; then+ ac_cs_success=:+ ac_config_status_args=+ test "$silent" = yes &&+ ac_config_status_args="$ac_config_status_args --quiet"+ exec 5>/dev/null+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false+ exec 5>>config.log+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which+ # would make configure fail if this is the last instruction.+ $ac_cs_success || as_fn_exit 1+fi+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}+fi
configure.ac view
@@ -30,7 +30,7 @@ AC_SYS_LARGEFILE dnl ** check for wide-char classifications-dnl FreeBSD has an emtpy wctype.h, so test one of the affected+dnl FreeBSD has an empty wctype.h, so test one of the affected dnl functions if it's really there. AC_CHECK_HEADERS([wctype.h], [AC_CHECK_FUNCS(iswspace)]) @@ -99,7 +99,7 @@ AC_ARG_WITH([iconv-includes], [AS_HELP_STRING([--with-iconv-includes], [directory containing iconv.h])],- [ICONV_INCLUDE_DIRS=$withval],+ [ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval $CPPFLAGS"], [ICONV_INCLUDE_DIRS=]) AC_ARG_WITH([iconv-libraries],
include/HsBaseConfig.h.in view
@@ -372,8 +372,8 @@ /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT -/* Define to 1 if you have the <minix/config.h> header file. */-#undef HAVE_MINIX_CONFIG_H+/* Define to 1 if you have the <memory.h> header file. */+#undef HAVE_MEMORY_H /* Define if you have open file descriptor lock support. */ #undef HAVE_OFD_LOCKING@@ -390,9 +390,6 @@ /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H -/* Define to 1 if you have the <stdio.h> header file. */-#undef HAVE_STDIO_H- /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -468,9 +465,6 @@ /* Define to 1 if you have the <utime.h> header file. */ #undef HAVE_UTIME_H -/* Define to 1 if you have the <wchar.h> header file. */-#undef HAVE_WCHAR_H- /* Define to 1 if you have the <wctype.h> header file. */ #undef HAVE_WCTYPE_H @@ -657,9 +651,7 @@ /* The size of `struct MD5Context', as computed by sizeof. */ #undef SIZEOF_STRUCT_MD5CONTEXT -/* Define to 1 if all of the C90 standard headers exist (not just the ones- required in a freestanding environment). This macro is provided for- backward compatibility; new code need not use it. */+/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if stdlib.h declares unsetenv to return void. */@@ -669,92 +661,41 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif-/* Enable general extensions on macOS. */-#ifndef _DARWIN_C_SOURCE-# undef _DARWIN_C_SOURCE-#endif-/* Enable general extensions on Solaris. */-#ifndef __EXTENSIONS__-# undef __EXTENSIONS__-#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif-/* Enable X/Open compliant socket functions that do not require linking- with -lxnet on HP-UX 11.11. */-#ifndef _HPUX_ALT_XOPEN_SOCKET_API-# undef _HPUX_ALT_XOPEN_SOCKET_API-#endif-/* Identify the host operating system as Minix.- This macro does not affect the system headers' behavior.- A future release of Autoconf may stop defining this macro. */-#ifndef _MINIX-# undef _MINIX-#endif-/* Enable general extensions on NetBSD.- Enable NetBSD compatibility extensions on Minix. */-#ifndef _NETBSD_SOURCE-# undef _NETBSD_SOURCE-#endif-/* Enable OpenBSD compatibility extensions on NetBSD.- Oddly enough, this does nothing on OpenBSD. */-#ifndef _OPENBSD_SOURCE-# undef _OPENBSD_SOURCE-#endif-/* Define to 1 if needed for POSIX-compatible behavior. */-#ifndef _POSIX_SOURCE-# undef _POSIX_SOURCE-#endif-/* Define to 2 if needed for POSIX-compatible behavior. */-#ifndef _POSIX_1_SOURCE-# undef _POSIX_1_SOURCE-#endif-/* Enable POSIX-compatible threading on Solaris. */+/* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif-/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */-#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__-# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__-#endif-/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */-#ifndef __STDC_WANT_IEC_60559_BFP_EXT__-# undef __STDC_WANT_IEC_60559_BFP_EXT__-#endif-/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */-#ifndef __STDC_WANT_IEC_60559_DFP_EXT__-# undef __STDC_WANT_IEC_60559_DFP_EXT__-#endif-/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */-#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__-# undef __STDC_WANT_IEC_60559_FUNCS_EXT__-#endif-/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */-#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__-# undef __STDC_WANT_IEC_60559_TYPES_EXT__-#endif-/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */-#ifndef __STDC_WANT_LIB_EXT2__-# undef __STDC_WANT_LIB_EXT2__-#endif-/* Enable extensions specified by ISO/IEC 24747:2009. */-#ifndef __STDC_WANT_MATH_SPEC_FUNCS__-# undef __STDC_WANT_MATH_SPEC_FUNCS__-#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif-/* Enable X/Open extensions. Define to 500 only if necessary- to make mbstate_t available. */-#ifndef _XOPEN_SOURCE-# undef _XOPEN_SOURCE+/* Enable general extensions on Solaris. */+#ifndef __EXTENSIONS__+# undef __EXTENSIONS__ #endif +/* Enable large inode numbers on Mac OS X 10.5. */+#ifndef _DARWIN_USE_64_BIT_INODE+# define _DARWIN_USE_64_BIT_INODE 1+#endif+ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES++/* Define to 1 if on MINIX. */+#undef _MINIX++/* Define to 2 if the system does not provide POSIX.1 features except with+ this defined. */+#undef _POSIX_1_SOURCE++/* Define to 1 if you need to in order for `stat' and other things to work. */+#undef _POSIX_SOURCE
include/consUtils.h view
@@ -1,4 +1,4 @@-/* +/* * (c) The University of Glasgow, 2000-2002 * * Win32 Console API helpers.@@ -9,4 +9,3 @@ extern int set_console_buffering__(int fd, int cooked); extern int set_console_echo__(int fd, int on); extern int get_console_echo__(int fd);-extern int flush_input_console__ (int fd);
include/fs.h view
@@ -45,6 +45,5 @@ int FS(remove) (const char *path); int FS(_wremove) (const wchar_t *path); #else- FILE *FS(fopen) (const char* filename, const char* mode); #endif
+ include/winio_structs.h view
@@ -0,0 +1,40 @@+/*+ * (c) Tamar Christina, 2019.+ *+ * Structures supporting the IOCP based I/O Manager or Windows.+ */++#include <Windows.h>+#include <stdint.h>++#if defined(_WIN64)+# define ALIGNMENT __attribute__ ((aligned (8)))+#elif defined(_WIN32)+# define ALIGNMENT __attribute__ ((aligned (8)))+#else+# error "unknown environment, can't determine alignment"+#endif++/* Completion data structure. Must be kept in sync with that in+ GHC.Event.Windows or horrible things happen. */+typedef struct _CompletionData {+ /* The Handle to the object for which the I/O operation is in progress. */+ HWND cdHandle;+ /* Handle to the callback routine to call to notify that an operation has+ finished. This value is opaque as it shouldn't be accessible+ outside the Haskell world. */+ uintptr_t cdCallback;+} CompletionData, *LPCompletionData;++/* The Windows API Requires an OVERLAPPED struct for asynchronous access,+ however if we pad the structure we can give extra book keeping information+ without needing to look these up later. Do not modify this struct unless+ you know what you're doing. */+typedef struct _HASKELL_OVERLAPPED {+ /* Windows OVERLAPPED structure. NOTE: MUST BE FIRST element. */+ OVERLAPPED hoOverlapped;+ /* Pointer to additional payload in Haskell land. This will contain a+ foreign pointer. We only use atomic operations to access this field in+ order to correctly handle multiple threads using it. */+ LPCompletionData hoData ALIGNMENT;+} HASKELL_OVERLAPPED;