|
Boost : |
From: Ross Smith (ross.s_at_[hidden])
Date: 2000-01-11 15:47:25
Mike Morearty wrote:
>
> Also, a less important bug: the old ".com" extension from DOS does
> still work, and does still indicate an executable.
The list you suggest (.EXT, .COM, .BAT) is enough under Win95/98, but
not NT/2000. For a start, there's .CMD, which indicates a Win32 (as
opposed to DOS) batch file.
There's also the environment variable PATHEXT (undocumented, as far as I
know; I can't remember where I heard about it). If it's defined, it
contains a semicolon-delimited list of executable suffixes. Mine reads:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
(I didn't put all those there myself; I suspect MS Office dunnit.)
People who have installed scripting tools ported from Unix often add the
likes of .PL and .PY to the list. (This is NT/2K only, not 95/98.)
> _WINDOWS should be changed to _WIN32. This is kind of subtle and
> confusing. With the Visual C++ integrated development environment,
> when you create a project for any GUI application, it will define
> _WINDOWS for that application. However, that does not indicate
> Windows in general -- rather, it indicates a GUI application as
> opposed to a console application. If you use the development
> environment to create a console application, it will not define
> _WINDOWS -- instead, it will define _CONSOLE.
>
> _WIN32, on the other hand, is defined by the compiler itself (not the
> development environment). That means _WIN32 will always work for
> everyone who uses Visual C++, even if they wrote their own makefile by
> hand, or used the development environment to create a console app.
Yes, _WIN32 is the accepted "check this to see if you're a Windows
program" macro. As far as I know, all Windows compilers define it
(unlike _WINDOWS).
But note that _WIN32 won't be defined on the upcoming 64-bit Windows; it
will define _WIN64 instead. Code intended to work on current and future
versions of Windows should check for either of these.
-- Ross Smith <ross.s_at_[hidden]> The Internet Group, Auckland, New Zealand ======================================================================== "Be careful about using the following code -- I've only proven that it works, I haven't tested it." -- Donald Knuth
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk