
20 Dec
2007
20 Dec
'07
8:30 p.m.
Neil Mitchell wrote:
Hi Jim
<answer>
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
</answer>
Thanks Neil, Jim
<rant>
If you want to test for Windows you have to ask whether an unrelated system is installed on your machine. Even if it isn't, you still have to test this value. This is what I call a "bug".
You might also want to use System.Info.os and test this value dynamically rather than as a preprocessor, that keeps both code branches type checking and probably isn't much more expensive at runtime. Guess what the value of "os" returns on Windows? (hint: its ill-typed, being not an operating system)
</rant>
Thanks
Neil
-- Jim Burton