Skip to content

Instantly share code, notes, and snippets.

@TerrorJack
Last active May 22, 2024 20:25
Show Gist options
  • Save TerrorJack/d6d0c7c3b894cb7a0a741e52997e6a46 to your computer and use it in GitHub Desktop.
Save TerrorJack/d6d0c7c3b894cb7a0a741e52997e6a46 to your computer and use it in GitHub Desktop.
diff --git a/compiler/GHC/SysTools/Terminal.hs b/compiler/GHC/SysTools/Terminal.hs
index a3f60e24363..809079b4aea 100644
--- a/compiler/GHC/SysTools/Terminal.hs
+++ b/compiler/GHC/SysTools/Terminal.hs
@@ -20,10 +20,10 @@ import System.IO.Unsafe
#if defined(mingw32_HOST_OS) && !defined(WINAPI)
# if defined(i386_HOST_ARCH)
# define WINAPI stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINAPI ccall
# else
-# error unknown architecture
+# error Unknown mingw32 arch
# endif
#endif
Submodule libraries/Cabal contains modified content
diff --git a/libraries/Cabal/Cabal/src/Distribution/Compat/Environment.hs b/libraries/Cabal/Cabal/src/Distribution/Compat/Environment.hs
index ffe278bcc..8cc9d582a 100644
--- a/libraries/Cabal/Cabal/src/Distribution/Compat/Environment.hs
+++ b/libraries/Cabal/Cabal/src/Distribution/Compat/Environment.hs
@@ -63,7 +63,7 @@ setEnv_ key value = withCWString key $ \k -> withCWString value $ \v -> do
{- FOURMOLU_DISABLE -}
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/libraries/Cabal/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs b/libraries/Cabal/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs
index e805c110d..fa989a6bd 100644
--- a/libraries/Cabal/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs
+++ b/libraries/Cabal/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs
@@ -123,7 +123,7 @@ getExecutablePath = readSymbolicLink $ "/proc/self/exe"
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
Submodule libraries/Win32 contains modified content
diff --git a/libraries/Win32/Graphics/Win32/Window.hsc b/libraries/Win32/Graphics/Win32/Window.hsc
index 8e4ff1d..343e202 100644
--- a/libraries/Win32/Graphics/Win32/Window.hsc
+++ b/libraries/Win32/Graphics/Win32/Window.hsc
@@ -238,7 +238,7 @@ Until a better solution is presented each version is provided explicitly here.
-}
#if defined(i386_HOST_ARCH)
foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongW"
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongPtrW"
#else
# error Unknown mingw32 arch
@@ -247,7 +247,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongPtrW"
#if defined(i386_HOST_ARCH)
foreign import WINDOWS_CCONV unsafe "windows.h GetWindowLongW"
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
foreign import WINDOWS_CCONV unsafe "windows.h GetWindowLongPtrW"
#else
# error Unknown mingw32 arch
@@ -329,7 +329,7 @@ foreign import WINDOWS_CCONV "windows.h DefWindowProcW"
freeWindowProc :: HWND -> IO ()
freeWindowProc hwnd = do
fp <- c_GetWindowLongPtr hwnd (#{const GWLP_USERDATA})
- unless (fp == 0) $
+ unless (fp == 0) $
freeHaskellFunPtr $ castPtrToFunPtr . intPtrToPtr . fromIntegral $ fp
@@ -391,14 +391,14 @@ foreign import WINDOWS_CCONV "windows.h SetWindowTextW"
----------------------------------------------------------------
-- Getting window text/label
----------------------------------------------------------------
--- For getting the title bar text.
+-- For getting the title bar text.
-- If the window has no title bar or text, if the title bar is empty,
-- or if the window or control handle is invalid, the return value is zero.
-- If invalid handle throws exception.
-- If size <= 0 throws exception.
getWindowText :: HWND -> Int -> IO String
-getWindowText wnd size
+getWindowText wnd size
| size <= 0 = errorWin "GetWindowTextW"
| otherwise = do
allocaArray size $ \ p_buf -> do
@@ -411,10 +411,10 @@ foreign import WINDOWS_CCONV "windows.h GetWindowTextW"
----------------------------------------------------------------
-- Getting window text length
----------------------------------------------------------------
--- For getting the title bar text length.
+-- For getting the title bar text length.
-- If the window has no text, the return value is zero.
-- If invalid handle throws exception.
-
+
getWindowTextLength :: HWND -> IO Int
getWindowTextLength wnd = do
size' <- c_GetWindowTextLength wnd
@@ -422,7 +422,7 @@ getWindowTextLength wnd = do
return size'
foreign import WINDOWS_CCONV "windows.h GetWindowTextLengthW"
c_GetWindowTextLength :: HWND -> IO Int
-
+
----------------------------------------------------------------
-- Paint struct
----------------------------------------------------------------
@@ -613,7 +613,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h GetDesktopWindow"
foreign import WINDOWS_CCONV unsafe "windows.h GetForegroundWindow"
getForegroundWindow :: IO HWND
-
+
getParent :: HWND -> IO HWND
getParent wnd =
failIfNull "GetParent" $ c_GetParent wnd
diff --git a/libraries/Win32/System/Win32/DebugApi.hsc b/libraries/Win32/System/Win32/DebugApi.hsc
index 2c5caa6..8bb1219 100644
--- a/libraries/Win32/System/Win32/DebugApi.hsc
+++ b/libraries/Win32/System/Win32/DebugApi.hsc
@@ -54,14 +54,16 @@ module System.Win32.DebugApi
, useAllRegs
, withThreadContext
-#if __i386__
+#if defined(i386_HOST_ARCH)
, eax, ebx, ecx, edx, esi, edi, ebp, eip, esp
-#elif __x86_64__
+#elif defined(x86_64_HOST_ARCH)
, rax, rbx, rcx, rdx, rsi, rdi, rbp, rip, rsp
#endif
+#if defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH)
, segCs, segDs, segEs, segFs, segGs
, eFlags
, dr
+#endif
, setReg, getReg, modReg
, makeModThreadContext
, modifyThreadContext
@@ -331,7 +333,7 @@ withThreadContext t act =
(act buf)
-#if __i386__
+#if defined(i386_HOST_ARCH)
eax, ebx, ecx, edx :: Int
esi, edi :: Int
ebp, eip, esp :: Int
@@ -344,7 +346,7 @@ edi = (#offset CONTEXT, Edi)
ebp = (#offset CONTEXT, Ebp)
eip = (#offset CONTEXT, Eip)
esp = (#offset CONTEXT, Esp)
-#elif __x86_64__
+#elif defined(x86_64_HOST_ARCH)
rax, rbx, rcx, rdx :: Int
rsi, rdi :: Int
rbp, rip, rsp :: Int
@@ -357,10 +359,13 @@ rdi = (#offset CONTEXT, Rdi)
rbp = (#offset CONTEXT, Rbp)
rip = (#offset CONTEXT, Rip)
rsp = (#offset CONTEXT, Rsp)
+#elif defined(aarch64_HOST_ARCH)
#else
-#error Unsupported architecture
+#error Unknown mingw32 arch
#endif
+#if defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH)
+
segCs, segDs, segEs, segFs, segGs :: Int
segCs = (#offset CONTEXT, SegCs)
segDs = (#offset CONTEXT, SegDs)
@@ -381,6 +386,8 @@ dr n = case n of
7 -> (#offset CONTEXT, Dr7)
_ -> undefined
+#endif
+
setReg :: Ptr a -> Int -> DWORD -> IO ()
setReg = pokeByteOff
@@ -404,4 +411,3 @@ modifyThreadContext t a = withThreadContext t $ makeModThreadContext a
outputDebugString :: String -> IO ()
outputDebugString s = withTString s $ \c_s -> c_OutputDebugString c_s
-
diff --git a/libraries/Win32/include/windows_cconv.h b/libraries/Win32/include/windows_cconv.h
index 866ec99..be02b3c 100644
--- a/libraries/Win32/include/windows_cconv.h
+++ b/libraries/Win32/include/windows_cconv.h
@@ -3,11 +3,10 @@
#if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
#else
# error Unknown mingw32 arch
#endif
#endif
-
diff --git a/libraries/base/src/System/CPUTime/Windows.hsc b/libraries/base/src/System/CPUTime/Windows.hsc
index 547e7fa4805..4bae075d464 100644
--- a/libraries/base/src/System/CPUTime/Windows.hsc
+++ b/libraries/base/src/System/CPUTime/Windows.hsc
@@ -60,7 +60,7 @@ type HANDLE = ()
#if defined(i386_HOST_ARCH)
foreign import stdcall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE)
foreign import stdcall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
foreign import ccall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE)
foreign import ccall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt
#else
Submodule libraries/directory contains modified content
diff --git a/libraries/directory/System/Directory/Internal/Windows.hsc b/libraries/directory/System/Directory/Internal/Windows.hsc
index 1b7c529..ece40f4 100644
--- a/libraries/directory/System/Directory/Internal/Windows.hsc
+++ b/libraries/directory/System/Directory/Internal/Windows.hsc
@@ -4,10 +4,10 @@ module System.Directory.Internal.Windows where
#if defined(mingw32_HOST_OS)
##if defined(i386_HOST_ARCH)
## define WINAPI stdcall
-##elif defined(x86_64_HOST_ARCH)
+##elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
## define WINAPI ccall
##else
-## error unknown architecture
+## error Unknown mingw32 arch
##endif
#include <shlobj.h>
#include <windows.h>
diff --git a/libraries/ghc-internal/include/windows_cconv.h b/libraries/ghc-internal/include/windows_cconv.h
index 4fa84071c8a..a65a87a3d56 100644
--- a/libraries/ghc-internal/include/windows_cconv.h
+++ b/libraries/ghc-internal/include/windows_cconv.h
@@ -3,7 +3,7 @@
#if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
#else
# error Unknown mingw32 arch
diff --git a/libraries/ghc-internal/src/GHC/Internal/Environment.hs b/libraries/ghc-internal/src/GHC/Internal/Environment.hs
index 6c78554c305..5c3a47da28e 100644
--- a/libraries/ghc-internal/src/GHC/Internal/Environment.hs
+++ b/libraries/ghc-internal/src/GHC/Internal/Environment.hs
@@ -18,7 +18,7 @@ import GHC.Internal.IO.Encoding
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/libraries/ghc-internal/src/GHC/Internal/IO/FD.hs b/libraries/ghc-internal/src/GHC/Internal/IO/FD.hs
index de227b20aa3..4a4658c4c35 100644
--- a/libraries/ghc-internal/src/GHC/Internal/IO/FD.hs
+++ b/libraries/ghc-internal/src/GHC/Internal/IO/FD.hs
@@ -65,7 +65,7 @@ import GHC.Internal.System.Posix.Types
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Environment.hs b/libraries/ghc-internal/src/GHC/Internal/System/Environment.hs
index fa89b0d3327..d7a91afd8a0 100644
--- a/libraries/ghc-internal/src/GHC/Internal/System/Environment.hs
+++ b/libraries/ghc-internal/src/GHC/Internal/System/Environment.hs
@@ -67,7 +67,7 @@ import GHC.Internal.System.Environment.ExecutablePath
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc b/libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
index 4c5360220ae..8bc5e260b62 100644
--- a/libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
+++ b/libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
@@ -78,7 +78,7 @@ import qualified GHC.Internal.System.Environment as Environment
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
## define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
## define WINDOWS_CCONV ccall
# else
## error Unknown mingw32 arch
diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc b/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
index a06b39f8f8b..7cdcd08cfb1 100644
--- a/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
+++ b/libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
@@ -306,7 +306,7 @@ executablePath = Just (fmap Just getExecutablePath `catch` f)
# if defined(i386_HOST_ARCH)
## define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
## define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
Submodule libraries/haskeline contains modified content
diff --git a/libraries/haskeline/includes/windows_cconv.h b/libraries/haskeline/includes/windows_cconv.h
index 1ece48e..5b620f5 100644
--- a/libraries/haskeline/includes/windows_cconv.h
+++ b/libraries/haskeline/includes/windows_cconv.h
@@ -3,7 +3,7 @@
#if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
#else
# error Unknown mingw32 arch
Submodule libraries/process contains modified content
diff --git a/libraries/process/System/Process/Windows.hsc b/libraries/process/System/Process/Windows.hsc
index f6c97b2..987a941 100644
--- a/libraries/process/System/Process/Windows.hsc
+++ b/libraries/process/System/Process/Windows.hsc
@@ -56,7 +56,7 @@ import System.Win32.Process (getProcessId)
##if defined(i386_HOST_ARCH)
## define WINDOWS_CCONV stdcall
-##elif defined(x86_64_HOST_ARCH)
+##elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
## define WINDOWS_CCONV ccall
##else
## error Unknown mingw32 arch
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 02e763d0c10..344b88eee41 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -88,7 +88,7 @@ static void flushStdHandles(void);
static void
x86_init_fpu ( void )
{
-#if defined(mingw32_HOST_OS) && !X86_INIT_FPU
+#if defined(mingw32_HOST_OS) && defined(x86_64_HOST_ARCH) && !X86_INIT_FPU
/* Mingw-w64 does a stupid thing. They set the FPU precision to extended mode by default.
The reasoning is that it's for compatibility with GNU Linux ported libraries. However the
problem is this is incompatible with the standard Windows double precision mode. In fact,
diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c
index ec992bb211b..cde9237edcf 100644
--- a/rts/win32/veh_excn.c
+++ b/rts/win32/veh_excn.c
@@ -287,7 +287,9 @@ void generateStack (EXCEPTION_POINTERS* pExceptionPointers)
stackFrame.AddrStack.Offset = context->Rsp;
stackFrame.AddrStack.Mode = AddrModeFlat;
-#else
+#elif defined(aarch64_HOST_ARCH)
+ barf("todo");
+#elif defined(i386_HOST_ARCH)
machineType = IMAGE_FILE_MACHINE_I386;
stackFrame.AddrPC.Offset = context->Eip;
stackFrame.AddrPC.Mode = AddrModeFlat;
@@ -297,6 +299,8 @@ void generateStack (EXCEPTION_POINTERS* pExceptionPointers)
stackFrame.AddrStack.Offset = context->Esp;
stackFrame.AddrStack.Mode = AddrModeFlat;
+#else
+#error Unknown mingw32 arch
#endif
fprintf (stderr, "\n Attempting to reconstruct a stack trace...\n\n");
if (!SymInitialize (GetCurrentProcess (), NULL, true))
diff --git a/testsuite/tests/ffi/should_run/T22159.hs b/testsuite/tests/ffi/should_run/T22159.hs
index 24e9511d3be..892d178d7b0 100644
--- a/testsuite/tests/ffi/should_run/T22159.hs
+++ b/testsuite/tests/ffi/should_run/T22159.hs
@@ -3,7 +3,7 @@ module Main (main) where
#if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
#else
# error Unknown mingw32 arch
diff --git a/testsuite/tests/rts/T12497.hs b/testsuite/tests/rts/T12497.hs
index e6498648420..7cee32073bc 100644
--- a/testsuite/tests/rts/T12497.hs
+++ b/testsuite/tests/rts/T12497.hs
@@ -2,7 +2,7 @@
#if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
+#elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
#else
# error Unknown mingw32 arch
diff --git a/testsuite/tests/th/T23309A.hs b/testsuite/tests/th/T23309A.hs
index 749017fad60..f7bf7dadd52 100644
--- a/testsuite/tests/th/T23309A.hs
+++ b/testsuite/tests/th/T23309A.hs
@@ -7,7 +7,7 @@ import Foreign.C.Types
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define CALLCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define CALLCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/testsuite/timeout/WinCBindings.hsc b/testsuite/timeout/WinCBindings.hsc
index 983de3ae531..e79533ed5ee 100644
--- a/testsuite/timeout/WinCBindings.hsc
+++ b/testsuite/timeout/WinCBindings.hsc
@@ -5,7 +5,7 @@ module WinCBindings where
##if defined(i386_HOST_ARCH)
## define WINDOWS_CCONV stdcall
-##elif defined(x86_64_HOST_ARCH)
+##elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
## define WINDOWS_CCONV ccall
##else
## error Unknown mingw32 arch
@@ -394,4 +394,3 @@ waitForJobCompletion _hJob ioPort timeout
then False -- Timeout occurred. *dark voice* YOU HAVE FAILED THIS TEST!.
else True
#endif
-
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 767fa69129f..fb8715014f0 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -99,7 +99,7 @@ import qualified System.Info(os)
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
Submodule utils/hsc2hs contains modified content
diff --git a/utils/hsc2hs/src/Main.hs b/utils/hsc2hs/src/Main.hs
index dd77da1..3110af7 100644
--- a/utils/hsc2hs/src/Main.hs
+++ b/utils/hsc2hs/src/Main.hs
@@ -55,7 +55,7 @@ import HSCParser
#ifdef mingw32_HOST_OS
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
diff --git a/utils/runghc/Main.hs b/utils/runghc/Main.hs
index 858f199abaf..ebe9dbfc617 100644
--- a/utils/runghc/Main.hs
+++ b/utils/runghc/Main.hs
@@ -37,7 +37,7 @@ import System.Posix.Process (executeFile)
#if defined(mingw32_HOST_OS)
# if defined(i386_HOST_ARCH)
# define WINDOWS_CCONV stdcall
-# elif defined(x86_64_HOST_ARCH)
+# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
# define WINDOWS_CCONV ccall
# else
# error Unknown mingw32 arch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment