Win32 API Tango / using what ?

Sascha Katzner sorry.no at spam.invalid
Wed Nov 14 00:39:30 PST 2007


Lars Ivar Igesund wrote:
> Also note that there are/used to be codegen issues and compile speed issues.
> Since all the Win32 headers are linked together like spaghetti, you risk
> having to compile all every time (and they are big, so it gets slow).

If you use the provided makefile it creates a lib with all headers. You 
can simply link this file in your projects without the need to recompile 
it every time.

> The above also means that the binary size increase a lot, as every module
> compiled into a D program, adds about 500 bytes.
> The direct port meant using static const variables a lot, and these was put
> into the executable, increasing binary size by a large quantity of bytes.
> Using enums instead would fix this, but seemed like an onerous task at the
> time.

I don't know if static const have this effect but we use enums anyway 
everywhere it is reasonable: 
http://www.dsource.org/projects/bindings/wiki/WindowsApi/Instructions

...and my observation is that the linker only includes what he needs 
from the lib file. So you can simply include all headers (via simple 
"import win32.windows;") without it adding even a byte to your executable.

LLAP,
Sascha Katzner



More information about the Digitalmars-d mailing list