diff options
author | Ian Lynagh <igloo@earth.li> | 2012-05-16 15:14:36 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-05-16 15:14:36 +0100 |
commit | 5e4bab8c684ea961f08dc9c4f1799991645c32b1 (patch) | |
tree | 42a7824cc6f28404bc5a6138741b0690d840d3d8 /utils/runghc | |
parent | 5ccb43f3306bb0907948d97ea6bffe9f70c69554 (diff) | |
download | haskell-5e4bab8c684ea961f08dc9c4f1799991645c32b1.tar.gz |
Don't use stdcall on Win64: It isn't supported; ccall is used instead
Diffstat (limited to 'utils/runghc')
-rw-r--r-- | utils/runghc/runghc.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs index 8eb46b57f1..6dae543fe9 100644 --- a/utils/runghc/runghc.hs +++ b/utils/runghc/runghc.hs @@ -32,6 +32,14 @@ import Foreign import Foreign.C.String #endif +#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 + main :: IO () main = do args <- getArgs @@ -157,7 +165,7 @@ getExecPath = try_size 2048 -- plenty, PATH_MAX is 512 under Win32. _ | ret < size -> fmap Just $ peekCWString buf | otherwise -> try_size (size * 2) -foreign import stdcall unsafe "windows.h GetModuleFileNameW" +foreign import WINDOWS_CCONV unsafe "windows.h GetModuleFileNameW" c_GetModuleFileName :: Ptr () -> CWString -> Word32 -> IO Word32 #else getExecPath = return Nothing |