From b82f71b96660400b4b9fa7f3ccef9df7532bb2d7 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 5 Dec 2016 21:27:23 +0000 Subject: Fix x86 Windows build and testsuite Summary: Fix issues preventing x86 GHC to build on Windows and fix segfault in the testsuite. Test Plan: ./validate Reviewers: austin, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: #ghc_windows_task_force, thomie Differential Revision: https://phabricator.haskell.org/D2789 --- testsuite/timeout/WinCBindings.hsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testsuite/timeout') diff --git a/testsuite/timeout/WinCBindings.hsc b/testsuite/timeout/WinCBindings.hsc index 87e4341c17..d9c08ee3a2 100644 --- a/testsuite/timeout/WinCBindings.hsc +++ b/testsuite/timeout/WinCBindings.hsc @@ -314,7 +314,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h CreateProcessW" -> BOOL -> DWORD -> LPVOID -> LPCTSTR -> LPSTARTUPINFO -> LPPROCESS_INFORMATION -> IO BOOL -foreign import WINDOWS_CCONV unsafe "string.h" memset :: Ptr a -> CInt -> CSize -> IO (Ptr a) +foreign import ccall unsafe "string.h" memset :: Ptr a -> CInt -> CSize -> IO (Ptr a) foreign import WINDOWS_CCONV unsafe "windows.h SetInformationJobObject" setInformationJobObject :: HANDLE -> JOBOBJECTINFOCLASS -> LPVOID -> DWORD -> IO BOOL @@ -328,6 +328,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h GetQueuedCompletionStatus" setJobParameters :: HANDLE -> IO BOOL setJobParameters hJob = alloca $ \p_jeli -> do let jeliSize = sizeOf (undefined :: JOBOBJECT_EXTENDED_LIMIT_INFORMATION) + _ <- memset p_jeli 0 $ fromIntegral jeliSize -- Configure all child processes associated with the job to terminate when the -- Last process in the job terminates. This prevent half dead processes and that -- cgit v1.2.1