Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error! The symbol `__attribute__' does not fit here. for time.h on OSX #255

Open
cblp opened this issue Jun 5, 2020 · 3 comments

Comments

@cblp
Copy link

cblp commented Jun 5, 2020

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.

@hasufell
Copy link
Member

hasufell commented Jul 7, 2020

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.

@deech
Copy link
Contributor

deech commented Aug 13, 2020

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__=

@hasufell
Copy link
Member

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants