summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-02-17 15:59:26 +0100
committerBen Gamari <ben@smart-cactus.org>2021-04-07 15:04:04 -0400
commit21c8e24b177683b4c71162d808ec6be3a843128c (patch)
tree36502632d90c94618fdc146d3e6dca5eca3a0b8c
parentfc1a91acde94eda66bfd106e4438ce5f7cbe4e27 (diff)
downloadhaskell-21c8e24b177683b4c71162d808ec6be3a843128c.tar.gz
Fix Storeable instances for the windows timeout executable.
alignment clearly should be a power of two. This patch makes it so. We do so by using the #alignment directive instead of using the size of the type. (cherry picked from commit 847b0a6950ffdead534d0d4982f50ad17ae7cce0)
-rw-r--r--testsuite/timeout/WinCBindings.hsc4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/timeout/WinCBindings.hsc b/testsuite/timeout/WinCBindings.hsc
index 345cc4e3d7..983de3ae53 100644
--- a/testsuite/timeout/WinCBindings.hsc
+++ b/testsuite/timeout/WinCBindings.hsc
@@ -28,7 +28,7 @@ data PROCESS_INFORMATION = PROCESS_INFORMATION
instance Storable PROCESS_INFORMATION where
sizeOf = const #size PROCESS_INFORMATION
- alignment = sizeOf
+ alignment = const #alignment PROCESS_INFORMATION
poke buf pinfo = do
(#poke PROCESS_INFORMATION, hProcess) buf (piProcess pinfo)
(#poke PROCESS_INFORMATION, hThread) buf (piThread pinfo)
@@ -67,7 +67,7 @@ data STARTUPINFO = STARTUPINFO
instance Storable STARTUPINFO where
sizeOf = const #size STARTUPINFO
- alignment = sizeOf
+ alignment = const #alignment STARTUPINFO
poke buf si = do
(#poke STARTUPINFO, cb) buf (siCb si)
(#poke STARTUPINFO, lpDesktop) buf (siDesktop si)