haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
198 stars 50 forks source link

Invalid Syntax Error? #166

Open idontgetoutmuch opened 8 years ago

idontgetoutmuch commented 8 years ago
~/mypetsc $ /Users/dom/Library/Haskell/ghc-7.10.3/lib/c2hs-0.28.1/bin/c2hs --cppopts="-I/Users/dom/petsc/include" --cppopts="-I/Users/dom/petsc/arch-darwin-c-debug/include" myBind.chs
/Users/dom/Library/Haskell/ghc-7.10.3/lib/c2hs-0.28.1/bin/c2hs --cppopts="-I/Users/dom/petsc/include" --cppopts="-I/Users/dom/petsc/arch-darwin-c-debug/include" myBind.chs
c2hs: C header contains errors:

/Users/dom/petsc/include/petscsys.h:209: (column 72) [ERROR]  >>> Syntax error !
  The symbol `PetscEnum' does not fit here.

Here's the offending line

typedef enum { ENUM_DUMMY } PetscEnum;
PETSC_EXTERN MPI_Datatype MPIU_ENUM PetscAttrMPITypeTag(PetscEnum);

I'm assuming this really is valid as PETSc users are not complaining.

idontgetoutmuch commented 8 years ago

@ian-ross I saw this: http://stackoverflow.com/questions/29324155/library-design-of-petsc-ffi-in-haskell so I must be doing something wrong. Maybe I am using a different version of PETSc to you? I am using 3.6.3.