X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FC%2FTypes.hs;h=df1b98914ceac62fe62b8c2de8f3f359e30de311;hb=fd28932ae986f2a486b4b3463d7145d7f688048c;hp=ec1cbf11ca4ab7822271cc0e7ec685fe7163a290;hpb=4344a5127d6d2cde831ae630393be3ffe555af8e;p=ghc-base.git diff --git a/Foreign/C/Types.hs b/Foreign/C/Types.hs index ec1cbf1..df1b989 100644 --- a/Foreign/C/Types.hs +++ b/Foreign/C/Types.hs @@ -18,7 +18,10 @@ module Foreign.C.Types -- Typeable, Storable, Bounded, Real, Integral, Bits CChar(..), CSChar(..), CUChar(..) , CShort(..), CUShort(..), CInt(..), CUInt(..) - , CLong(..), CULong(..), CLLong(..), CULLong(..) + , CLong(..), CULong(..) +#ifndef __HUGS__ + , CLLong(..), CULLong(..) +#endif -- Floating types, instances of: Eq, Ord, Num, Read, Show, Enum, -- Typeable, Storable, Real, Fractional, Floating, RealFrac, @@ -41,6 +44,7 @@ import GHC.Read import GHC.Num #endif +#include "Dynamic.h" #include "CTypes.h" INTEGRAL_TYPE(CChar,tyConCChar,"CChar",HTYPE_CHAR) @@ -56,8 +60,10 @@ INTEGRAL_TYPE(CUInt,tyConCUInt,"CUInt",HTYPE_UNSIGNED_INT) INTEGRAL_TYPE(CLong,tyConCLong,"CLong",HTYPE_LONG) INTEGRAL_TYPE(CULong,tyConCULong,"CULong",HTYPE_UNSIGNED_LONG) +#ifndef __HUGS__ INTEGRAL_TYPE(CLLong,tyConCLLong,"CLLong",HTYPE_LONG_LONG) INTEGRAL_TYPE(CULLong,tyConCULLong,"CULLong",HTYPE_UNSIGNED_LONG_LONG) +#endif {-# RULES "fromIntegral/a->CChar" fromIntegral = \x -> CChar (fromIntegral x) @@ -90,24 +96,3 @@ FLOATING_TYPE(CDouble,tyConCDouble,"CDouble",HTYPE_DOUBLE) -- HACK: Currently no long double in the FFI, so we simply re-use double FLOATING_TYPE(CLDouble,tyConCLDouble,"CLDouble",HTYPE_DOUBLE) - -#include "Dynamic.h" -INSTANCE_TYPEABLE0(CChar,cCharTc,"CChar") -INSTANCE_TYPEABLE0(CSChar,cSCharTc,"CSChar") -INSTANCE_TYPEABLE0(CUChar,cUCharTc,"CUChar") - -INSTANCE_TYPEABLE0(CShort,cShortTc,"CShort") -INSTANCE_TYPEABLE0(CUShort,cUShortTc,"CUShort") - -INSTANCE_TYPEABLE0(CInt,cIntTc,"CInt") -INSTANCE_TYPEABLE0(CUInt,cUIntTc,"CUInt") - -INSTANCE_TYPEABLE0(CLong,cLongTc,"CLong") -INSTANCE_TYPEABLE0(CULong,cULongTc,"CULong") - -INSTANCE_TYPEABLE0(CLLong,cLLongTc,"CLLong") -INSTANCE_TYPEABLE0(CULLong,cULLongTc,"CULLong") - -INSTANCE_TYPEABLE0(CFloat,cFloatTc,"CFloat") -INSTANCE_TYPEABLE0(CDouble,cDoubleTc,"CDouble") -INSTANCE_TYPEABLE0(CLDouble,cLDoubleTc,"CLDouble")