ports/devel/hs-c2hs/files/patch-src_C2HS_Config.hs
Tobias C. Berner 4492f249db Fixup devel/hs-c2hs and devel/hs-gtk2hs-buildtools to pass -std=c99 to the preprocessor
The ports using c2hs and gtk2hs fail to build with modern compilers as the c11 features of the FreeBSD system headers are not hidden, yet the tools only understand c99.
* revert change to devel/hs-ncurses from r436451
* patch devel/hs-c2hs to pass -std=c99.
* patch devel/hs-gtk2-buildtools to pass -std=c99.

This should fix compilation of
* devel/hs-ncurses
* dns/hs-gnuidn
* graphics/hs-cairo
* x11-toolkits/hs-vte
* devel/hs-gconf

PR:		216707
Reviewed by:	rakuco
Approved by:	portmgr (antoine)
Differential Revision:	https://reviews.freebsd.org/D10081
2017-03-25 20:29:13 +00:00

30 lines
1,017 B
Haskell

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", "-std=c99"]
+ (_,"gcc") -> ["-E", "-x", "c", "-std=c99"]
_ -> []
-- | C2HS Library file name