
On Tue, Feb 06, 2007 at 12:33:58PM +1100, John Ky wrote:
Hi,
The following code works:
type ServiceMainClosure = DWORD -> IO ()
foreign import ccall "wrapper" mkServiceMainClosure :: ServiceMainClosure -> IO (FunPtr ServiceMainClosure)
But the following doesn't:
type ServiceMainClosure = DWORD -> [String] -> IO ()
foreign import ccall "wrapper" mkServiceMainClosure :: ServiceMainClosure -> IO (FunPtr ServiceMainClosure)
System\Win32\Service.hsc:108:8: parse error on input `import'
What can I do to get this to work?
You have to use a type that C's tiny brain understains. IANAWP but I'm guessing you want: type ServiceMainClosure = DWORD -> Ptr (Ptr CChar) -> IO () foreign import ccall "wrapper" mkServiceMainClosure :: ServiceMainClosure -> IO (FunPtr ServiceMainClosure)