Hello.

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.

Can someone please give me some light on this issue?

Romildo
-- 
Prof. José Romildo Malaquias <[EMAIL PROTECTED]>
Departamento de Computação
Universidade Federal de Ouro Preto
Brasil

Reply via email to