
On 02/28/2012 07:06 AM, Rene Rivera wrote:
In other words.. We need to make a distinction between the *actual* compiler vs. the *compatible/emulated* compiler. There are obviously three options to this:
I don't think that's a good idea. Just do #if defined(__clang__) frontend is clang #elif ... .... #elif defined(__GNUC__) frontend is GCC #elif ... ... #endif The whole mechanism to detect what the frontend is should be a chain of if/elif in a single file. I thought this much was a given. This is how Boost.Config and Boost.Detect work.
1. Make the default/base/undecorated definitions reflect the *actual* compiler. And add a set of predefs for the *emulated* compiler.
2. Make two different parallel sets of definitions, one for *actual* and one for *emulated*.
3. Make the default/base/undecorated definitions reflect the *emulated* compiler. And add a set for the *actual* compiler.
This looks like it would be very hard to maintain and hard to ensure that it is correct. It also assumes that all compilers that emulate other compilers do it in an uniform way.