Commit 3c1728ce authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

-Wall police (Win64 edition).

parent 751e5584
......@@ -568,7 +568,13 @@ csidl_PROGRAM_FILES = 0x0026
-- csidl_PROGRAM_FILES_COMMON :: CInt
-- csidl_PROGRAM_FILES_COMMON = 0x002b
foreign import stdcall unsafe "shlobj.h SHGetFolderPathW"
#ifdef x86_64_HOST_ARCH
#define CALLCONV ccall
#else
#define CALLCONV stdcall
#endif
foreign import CALLCONV unsafe "shlobj.h SHGetFolderPathW"
c_SHGetFolderPath :: Ptr ()
-> CInt
-> Ptr ()
......
......@@ -27,8 +27,13 @@ import Foreign (allocaBytes, peekByteOff)
import System.IO.Error (mkIOError, doesNotExistErrorType)
import System.Win32.Types (BOOL, DWORD, LPCTSTR, LPVOID, withTString)
#ifdef x86_64_HOST_ARCH
#define CALLCONV ccall
#else
#define CALLCONV stdcall
#endif
foreign import stdcall "windows.h GetFileAttributesExW"
foreign import CALLCONV "windows.h GetFileAttributesExW"
c_getFileAttributesEx :: LPCTSTR -> Int32 -> LPVOID -> IO BOOL
getFileAttributesEx :: String -> LPVOID -> IO BOOL
......
......@@ -160,10 +160,16 @@ deleteOldExeFile verbosity oldPID tmpPath = do
-- A bunch of functions sadly not provided by the Win32 package.
foreign import stdcall unsafe "windows.h GetCurrentProcessId"
#ifdef x86_64_HOST_ARCH
#define CALLCONV ccall
#else
#define CALLCONV stdcall
#endif
foreign import CALLCONV unsafe "windows.h GetCurrentProcessId"
getCurrentProcessId :: IO DWORD
foreign import stdcall unsafe "windows.h WaitForSingleObject"
foreign import CALLCONV unsafe "windows.h WaitForSingleObject"
waitForSingleObject_ :: HANDLE -> DWORD -> IO DWORD
waitForSingleObject :: HANDLE -> DWORD -> IO ()
......@@ -174,7 +180,7 @@ waitForSingleObject handle timeout =
bad result = not (result == 0 || result == wAIT_TIMEOUT)
wAIT_TIMEOUT = 0x00000102
foreign import stdcall unsafe "windows.h CreateEventW"
foreign import CALLCONV unsafe "windows.h CreateEventW"
createEvent_ :: Ptr () -> BOOL -> BOOL -> LPCTSTR -> IO HANDLE
createEvent :: String -> IO HANDLE
......@@ -183,7 +189,7 @@ createEvent name = do
Win32.withTString name $
createEvent_ nullPtr False False
foreign import stdcall unsafe "windows.h OpenEventW"
foreign import CALLCONV unsafe "windows.h OpenEventW"
openEvent_ :: DWORD -> BOOL -> LPCTSTR -> IO HANDLE
openEvent :: String -> IO HANDLE
......@@ -195,7 +201,7 @@ openEvent name = do
eVENT_MODIFY_STATE :: DWORD
eVENT_MODIFY_STATE = 0x0002
foreign import stdcall unsafe "windows.h SetEvent"
foreign import CALLCONV unsafe "windows.h SetEvent"
setEvent_ :: HANDLE -> IO BOOL
setEvent :: HANDLE -> IO ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment