Jose Romildo Malaquias <[EMAIL PROTECTED]> wrote,

> I want to import some constants fromm a C header file
> that was defined as macros (using #define statements),
> with the c2hs program (latest from CVS).
> 
> The paper "C->Haskell, or Yet Another Interfacing Tool",
> by Manuel Chakravarty, tells me that it can be done
> with something like
> 
>   {#enum define ResultType { ERR as CursesError,
>                            , OK  as CursesOk
>                            }
>   #}
> 
> where the C header file has the macro definitions
> 
>   #define ERR (-1)
>   #define OK 0
> 
> But c2hs fails with the error message
> 
>   >>> Syntax error!
>   The phrase `ResultType' is not allowed here.
> 
> I have searched both c2hs and gtk+hs sources
> for an example using this feature of c2hs but
> failed to find one.

Yes, that is the only feature from the paper that isn't
implemented yet.  It is on the top of my todo list - as many
people want it.  Sorry for that.

Manuel

Reply via email to