version() abuse! Note of library writers.

Sean Kelly sean at invisibleduck.org
Wed Nov 18 11:20:42 PST 2009


Anders F Björklund Wrote:

> Sean Kelly wrote:
> > It may help to think about weird configurations like targeting Cygwin
> > on Windows (where Windows, Win32, and Posix may theoretically be
> > defined) or WINE on Linux (where linux and Win32 may be defined).
> 
> Something is broken if "Windows" is declared in Cygwin,
> or if "linux" is declared when running under Wine...

Why?  That's the OS the app is being compiled on/for.  Let's consider another example.  Windows Services for Unix Applications (I think that's what it's called now) is a POSIX subsystem built into Vista and Windows 7.  There, both Windows and Posix would definitely be defined, and I *think* Win32 would be defined as well.  I suppose one could argue that the OS version should be Interix instead of Windows, but it amounts to the same thing.



More information about the Digitalmars-d mailing list