packages feed

Win32-extras-0.1.0.0: System/Win32/Types/Compat.hsc

{- |
   Module      :  System.Win32.Types.Compat
   Copyright   :  2013 shelarcy
   License     :  BSD-style

   Maintainer  :  shelarcy@gmail.com
   Stability   :  Provisional
   Portability :  Non-portable (Win32 API)

   Provide 64 bit compatible types.
   We should use this module's types to make bindings.

   We should use this module's types instead of "System.Win32.Types" module's one.
   Because "System.Win32.Types" module's types are hard-corded. So, some types are not
   compatible with Windows 64 bit environment.
-}
module System.Win32.Types.Compat where
import Data.Word
import Data.Int
import Foreign.C.Types (CSize(..))

#include <windows.h>

type DWORD32 = Word32
type DWORD64 = Word64
type INT32   = Int32
type INT64   = Int64
type LONG32  = #type LONG32
type LONG64  = #type LONG64
type UINT32  = Word32
type UINT64  = Word64
type ULONG32 = #type ULONG32
type ULONG64 = #type ULONG64

type DWORD_PTR = #type DWORD_PTR
type HALF_PTR  = #type HALF_PTR
type INT_PTR   = #type INT_PTR
type LONG_PTR  = #type LONG_PTR
-- | We should use this instead of "System.Win32.Types" module's one.
-- "System.Win32.Types" module's type is wrong.
type SIZE_T    = CSize
type SSIZE_T   = #type SSIZE_T
type UHALF_PTR = #type UHALF_PTR
-- | We should use this instead of "System.Win32.Types" module's one.
-- "System.Win32.Types" module's type is wrong.
type UINT_PTR  = #type UINT_PTR
type ULONG_PTR = #type ULONG_PTR