c2hs icon indicating copy to clipboard operation
c2hs copied to clipboard

Could not get default hook work.

Open Magicloud opened this issue 6 years ago • 2 comments

{#default out ``Context' [t *] outContext*#}

I got "Something went wrong."

{#default out ``Context' outContext*#}

I got "The phrase `out' is not allowed here."

$ ~/.stack/snapshots/x86_64-linux-tinfo6/lts-12.22/8.4.4/bin/c2hs --version
C->Haskell Compiler, version 0.28.6 Switcheroo, 25 November 2017
  build platform is "x86_64-linux" <1, True, True, 1>

Magicloud avatar Dec 15 '18 09:12 Magicloud

Could you post your definitions for Context and the t typedef?

deech avatar Dec 18 '18 16:12 deech

t is defined in header as typedef struct _cairo cairo_t;, I have cairo prefix.

Context is defined as

{#pointer *t as Context foreign finalizer destroy newtype#}
outContext :: Ptr Context -> IO Context
outContext = fmap Context . newForeignPtr cairo_destroy

Magicloud avatar Dec 19 '18 03:12 Magicloud