Commits

reid  committed 2d459e2

[project @ 2003-05-29 13:18:54 by reid]
Fixed all the errors I can find using ghc-5.04 (i.e., excluding any involving ForeignPtr) - can someone else have a shot at the rest?

  • Participants
  • Parent commits 557fa79

Comments (0)

Files changed (5)

 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.5 2003/05/28 20:28:28 reid Exp $
+# $Id: Makefile,v 1.6 2003/05/29 13:18:54 reid Exp $
 
 TOP = .
 include $(TOP)/mk/boilerplate.mk
 PACKAGE = Win32
 PACKAGE_DEPS = HSgreencard
 
-SRC_CC_OPTS += -Wall -Iinclude -I.
-SRC_HC_OPTS += -Wall -cpp -fglasgow-exts -fffi
+SRC_CC_OPTS += -Wall -Icbits
+# SRC_HC_OPTS += -Wall 
+SRC_HC_OPTS += -optc-Icbits
+SRC_HC_OPTS += -cpp -fglasgow-exts -fffi 
 SRC_HC_OPTS += -package HSgreencard
 
 SRC_HADDOCK_OPTS += -t "Win32 Libraries (Win32 package)"

File System/Win32/Bitmap.gc

 
 marshall_bITMAP_ :: BITMAP -> IO LPBITMAP
 marshall_bITMAP_ bmp = do
-  lpbmp <- malloc sizeofBITMAP
+  lpbmp <- mallocBytes (fromIntegral sizeofBITMAP)
   setBITMAP lpbmp bmp
   return lpbmp
 
 -- BITMAPINFO
 ----------------------------------------------------------------
 
-type LPBITMAPINFO = Ptr
+type LPBITMAPINFO = Ptr ()
 %dis lPBITMAPINFO x = ptr ({BITMAPINFO *} x)
 
 ----------------------------------------------------------------

File System/Win32/File.gc

 
 ----------------------------------------------------------------
 
-type LPSECURITY_ATTRIBUTES = Ptr
+type LPSECURITY_ATTRIBUTES = Ptr ()
 %dis mbLPSECURITY_ATTRIBUTES x = maybeT {nullPtr} (ptr x)
 type MbLPSECURITY_ATTRIBUTES = Maybe LPSECURITY_ATTRIBUTES
 
 %code BOOL success = ReadFile(arg1,arg2,arg3,&res1,arg4);
 %fail { !success } { ErrorString("ReadFile") }
 
-%fun win32_WriteFile :: HANDLE -> Ptr -> DWORD -> MbLPOVERLAPPED -> IO DWORD
+%fun win32_WriteFile :: HANDLE -> Addr -> DWORD -> MbLPOVERLAPPED -> IO DWORD
 %code  BOOL success = WriteFile(arg1,arg2,arg3,&res1,arg4);
 %fail { !success } { ErrorString("WriteFile") }
 

File System/Win32/GDITypes.gc

   zipWithM_ (setPOINT ps) [0..] cs
   return (ps,l)
   
-%fun mallocPOINTs :: Int -> IO Ptr ()
+%fun mallocPOINTs :: Int -> IO Addr
 %code ps = (POINT*) malloc(arg1 * sizeof(POINT));
 %fail {ps==0} { MallocError("mallocPOINTs") }
 %result (ptr ({POINT*} ps))

File System/Win32/Window.gc

 %dis windowClosure x = windowClosure_ (addr x)
  
 marshall_windowClosure_ :: WindowClosure -> IO (Addr)
-marshall_windowClosure_ cl = fmap funPtrToPtr (mkWindowClosure cl)
+marshall_windowClosure_ cl = fmap castFunPtrToPtr (mkWindowClosure cl)
 
 foreign import ccall "wrapper" mkWindowClosure :: WindowClosure -> IO (FunPtr WindowClosure)