joyent/smartos-live — pull request #27 by richlowe (2011-12-18 23:42:33+00:00)
Title: cpp: Act somewhat more like devpro cpp(1), report errors legibly

DevPro `cpp` defines the symbol which causes our `stdarg.h` to do protocol for variadic functions in the studio fashion. Without this (or the GNU equivalent), we #error out of that header, and `dtrace -C` that in any way ends up including `sys/va_impl.h` is broken. It is safer to act like Studio in this case both because of history, and because acting GNU-ishly could also trigger the use of __attribute__, and further confuse DTrace.

While doing this, also fix error reporting such that errors and warnings are actually reported. Previously it used a printf `%r` specifier which we (and anyone else I found in a very quick search) appear to lack, so errors were not, in fact, reported.

Both of these in combination are issue #25, though the change for stdarg is the only one which truly matters.

I've tested this by preprocessing the files in that issue from @alasdairrr and by run the specific phelper.d through dtrace in the same manner as the python build, but haven't actually done the full python build under SmartOS and with this cpp,