testsuite/conc059: Don't attempt to use stdcall where it isn't supported
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 1 Dec 2016 21:58:34 +0000 (16:58 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 1 Dec 2016 22:59:40 +0000 (17:59 -0500)
Test Plan: Validate on 64-bit Windows

Reviewers: geekosaur, austin, erikd, Phyx

Reviewed By: Phyx

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2781

testsuite/tests/concurrent/should_run/conc059.hs

index bed28d2..148c0ba 100644 (file)
@@ -19,7 +19,15 @@ f x = do
 foreign export ccall "f" f :: Int -> IO ()
 
 #ifdef mingw32_HOST_OS
-foreign import stdcall safe "Sleep" _sleep :: Int -> IO ()
+# if defined(i386_HOST_ARCH)
+#  define WINDOWS_CCONV stdcall
+# elif defined(x86_64_HOST_ARCH)
+#  define WINDOWS_CCONV ccall
+# else
+#  error Unknown mingw32 arch
+# endif
+
+foreign import WINDOWS_CCONV safe "Sleep" _sleep :: Int -> IO ()
 usleep n = _sleep (n `quot` 1000)
 #else
 foreign import ccall safe "usleep" usleep  :: Int -> IO ()