-
-
Notifications
You must be signed in to change notification settings - Fork 416
Translated MinGW Windows headers - complete set #1076
Conversation
And an OLD OLD bug: https://issues.dlang.org/show_bug.cgi?id=317 Those of us who use D on Windows have wanted this for many years. |
@@ -0,0 +1,13 @@ | |||
/***********************************************************************\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file probably shouldn't exist, as it is nothing but the module definition and a private import.
Part of this does use explicitly private exports and I believe some of the imports might be expecting to be public, but I'm not sure. (sorry if that doesn't make sense)
|
On Fri, Jan 02, 2015 at 03:14:05PM -0800, Orvid King wrote:
Yeah, I need to try it on some real world code and see what happens This is potentially the most exciting week in D for me for a while! |
@adamdruppe Can this be used for testing? It is a translation of 5th Edition Programming Windows book by Charles Petzold which is quite outdated, but still covers a lot of Win32 stuff that are relevant today. |
FYI I'm not sure about the build state of that project with the latest compiler. I haven't touched that codebase in a while. |
test fail |
@adamdruppe any chance to revive this? |
On Wed, Jul 08, 2015 at 11:33:19AM -0700, Dmitry Olshansky wrote:
Yeah, it is still something I want to do, gotta do a little more Remind me, i'll try to do it this saturday. |
a74f4d4
to
4b9b552
Compare
So I think this thing is actually working now (lol i thought it would take 7 minutes to throw these in, I'm now at over 7 hours on it)... But the tester failed. Can someone take a look at this? https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=1642588&isPull=true Do I need to manually copy the files from /src to /import? I kinda assumed that would be done automatically.... or is something else causing that? |
I guess yes. Just look into win32/win64 makefile. They are (as usual) just a ton of of copy-pasty copy commands: P.S. I really-really wish we had that reggae tool to build D. |
ugh, all done in a list too :( this is like 188 files... really easy to manage with *.d but a list like that will make me miserable. Easy to generate a script to make the list but still, come on. |
If your Walter-foo is high this might be a good time to convince him that Makefiles are evil. But that's OT, I think generating these rules is the way to go to merge this. |
@adamdruppe The first merge confilic commit is NOT good, you pull a whole lot of work done on master into a single commit. Please go the pull --rebase route. In fact you can just redo the pull on top of fresh upstream master. Anyhow pinging to see how it goes. |
On Wed, Jul 15, 2015 at 12:30:57PM -0700, Dmitry Olshansky wrote:
How do I do that? tbh I don't really know how to use git... I just do the
I still have to fix the makefile then it should be set. |
Okay, If I had to do it I'd : git remote -v # check to see if this has upstream repo as remote pointing to DLang
git checkout master
git pull --rebase upstream master
git checkout -b new_branch_name
# apply your changes from this pull to the working tree
git add std/ # add all files in std/
git commit
git push Then anytime you want to update this pull: git checkout branch_name
git pull --rebase upstream master |
221ce56
to
7f061be
Compare
OK, I think I got the commit rebase worked out. Last thing should just be fixing the makefile. |
@adamdruppe - any progress on makefiles? |
Should also add fix Issue 317 to commit message |
On Tue, Jul 28, 2015 at 09:10:56PM -0700, Dmitry Olshansky wrote:
I'm on it again now. What a pain! |
7f061be
to
ef51d84
Compare
I added the version comparison code in case you're interested: etcimon/windows-headers@96be320#diff-469c8eb924b62375a9d80614bfc3351eR177 |
3f619b3
to
964da9e
Compare
On Thu, Sep 10, 2015 at 03:26:05PM -0700, Dmitry Atamanov wrote:
I want to avoid that since then the pragma(lib)'s are liable Arguably, those pragmas should just be removed, but I like having I'm finally to the point where Phobos actually builds, there's |
e438d02
to
c4a6fc5
Compare
Well, I might have to concede at least the winbase.d on which Phobos depends being added to the sources. Seems that dmd, even if the initializers are all zero, wants to reference the .init if they aren't zero by default. (If they are zero by default, it works fine without it. I think this is actually a minor bug, but meh, I REALLY do want to get this merged some time this year, so i'll work with it for now) Hopefully, last run through the autotester. |
@adamdruppe Which version of MinGW Windows headers translated? |
On Thu, Sep 10, 2015 at 06:19:03PM -0700, Dmitry Atamanov wrote:
They are actually pretty old. I don't even remember where they We've been talking about this for years so I figured it is time |
b003c5b
to
fbda44b
Compare
AAAAAAAARRRRRRRRGGGGGGGGGHHHHHHHHH all tests passed except win64 with this delicious error: A symbol conflicts with ITSELF! !@$##*(ing module bugs! I blame bugzilla 314. |
46cd50f
to
23a53eb
Compare
…mpatibility for Phobos
Too bad. However I seriously doubt that it's bugzilla 314. You can seek around for aliases but I've seen this bug with wrong module names supplied that had nothing to do with 314. |
On Thu, Sep 10, 2015 at 09:58:49PM -0700, Dmitry Olshansky wrote:
I was able to work around that anyway... now it is only giving a |
If you translate the error code to hex, it's 0xC0000005: an access violation. |
On Fri, Sep 11, 2015 at 07:15:36AM -0700, Rainer Schuetze wrote:
aye, I noticed that too... but where? I'll have to set up |
I'll try your PR on Win64 and see how it goes. |
Thanks. I'm pretty sure there's just a DWORD where there |
The win64.mak is unbelievably awful. My dmd install on 64 bit just worked well for my programs but fails miserably to build this. Why does the druntime build have to be this bad? It drives me nuts. |
TESTS FINALLY PASS!!!!! |
Splendid! Squash it and I'll do the honors |
@ all, please see #1402 which is a different approach, based on a recent copy of the headers and hopefully will result in less code breakage. Currently blocked on a DMD regression. |
Sample of regressions identified by my test script introduced in this PR:
There are many more ( I uploaded the generated test programs here: |
@DmitryOlshansky let's hold off on a merge until we see how CyberShadow's turns out, he seems to making good speed on it and has a better test case than I do. I agree with him that some of mine are declared @nogc when they shouldn't be and he found a few other bugs in there too (and I was already aware of some const correct issues, which have been fixed in the ~10 months since I forked the bindings to start this, and cybershadow's includes them). So, while mine finally passes the tests in Phobos, if his pass all tests too it is a better way to go. |
Agreed. Having WinAPI covered by tests is much better;) |
Closing this because CyberShadow's superior alternative got in! Yay, finally! |
Windows programming with D quickly finds that the core.sys.windows.windows header is incomplete. Work has been done to port the public domain win32 headers to D:
https://github.com/CS-svnmirror/dsource-bindings-win32
(among other repos) and we sometimes copy/paste definitions too. This brings them all under the druntime banner, in the core.sys.windows namespace - same as we do with Posix and stdc headers. Now, Windows libraries don't need to face incompatibilities anymore from using the different modules to access the same functionality and D will work for low-level Windows devs out of the box (at least 64 bit, we still have the .lib file issue on 32).
I realize this is enormous (I just manually verified the changes of win32->core.sys.windows is good by doing it in each individual file myself!) but these files are typically unchanged for years. It really isn't any more work than us all maintaining our private bindings anyway. Yes, it is 4 MB of code uncompressed, but does that really matter? I think not.
Besides, this will solve the common complaint that D sucks on Windows because most the API isn't even available out of the box. Totally worth doing.