[commit: packages/Win32] Mistuke-fix-build, depend-os-windows, fix-appveyor-curl-ussue, master, win32-2.5.4.1-ghc-8.2, win32-prepare-release-2.4.0.0: GitHub 53 haskell win32 issues (#57) (612e93c)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:27:49 UTC 2017


Repository : ssh://git@git.haskell.org/Win32

On branches: Mistuke-fix-build,depend-os-windows,fix-appveyor-curl-ussue,master,win32-2.5.4.1-ghc-8.2,win32-prepare-release-2.4.0.0
Link       : http://git.haskell.org/packages/Win32.git/commitdiff/612e93cdd68a4be3bf6dca83b475d1bca880a85d

>---------------------------------------------------------------

commit 612e93cdd68a4be3bf6dca83b475d1bca880a85d
Author: Tamar Christina <Mistuke at users.noreply.github.com>
Date:   Mon Oct 24 22:42:30 2016 +0100

    GitHub 53 haskell win32 issues (#57)
    
    * Win32: Corrected 64bit types.
    
    * Win32: Updated changelog.


>---------------------------------------------------------------

612e93cdd68a4be3bf6dca83b475d1bca880a85d
 Graphics/Win32/Window.hsc    |  1 +
 System/Win32/FileMapping.hsc |  1 +
 System/Win32/Types.hs        | 14 ++++++++------
 changelog.md                 |  1 +
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/Graphics/Win32/Window.hsc b/Graphics/Win32/Window.hsc
index e5bd152..0138b13 100644
--- a/Graphics/Win32/Window.hsc
+++ b/Graphics/Win32/Window.hsc
@@ -25,6 +25,7 @@ import Foreign.ForeignPtr (withForeignPtr)
 import Foreign.Marshal.Alloc (allocaBytes)
 import Foreign.Ptr (FunPtr, Ptr, castFunPtrToPtr, castPtr, nullPtr)
 import Foreign.Storable (pokeByteOff)
+import Foreign.C.Types (CIntPtr(..))
 import Graphics.Win32.GDI.Types (HBITMAP, HCURSOR, HDC, HDWP, HRGN, HWND, PRGN)
 import Graphics.Win32.GDI.Types (HBRUSH, HICON, HMENU, prim_ChildWindowFromPoint)
 import Graphics.Win32.GDI.Types (LPRECT, RECT, allocaRECT, peekRECT, withRECT)
diff --git a/System/Win32/FileMapping.hsc b/System/Win32/FileMapping.hsc
index 9bfd6e4..df603cb 100644
--- a/System/Win32/FileMapping.hsc
+++ b/System/Win32/FileMapping.hsc
@@ -28,6 +28,7 @@ import Data.ByteString          ( ByteString )
 import Data.ByteString.Internal ( fromForeignPtr )
 import Foreign                  ( Ptr, nullPtr, plusPtr, maybeWith, FunPtr
                                 , ForeignPtr, newForeignPtr )
+import Foreign.C.Types (CUIntPtr(..))
 
 ##include "windows_cconv.h"
 
diff --git a/System/Win32/Types.hs b/System/Win32/Types.hs
index 7b53370..8340564 100755
--- a/System/Win32/Types.hs
+++ b/System/Win32/Types.hs
@@ -29,7 +29,7 @@ import Data.Word (Word8, Word16, Word32, Word64)
 import Foreign.C.Error (getErrno, errnoToIOError)
 import Foreign.C.String (newCWString, withCWStringLen)
 import Foreign.C.String (peekCWString, peekCWStringLen, withCWString)
-import Foreign.C.Types (CChar, CUChar, CWchar)
+import Foreign.C.Types (CChar, CUChar, CWchar, CIntPtr, CUIntPtr)
 import Foreign.ForeignPtr (ForeignPtr, newForeignPtr, newForeignPtr_)
 import Foreign.Ptr (FunPtr, Ptr, nullPtr)
 import Foreign (allocaArray)
@@ -73,6 +73,8 @@ type FLOAT         = Float
 type LARGE_INTEGER = Int64
 
 type UINT_PTR      = Word
+type LONG_PTR      = CIntPtr
+type ULONG_PTR     = CUIntPtr
 
 -- Not really a basic type, but used in many places
 type DDWORD        = Word64
@@ -82,11 +84,11 @@ type DDWORD        = Word64
 type MbString      = Maybe String
 type MbINT         = Maybe INT
 
-type ATOM          = UINT
-type WPARAM        = UINT
-type LPARAM        = LONG
-type LRESULT       = LONG
-type SIZE_T        = DWORD
+type ATOM          = WORD
+type WPARAM        = UINT_PTR
+type LPARAM        = LONG_PTR
+type LRESULT       = LONG_PTR
+type SIZE_T        = ULONG_PTR
 
 type MbATOM        = Maybe ATOM
 
diff --git a/changelog.md b/changelog.md
index 303dee5..39a157d 100644
--- a/changelog.md
+++ b/changelog.md
@@ -18,3 +18,4 @@
 * Added function `getCurrentProcessId`
 * Added function `filepathRelativePathTo`
 * Added function `pathRelativePathTo`
+* Corrected 64 bit types (See #53)



More information about the ghc-commits mailing list