wined3d and visual studio: The remaining uglyness

Stefan Dösinger stefandoesinger at gmx.at
Wed Aug 25 05:33:19 CDT 2010


Hi,
I've spent some time to get wined3d to compile with visual studio on Windows. I sent some code fixes needed for that, but a few hacks are remaining. I'm sending them here for discussion.

First, why did I look at Visual Studio:

*) mingw on windows a bit messy. Cross Compiling all the time even more so
*) msvc is the native toolkit, it opens up many other tools. I was interested in VsPerfKit specifically.

Basically I set up a Visual Studio process to compile libport, libwine, wined3d, d3d8 and d3d9 out of tree, referencing the code files via relative paths(../../wine/dlls/wined3d/*.c). This was done manually, there's no integration with Wine's native build system. That's hack #1. Unfortunately I can't attach the project right now, it's on a different computer at home. I think we have a script to generate msvc projects for the tests. Maybe the right way is to extend this to the DLLs and programs.

I wrote a hand-written config.h file defining a few HAVE_XXX_H constants. That is hack #2 and relates to Alexandre's concern about the libport isnan and isinf implementations.

More specific code issues:
*) MIDL uses cdecl as the default calling convention for exported functions. Patch 6 in the archive fixes wined3d.idl to work correctly with midl, but this change causes a segfault in widl.

*) Msvc complains that -unsigned_int is still unsigned, and the integer overflow just happens to do what you want. The easiest way is to write 0 - unsigned_int, but I'm not sure about it.

*) NaN and Inf generation

*) msvc doesn't like the predeclaration of **environ. It causes a unknown symbol error at link time.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: w0.zip
Type: application/zip
Size: 6744 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100825/cd52a434/attachment-0001.zip>
-------------- next part --------------




More information about the wine-devel mailing list