What's up with the windows headers?

Jonathan M Davis jmdavisProg at gmx.com
Sun Dec 30 18:38:32 PST 2012


On Monday, December 31, 2012 01:41:38 Stewart Gordon wrote:
> Your comment was posted as a reply to my statement that was about the
> Windows API bindings, not anything that is already in druntime.  As
> such, what you ended up saying was that we would need to go to some
> extra effort to have Win2K-compatible Windows API bindings.  So that
> isn't what you meant to say.  I see now.

I really don't know what the state of the Windows API project's bindings are. 
I'm just talking about what we want to be doing with druntime, though 
obviously taking the bindings from the Windows API project is a great time 
saver, and as I understand it, that was pretty much the point of the project 
in the first place. I may not have been clear on that point.

> > 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
> 
> It was me that mentioned this to you actually.  Besides, it claims
> something far more serious, that compiled programs don't work at all on
> Win2K.  Is it wrong or OOD in this respect?

I have no idea what the current state of Win2K and dmd, druntime, or Phobos 
is. I know that std.datetime uses a function that doesn't exist in Win2K, and 
I know that that bug report was indicating problems with Win2K and stack 
traces, but I have no idea what the exact state of Win2K is with regards to 
running D programs.

> But as you seem to be saying later on, whether we're going to fix it to
> work again on Win2K and whether Walter's going to make us remove the 9x
> vs. NT4 vs. 2K vs. XP versioning from the Windows API bindings before
> allowing them to be dropped in are two different matters.

I'd say that they're different matters. We don't support pre-XP at this point, 
but that doesn't mean that we can't provide the bindings to C functions for 
them. I'd be generally inclined not to bother though.

I think that Walter may have argued for not providing the A functions on the 
basis that they shouldn't be used, but I'd have to go digging through the 
archives to be sure. Regardless, that's still a bindings issue rather than 
whether we go to the effort of making anything pre-XP actually, properly work 
with D programs or not.

> Though I am inclined to remove the versioning for 9x, considering that
> 
> - doing so would simplify the versioning quite a bit
> - character sets under Win9x are a PITA, especially in a language where
> you're meant to use only Unicode
> - some of it seems wrong anyway, in such matters as which W functions
> are supported

Supporting Win9x is far worse than supporting Win2K. Win2K is at least close 
to XP. In either case, I wouldn't really expect people to be writing D 
programs for them. D's too new for there to be any legacy stuff using D with 
those systems, and I wouldn't expect anyone to be using them for anything 
other than legacy stuff. I see no problem whatsoever with dropping any bindings 
that are specific to anything pre-XP. In fact, it would probably be far better 
to, since then there's less clutter to deal with in druntime.

> So you think the view Walter will take is that, if somebody wants to
> build a WinXP app (which may have been written by a DMD user) with a D
> compiler that happens to support Win2K, it's that somebody's
> responsibility to make sure -version=WindowsXP (or the equivalent switch
> for that compiler) has been set.

If someone is using another D compiler, then it's between them and that 
compiler vendor as to what the compiler does or what their version of druntime 
does. At this point, dmd, druntime, and Phobos only support XP and newer. So, 
I'd expect the Windows bindings in druntime to default to whatever is 
appropriate for that. If someone wants to target an older version of Windows, 
it's up to them to deal with that, since it's unsupported. If someone wants to 
target a newer version of Windows, then presumably they'd either just target 
XP and let it work on the newer version, or they'd have to compile with the 
appropriate version identifier to make druntime target the version that they 
wanted to target.

AFAIK, Walter has no reason to disagree with that assessment, but I don't know 
what he'll say until he says it.

> > 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.
> 
> Are there APIs that have been removed in XP?  I wasn't thinking about
> those ... and don't even know how the MS or MinGW C headers would deal
> with such a scenario.

I have no idea. I suspect not. Microsoft normally adds stuff rather than 
removing it. But my point is that it doesn't really matter what the deal with 
Win2K is, because we're not supporting it. If it happens to work, great. But 
if it doesn't, oh well. We're not planning to put in extra effort to make it 
work, and we may do things that break it (probably mostly by using functions 
that don't exist on Win2K).

- Jonathan M Davis


More information about the Digitalmars-d mailing list