On Sat, 03 Oct 2009 21:50:06 +0400, Tomas Lindquist Olsen
<[email protected]> wrote:
On Sat, Oct 3, 2009 at 2:55 PM, Denis Koroskin <[email protected]> wrote:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int',
or
just 'unsigned', but is mangled differently.
In particular, C++ mangles unsigned long as 'K', and I can't find a D
counterpart that would be mangled similarly.
This results in an unaccessible function (it is unresolved at link
time).
Any thoughts?
The type of C++ "unsigned long" depends on the target platform.
Sure, but it's stands true for all types, not only "unsigned long".
I'm on x86, and it is the same as unsigned int here.
BTW, I worked around the issue with a wrapper function:
// workaround.cpp
int foo(unsigned long bar); // extern
int foo(unsigned int bar) { return foo((unsigned long)bar); }
but it's not too handy.