From d61e4fd74943957eb1da227d2a4458375cd37e89 Mon Sep 17 00:00:00 2001 From: Nick Erdmann Date: Sun, 3 Jan 2021 22:56:25 +0100 Subject: [PATCH] Fix calls to varargs C function fcntl The ccall calling convention doesn't support varargs functions, so switch to capi instead. See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention --- Network/Socket/Fcntl.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Network/Socket/Fcntl.hs b/Network/Socket/Fcntl.hs index 81442cab..73e2b9e6 100644 --- a/Network/Socket/Fcntl.hs +++ b/Network/Socket/Fcntl.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CApiFFI #-} {-# LANGUAGE CPP #-} module Network.Socket.Fcntl where @@ -27,7 +28,7 @@ setCloseOnExecIfNeeded fd = System.Posix.Internals.setCloseOnExec fd #endif #if !defined(mingw32_HOST_OS) -foreign import ccall unsafe "fcntl" +foreign import capi unsafe "fcntl.h fcntl" c_fcntl_read :: CInt -> CInt -> CInt -> IO CInt #endif