Google Summer of Code 2016
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jan 28 23:43:37 PST 2016
On 2016-01-28 18:19, Dicebot wrote:
> AFAIK this is blocked on having C++ API bindings because preprocessor
> isn't exposed to plain C ones (this is exactly why I have mentioned it
> in list).
I'm not sure what you have in mind but handling something like #if seems
very complicated. Example:
#if __APPLE__
// some declarations
#elif linux
// some declarations
#endif
The problems I see with the above:
1. It's not possible to enable/disable these preprocessor symbols. For
example enabling both
2. If the above would be possible the compiler would need to have access
to the SDK of the other platform. Is this what cross-compilers do?
3. Even if the above two points work the compiler would still need to
choose one of the two paths. I guess it would need to at least lex the
other path. But just lexing the other path would not need to be enough.
It need to parse and to the semantic analysis as well to be useful
Just thinking about this brings up new problems and gives me a headache :)
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list