From: malcolm Date: Thu, 29 May 2003 17:37:19 +0000 (+0000) Subject: [project @ 2003-05-29 17:37:17 by malcolm] X-Git-Tag: nhc98-1-18-release~626 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=1db1d1749368c00079a1c764c9709908c2a92510;p=ghc-base.git [project @ 2003-05-29 17:37:17 by malcolm] For nhc98 only, export the basic C types non-abstractly. This is due to a deficiency in the way newtypes are handled in interface files - the compiler needs full information about the newtype in order to pass values across the FFI. --- diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs index c6106e0..cb8023b 100644 --- a/Foreign/C/Error.hs +++ b/Foreign/C/Error.hs @@ -120,9 +120,6 @@ import System.IO.Unsafe ( unsafePerformIO ) {-# CBITS errno.c #-} #endif -#ifdef __NHC__ -import NHC.FFI ( CInt(..) ) -#endif -- "errno" type -- ------------ diff --git a/Foreign/C/Types.hs b/Foreign/C/Types.hs index 15b624a..a36293e 100644 --- a/Foreign/C/Types.hs +++ b/Foreign/C/Types.hs @@ -14,6 +14,7 @@ ----------------------------------------------------------------------------- module Foreign.C.Types +#ifndef __NHC__ ( -- Integral types, instances of: Eq, Ord, Num, Read, Show, Enum, -- Typeable, Storable, Bounded, Real, Integral, Bits CChar, CSChar, CUChar @@ -29,6 +30,16 @@ module Foreign.C.Types -- Typeable, Storable, Real, Fractional, Floating, RealFrac, -- RealFloat , CFloat, CDouble, CLDouble +#else + ( -- Exported non-abstractly in nhc98 to fix an interface file problem. + CChar(..), CSChar(..), CUChar(..) + , CShort(..), CUShort(..), CInt(..), CUInt(..) + , CLong(..), CULong(..) + , CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..) + , CLLong(..), CULLong(..) + , CClock(..), CTime(..) + , CFloat(..), CDouble(..), CLDouble(..) +#endif -- Instances of: Eq and Storable , CFile, CFpos, CJmpBuf @@ -36,13 +47,13 @@ module Foreign.C.Types #ifdef __NHC__ import NHC.FFI - ( CChar, CSChar, CUChar - , CShort, CUShort, CInt, CUInt - , CLong, CULong, CLLong, CULLong - , CPtrdiff, CSize, CWchar, CSigAtomic - , CClock, CTime - , CFloat, CDouble, CLDouble - , CFile, CFpos, CJmpBuf + ( CChar(..), CSChar(..), CUChar(..) + , CShort(..), CUShort(..), CInt(..), CUInt(..) + , CLong(..), CULong(..), CLLong(..), CULLong(..) + , CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..) + , CClock(..), CTime(..) + , CFloat(..), CDouble(..), CLDouble(..) + , CFile, CFpos, CJmpBuf , Storable(..) ) #else diff --git a/Foreign/C/TypesISO.hs b/Foreign/C/TypesISO.hs index 21b0930..bde136c 100644 --- a/Foreign/C/TypesISO.hs +++ b/Foreign/C/TypesISO.hs @@ -16,6 +16,7 @@ -- #hide module Foreign.C.TypesISO +#ifndef __NHC__ ( -- Integral types, instances of: Eq, Ord, Num, Read, Show, Enum, -- Typeable, Storable, Bounded, Real, Integral, Bits CPtrdiff, CSize, CWchar, CSigAtomic @@ -23,6 +24,12 @@ module Foreign.C.TypesISO -- Numeric types, instances of: Eq, Ord, Num, Read, Show, Enum, -- Typeable, Storable , CClock, CTime +#else + ( -- For nhc98, these are exported non-abstractly to work around + -- an interface-file problem. + CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..) + , CClock(..), CTime(..) +#endif -- Instances of: Eq and Storable , CFile, CFpos, CJmpBuf @@ -30,12 +37,12 @@ module Foreign.C.TypesISO #ifdef __NHC__ import NHC.FFI - ( CPtrdiff - , CSize - , CWchar - , CSigAtomic - , CClock - , CTime + ( CPtrdiff(..) + , CSize(..) + , CWchar(..) + , CSigAtomic(..) + , CClock(..) + , CTime(..) , CFile , CFpos , CJmpBuf diff --git a/Foreign/Marshal/Utils.hs b/Foreign/Marshal/Utils.hs index c88fb51..8f11e56 100644 --- a/Foreign/Marshal/Utils.hs +++ b/Foreign/Marshal/Utils.hs @@ -64,7 +64,7 @@ import GHC.Base #endif #ifdef __NHC__ -import NHC.FFI ( CInt(..) ) +import Foreign.C.Types ( CInt(..) ) #endif -- combined allocation and marshalling