digitalmars.D.bugs - [Issue 2580] New: Documented WinMain for D2 is wrong
- d-bugmail puremagic.com (40/40) Jan 11 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (4/4) Jan 13 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (5/5) Jan 13 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (5/5) Jan 24 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (11/11) Jan 30 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (8/13) Jan 30 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (4/4) Apr 01 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- Sean Kelly (3/7) Apr 02 2009 I forgot about this ticket until the release went out and I was looking
- d-bugmail puremagic.com (8/8) Apr 02 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
- d-bugmail puremagic.com (12/12) May 15 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2580
http://d.puremagic.com/issues/show_bug.cgi?id=2580 Summary: Documented WinMain for D2 is wrong Product: D Version: 2.023 Platform: PC URL: http://www.digitalmars.com/d/2.0/windows.html OS/Version: Windows Status: NEW Keywords: spec Severity: critical Priority: P2 Component: www.digitalmars.com AssignedTo: bugzilla digitalmars.com ReportedBy: smjg iname.com Currently, the form of WinMain documented for D2 is the same as that for D1. However, it's no good. _moduleUnitTests() doesn't exist in D2 for a start; a more subtle yet more serious problem is that it doesn't initialise the GC properly. After a day or three of driving myself mad trying to figure why one of my apps was unstable under D2, I've finally come up with a form for WinMain that seems to work: ---------- import std.c.windows.windows; import core.runtime; extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { try { Runtime.initialize(); runModuleUnitTests(); return myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); } catch (Object o) { MessageBoxA(null, toStringz(o.toString()), "Fatal Internal Error", MB_OK | MB_ICONEXCLAMATION); return 0; } finally { Runtime.terminate(); } } --
Jan 11 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 Isn't proper startup code can be found in dmain2.d ? --
Jan 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 That's exactly what Runtime.initialize and Runtime.terminate do - call the "proper startup code". --
Jan 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 Correction: Runtime.initialize calls the proper startup code, and Runtime.terminate calls the proper shutdown code. --
Jan 24 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 sean invisibleduck.org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bugzilla digitalmars.com |sean invisibleduck.org That looks about right. I had thought that people wouldn't want unit tests run for dynamic libraries, which is why that routine needs to be called manually. If this is incorrect then I can add it to Runtime.initialize() as well. I'll look into changing the docs. --
Jan 30 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580That looks about right. I had thought that people wouldn't want unit tests run for dynamic libraries,In which case they'll compile them without --unittest - problem solved.which is why that routine needs to be called manually. If this is incorrect then I can add it to Runtime.initialize() as well. I'll look into changing the docs.You're right - Runtime.initialize() ought to call runModuleUnitTests(). People using the currently correct WinMain will find that the unit tests run twice, but at least they just have to remove the extra call in order to fix it. --
Jan 30 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 Sean, where are you at with this at the moment? --
Apr 01 2009
d-bugmail puremagic.com wrote:http://d.puremagic.com/issues/show_bug.cgi?id=2580 Sean, where are you at with this at the moment?I forgot about this ticket until the release went out and I was looking through bugzilla for stuff to close. It will be fixed in the next release.
Apr 02 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 sean invisibleduck.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Okay, fixed in SVN. --
Apr 02 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2580 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED 12:17:50 PDT --- Fixed dmd 2.030 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 15 2009