{-# LANGUAGE CPP #-}
{-# LANGUAGE FieldSelectors #-}
module Botan.Bindings.ConstPtr (
ConstPtr(..)
) where
#if MIN_VERSION_base (4,18,0)
import Foreign.C.ConstPtr
#else
import Data.Data
import Data.Kind
import Foreign.Ptr
import Foreign.Storable
#endif
#if !(MIN_VERSION_base (4,18,0))
type ConstPtr :: Type -> Type
type role ConstPtr phantom
newtype ConstPtr a = ConstPtr { unConstPtr :: Ptr a }
deriving stock (Data)
deriving newtype (Eq, Ord, Storable)
instance Show (ConstPtr a) where
showsPrec d (ConstPtr p) = showParen (d > 10) $ showString "ConstPtr " . showsPrec 11 p
#endif