What's up with the windows headers?

Jonathan M Davis jmdavisProg at gmx.com
Sun Dec 30 14:27:43 PST 2012


On Sunday, December 30, 2012 18:33:01 Stewart Gordon wrote:
> On 30/12/2012 00:49, Jonathan M Davis wrote:
> <snip>
> 
> > Third parties would typically take druntime and make whatever
> > minimal tweaks they need to make it work with their stuff. That's
> > what gdc and ldc do.
> 
> All the more reason to keep the Win2000 support in, in case one of these
> third parties wants it.

They're on their own if they want that. We're not supporting it, and since 
Microsoft hasn't supported it for years, I expect that very few people are 
going to care about it.

> > We specifically decided not to support Win2K. It requires extra
> > effort that we don't want to go to, and almost no one uses it
> > anymore.
> 
> What extra effort is that?  The versioning to support Win2000 (and even
> NT4) is already in both the C headers and the D modules that have so far
> been done.  It's just another value of the constant _WIN32_WINNT.  My
> common sense tells me that it is _removing_ it that requires extra effort.

There's stuff in druntime that doesn't work on Win2K right now. For instance, 
per this bug report, the stack trace stuff doesn't work on Win2K:

http://d.puremagic.com/issues/show_bug.cgi?id=6024

The solution was to drop Win2K support (the bug is still open, because it's 
asking that we make an official announcement about it, which we haven't done yet 
and really should have).

> > I would expect any bindings added to druntime to be done with the
> > idea that they're for XP or newer rather than trying to support
> > pre-XP at all.
> 
> Once each file has been translated, why would any further bindings for
> WinXP, let alone any older version, be later added?

I don't follow.

I'd expect that druntime contain the function declarations for the entire 
Windows system API which is supported with XP with no care whatsoever to what 
was or wasn't supported before XP (because we're not supporting anything prior 
to XP). If those functions happened to be on Win2k, then fine, but it doesn't 
matter one way or the other, because we don't suppport it. Newer functions 
that are not in XP would then presumably be added in a way which they're only 
there if you've defined the right version to enable them (e.g. a version 
identifier indicating Vista would enable all of the functions added in Vista).

In general, older versions of Windows may work, but we're not making any effort 
to make them work (_especially_ if that means doing stuff like checking the 
Windows version number or creating different code branches for them as used to 
be the case in std.file to deal with the lack of W functions in Win9x), and 
we're not adding any code to target them or help them. They work as long as 
they work with the stuff targeting the currently supported versions of Windows.

I suppose that you can add Win2K bindings to druntime if you really want to go 
to that extra effort, but only if it's not going to complicate things. And 
we're not supporting anything related to Win2K, so any bindings which are 2k-
specific are just icing on the cake. druntime and Phobos themselves will not be 
making any attempt to support Win2K, and no bug reports related to Win2K are 
likely to be considered valid.

Whenever we drop XP support (which is obviously a ways off), that may or may 
not involve removing stuff related to XP. For the most part, it'll probably 
just be left there, but if it's causing problems for something (e.g. like was 
happening with std.file and Win9x), then it probably will be removed. If it 
doesn't harm anything to leave it there, then it's generally better to just 
leave it there, but just like with 2K now, at that point, XP won't be a 
concern anymore. If it happens to work, then great, but we won't put any effort 
into making it work, and we may do things that make it not work if it improves 
the situation for stuff that we actually support at that point in time.

- Jonathan M Davis


More information about the Digitalmars-d mailing list