c2hs
c2hs copied to clipboard
Syntax error! The symbol `__attribute__' does not fit here. for time.h on OSX
glib> Configuring glib-0.13.8.0...
glib> build
glib> Preprocessing library for glib-0.13.8.0..
glib> setup: Error in C header file.
glib>
glib> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:154: (column 17) [FATAL]
glib> >>> Syntax error!
glib> The symbol `__attribute__' does not fit here.
Because of similar issues, I consider it a c2hs bug.
Similar: https://gitlab.haskell.org/haskell/ghcup-hs/-/jobs/389030#L1196
Configuring libarchive-2.2.5.0...
Preprocessing library for libarchive-2.2.5.0..
c2hs: C header contains errors:
/usr/include/bits/alltypes.h:71: (column 18) [ERROR] >>> Syntax error !
The symbol `_Alignas' does not fit here.
This is an issue with language-c
not being able to parse those constructs. I've been getting around them with something like this in my .cabal
file:
if os(darwin)
cc-options: -D_Alignas= -D__attribute__=
This is an issue with
language-c
not being able to parse those constructs. I've been getting around them with something like this in my.cabal
file:if os(darwin) cc-options: -D_Alignas= -D__attribute__=
Doesn't work here:
- https://gitlab.haskell.org/haskell/ghcup-hs/-/jobs/771092#L1331
- https://gitlab.haskell.org/haskell/ghcup-hs/-/commit/490207c6ac5d5aa2823483a6eba480d0ce2e459f#375f33130d9a0929983d444c20caa59f7929d709_30_21