the issues you raise i dont really see being "solved" or even really addressed any differently
with other build systems (cmake/scons/whatever). a build system cannot really compensate for
a coder's inability to write clean code. what do you see in other build systems that
encourages different style of coding ?
the example you cite could easily be relegated to a header file without making the real code
messy. while it is an older example, there are many similar situations that could generally
be solved the same way: take care of OS-differences in one location (sep source or header
file) and keep everything else clean.