Steven Schveighoffer wrote:
"Walter Bright" wrote
Denis Koroskin wrote:
Does it look any better? No way!
Of course doing it that way doesn't look any better, because it still just
replicates the C preprocessor style of doing it.
A far better solution is to create a series of modules:
gcnetbsd.d
gchurd.d
gcsunos5.d
...
and inside each one put the specifics for that particular system. The huge
advantage of this is that if I want to create a BrightBSD operating
system, I just have to write a:
gcbrightbsd.d
All you have done is split the mess into separate files. This does not
solve the problem.
How does it not solve the problem?
rather than trying to carefully fold it into that conditional compilation
mess without inadvertently breaking other platform support. (And I cannot
even tell if I broke the SunOS5 platform support or not, because I don't
have a SunOS5 platform to test it on.).
But you have, because inadvertently, you changed some code in the actual
implementation to use the new identifiers you made in your special new file.
Now you have to go back and rethink the sunos include because you broke it.
Mess still exists. (of course, I have no idea, but I gave you as much of an
example/proof as you did ;)
See my example of O_APPEND for the proof that it does solve the problem
without breaking other platforms.