c2hs icon indicating copy to clipboard operation
c2hs copied to clipboard

Darwin: The symbol `_9' does not fit here.

Open anttih opened this issue 5 years ago • 1 comments
trafficstars

c2hs (or language-c) does not seem to be able to parse the value 10_9

c2hs: C header contains errors:

/nix/store/pz99r8hkn8ym8vpn45hfj441py9r82qz-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:665: (column 117) [ERROR]  >>> Syntax error !
  The symbol `_9' does not fit here.

The line in CFBase.hs is this:

CFTypeRef CFAutorelease(CFTypeRef CF_RELEASES_ARGUMENT arg) CF_AVAILABLE(10_9, 7_0);

I definition for CF_AVAILABLE seems to be this:

#define CF_AVAILABLE(_mac, _ios) __attribute__((availability(macosx,introduced=_mac)))

c2hs version: 0.28.6

anttih avatar Aug 23 '20 07:08 anttih

This is unfortunately a limitation of language-c. Here is a workaround https://github.com/haskell/c2hs/issues/255

deech avatar Aug 24 '20 11:08 deech