View previous topic :: View next topic |
Author |
Message |
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Wed Apr 26, 2006 7:49 am Post subject: Windows Win32 API Status Log |
|
|
Currently about 46? (by size) of the MinGW headers have been ported to D.
* Almost everything included by windows.h has now been converted. The only exceptions are the rpc and ole2 stuff.
* Some of the macros and bit fields in structs haven't been converted yet -- but most have.
* During the conversion, many bugs in the MinGW code have been discovered and fixed. (Most of those bugs relate to Windows versioning).
* It's not very well tested yet.
* I believe that it's very close to being a viable alternative to the Windows header in Phobos. Almost all of the functions in Phobos are included.
Here's a list of all the 'independent' headers in the MinGW library (those which include nothing, except possibly windows.h, and which are not used by any other header). Many of them are good candidates for anyone who'd like to make a contribution, without getting too heavily involved. Several have been converted already.
AFXRES.H
CPL.H
CPLEXT.H
CUSTCNTL.H
DBT.H
DHCPCSDK.H
DXERR8.H
ERRORREP.H
EXDISPID.H
HTTPEXT.H
IDISPIDS.H
MCX.H
MSACM.H
MSHTML.H
NDDEAPI.H
NSPAPI.H
NTDLL.H
NTLDAP.H
OLE.H
PBT.H
PSAPI.H
RAPI.H
RASERROR.H
REGSTR.H
RICHEDIT.H
RICHOLE.H
SCRNSAVE.H
SERVPROV.H
SHLDISP.H
SUBAUTH.H
SVCGUID.H
TLHELP32.H
TMSCHEMA.H
USERENV.H
WINABLE.H
WINDNS.H
WINDOWSX.H
WINIOCTL.H
WINSNMP.H
WS2SPI.H
WSIPX.H
WSNETBS.H
ZMOUSE.H |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Jun 08, 2006 4:31 pm Post subject: |
|
|
A bit of feedback as I tried out the new headers today (great job, by the way!):
* I think all the "pragma(lib)" statements should be commented out because the files listed aren't actually libraries in MinGW, they're export definition files (with extension ".def"). Doing this allowed me to build a "hello world" type app against the headers and all was well.
* It would be very nice if "version (build) { pragma(nolink); }" could be added near the top of all the modules, as Build likes to include every module referenced and I don't think any of these modules actually need to be linked against a D application. Doing this for the "hello world" app mentioned above reduced the executable size by over 50K, and it still ran. I simply did a search/replace and inserted the statement below the "module" declaration line in all headers. |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Jun 08, 2006 5:15 pm Post subject: |
|
|
Um, hold on the pragma for build. For some reason, the modules must be linked if you use any structs from them. I'm tempted to consider this a bug, but at the moment it means the modules do actually have to be built (at the cost of 512 bytes apiece at least for ModuleInfo data). |
|
Back to top |
|
|
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Fri Jun 09, 2006 2:17 am Post subject: |
|
|
Quote: | * I think all the "pragma(lib)" statements should be commented out because the files listed aren't actually libraries in MinGW, they're export definition files (with extension ".def").
|
Maybe, if D gets better support for def files (along the lines of pragma(lib)), and if the current Windows libs are removed from the list of default libraries.
Does GDC Windows use the DMD windows libs? If it requires .DEF files, then we definitely need to use .def.
Quote: |
Doing this allowed me to build a "hello world" type app against the headers and all was well.
|
That's deceptive. It only works because the simplest windows import libs are default libraries in optlink. There's an artificial distinction between winmm.lib (which isn't a default lib) and kernel32.lib (which is a default lib).
Quote: | at the moment it means the modules do actually have to be built (at the cost of 512 bytes apiece at least for ModuleInfo data).
|
Is this also happening for the existing Phobos files (including std.windows.c.windows?) |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Fri Jun 09, 2006 11:12 am Post subject: |
|
|
Don Clugston wrote: | Maybe, if D gets better support for def files (along the lines of pragma(lib)), and if the current Windows libs are removed from the list of default libraries.
Does GDC Windows use the DMD windows libs? If it requires .DEF files, then we definitely need to use .def. |
Not sure. But as the files don't exist as ".lib" files, the existing pragmas seem to be more placeholders for future work than anything. Hrm, perhaps it would be enough to change the file extensions in the pragmas to ".def" instead of ".lib"? Also, is there any barrier to redistributing the MinGW .def files?
Quote: | Quote: | at the moment it means the modules do actually have to be built (at the cost of 512 bytes apiece at least for ModuleInfo data).
|
Is this also happening for the existing Phobos files (including std.windows.c.windows?) |
Yes. See my post to digitalmamrs.bugs titled "Required to link windows header modules (?)." It simply isn't an issue with Phobos as shipped because the windows modules are built into the Phobos library. I only noticed this because I was experimenting with Build and was trying to reduce compile time (and executable size) to a level equivalent to building against Phobos. Against Phobos, the Mango hello.d example compiles to around 90K and using Build against your Windows libraries and an altered version of Ares (which doesn't contain a compiled version of these modules) the same executable is over 150K. I'm hoping Walter will be able to shed some light on the difference. |
|
Back to top |
|
|
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Mon Jun 12, 2006 6:42 am Post subject: |
|
|
Quote: | But as the files don't exist as ".lib" files, the existing pragmas seem to be more placeholders for future work than anything. |
Many of the files do exist in the DMD download, even though they aren't default libraries. For example, advapi32.lib, comctl32.lib, winmm.lib.
The others can easily be constructed from the Microsoft SDK download, by just running "coffimplib" on them. I've made a request to Walter for him to include the full set of lib files in the DMD download, but he hasn't replied yet. (It's legal for him to provide them, but we can't host them on dsource; otherwise I would have just uploaded them myself).
What did you use for your "hello world" test?
import win32.core;
*shouldn't* be a whole lot bigger than a Phobos build. win32.windows exists primarily for ease of porting from C. Definitely don't use win32.all, it's only for our testing.
BTW, you should probably think of this as Stewart's project, rather than mine. We've contributed roughly equal amounts to it, but he drove it, and his translations are much higher quality than mine. Works of art, really. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|