summaryrefslogtreecommitdiff
path: root/devel/hs-c2hs/files/patch-src_C2HS_Config.hs
blob: a0a460f952b4de444cd7677ad5fed4cd5b0fbed1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Hide the scary c11 features from c2hs, which does not understand them:

gtk2hsC2hs: Error in C header file.
/usr/include/sys/_types.h:104: (column 61) [FATAL]
  >>> Syntax error!
  The symbol `long' does not fit here.
*** Error code 1

--- src/C2HS/Config.hs.orig	2017-03-21 18:33:51 UTC
+++ src/C2HS/Config.hs
@@ -56,14 +56,17 @@ cpp  = case os of
 --   understood at least on Linux, FreeBSD, and Solaris and seems to make a
 --   difference over the default language setting on FreeBSD
 --
+-- * Pass -std=c99 as c2hs get's confused by the c11 parts in the FreeBSD
+--   system headers.
+--
 -- * @-P@ would suppress @#line@ directives
 --
 cppopts :: [String]
 cppopts  = case (os,cpp) of
   -- why is gcc different between all these platforms?
   ("openbsd","cpp") -> ["-xc"]
-  (_,"cpp")         -> ["-x", "c"]
-  (_,"gcc")         -> ["-E", "-x", "c"]
+  (_,"cpp")         -> ["-x", "c"]
+  (_,"gcc")         -> ["-E", "-x", "c"]
   _                 -> []

 -- | C2HS Library file name