joyent/illumos-extra — pull request #12 by richlowe (2013-09-22 00:24:37+00:00)
Title: Various cpp fixes for Sun /usr/lib/cpp compatibility

This contains a chunk of fixes to improve compatible with Sun cpp (or
correctness in general). It started out as a fix for joyent/smartos-live#171
but grew as more problems became apparent.

There are still at least 2 issues outstanding:

1) As documented in the first non-HACK commit, our treatment of spaces
in macros is, while considerably better, still not strictly compatible
in a couple of ways that might be important

2) `#if` conditions are not macro-expanded prior to being processed, such
that `#if SOME_MACRO(5)` is a syntax error. This is proving particularly
frustrating to fix.

This will *definitely* require more testing on the SmartOS side to be really sure
it's safe, I'd recommend a complete platform build, testing of any SDC
bits that use `dtrace -C`, at least. I'd also probably suggest running
`test.sh | squash.py` over a SmartOS `/usr/include` and checking for
anything that would affect the parseability of the result. (this is why
I left them in the source).