21 Dec 02:30
Re: How to use #ifdef WIN32
Jim Burton <jim <at> sdf-eu.org>
2007-12-21 01:30:58 GMT
2007-12-21 01:30:58 GMT
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
RSS Feed