Replacement for Ptr () in FFI declaration?

Hi, Apparently, before GHC 7.8, it was possible to specify FFI declarations using Ptr (). However, it now gets an error message: This is from com-1.2.3.1 when I try to compile it: ------ message follows ----- [12 of 21] Compiling System.Win32.Com.Automation.TypeLib ( System\Win32\Com\Automation\TypeLib.hs, dist\build\System\Win 32\Com\Automation\TypeLib.o ) System\Win32\Com\Automation\TypeLib.hs:1379:1: Unacceptable argument type in foreign declaration: Ptr () When checking declaration: foreign import stdcall safe "dynamic" prim_System_Win32_Com_Automation_TypeLib_setGuid :: Ptr () -> Ptr () -> Ptr GUID -> IO Int32 ------ end of message ----- What is the proper declaration to use instead of Ptr () ? Thanks. Howard B. Golden

On 14-09-24 05:56 PM, Howard B. Golden wrote:
Unacceptable argument type in foreign declaration: Ptr () When checking declaration: foreign import stdcall safe "dynamic" prim_System_Win32_Com_Automation_TypeLib_setGuid :: Ptr () -> Ptr () -> Ptr GUID -> IO Int32
It is not just 7.8 (I just tried 7.6), and it is not just GHC. It is about "dynamic", and it is in Haskell 98 with the FFI Addendum or Haskell 2010. "The type of a dynamic stub has to be of the form (FunPtr ft) -> ft, where ft may be any foreign type." In retrospect, I think you completely mistook the meaning of "dynamic".
participants (2)
-
Albert Y. C. Lai
-
Howard B. Golden