D-Programming-Language/dmd — pull request #516 by rainers (2011-11-19 15:53:06+00:00)
Title: build dmd with Microsoft compiler

As discussed on the mailing list, here are my changes to build dmd with the microsoft compiler (v15 from VS2008). Apart from minor changes to actually make it compile, pushing it through the test suite needed

- replacement for "long double" as 80-bit floats are not supported. I've created root\longdouble.c/h for that purpose with asm implementations using the FPU. As this type is also used by the backend it has to be included from cdef.h aswell.

- C99 support for sprintf et al: %j and %z have been replaced by %llu and casts for arguments of %z. %Lg and %La are now using calls to ld_sprint. A number of cleanups would be possible with respect to IN_GCC using real_t as the implementation of longdouble, because it uses real_t::format to write hex floating point numbers.

- SEH is limited to functions that do not need to call destructors of local functions, so I have moved try/catch blocks into separate functions.

- dmd can be built either through the VS2008 project dmd_msc.vcproj (this also includes building a working 64-bit executable) or through vcbuild\builddmd.bat that uses win32.mak and a small option-mapping batch.
I had to add strtold.c to the makefile, so this might have an influence on the dmc build aswell.