Compiled dmd2.032 in VC++ 2009!

Jeremie Pelletier jeremiep at gmail.com
Wed Sep 9 02:12:57 PDT 2009


negerns Wrote:

> I ran into the __pascal calling convention. VS2008 no longer support
> 
> The __pascal calling convention is no longer supported in VS2008. How 
> did you resolve this?

I assumed these were remainders of older code, and removed the __pascal from both the prototypes and declarations.

You're gonna hit a few other issues, mostly unresolved symbols. In backend/cc.h there's a prototype for cpp_prettyident but no declaration, I hacked it away:

inline char *cpp_prettyident (Symbol *s) { return s->Sident; }

In cg87.cpp the compiler will whine about not having the M_*_L symbols, just define them as aliases of the * symbols (#define M_PI_L PI). VS has no long double support other than knowing its a different type.

In cgobj.cpp the compiler also whines about a few char arrays being out of bounds. I exploded the strings into array literals: "SMCLV" -> {'S','M','C','L','V'}. There are a few of them in the file.

In the same file, the compiler string has a hex character in it and VS is too dumb to notice it should be 8 bytes, fix it by breaking the string in two parts: "\0\xDB" "Digital Mars C/C++".

Again in the same file, in the function obj_bytes(), VS whines about ((char *)p)++; not being a l-value, just add a local char* variable to use as the pointer, be careful about the goto here, you have to replace p with your variable everywhere in the function, not just the first half.

In backend/cod3.cpp, the FLUSH() macro should be the same as the one for ELFOBJ.

That's about it, these were the few tricky issues I had, there are plenty more but they are trivial to solve.



More information about the Digitalmars-d mailing list