Skip to content

c2hs chokes on OS X availability macros #85

Closed
@mietek

Description

@mietek

Symptoms:

$ cabal repl
...
c2hs: C header contains errors:

/usr/include/sys/resource.h:349: (column 75) [ERROR]  >>> Syntax error !
  The symbol `=' does not fit here.

The culprit here is the __OSX_AVAILABLE_STARTING macro, defined in Availability.h, which in turn includes AvailabilityInternal.h.

One workaround is to define the following empty macros prior to including any OS X headers:

#define __AVAILABILITY__
#define __OSX_AVAILABLE_STARTING(a,b)
#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d)
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(a,b,c,d,e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions