D2.0 cpp interfacing: what is a C++ unsigned long counterpart inD?

Michel Fortin michel.fortin at michelf.com
Sat Oct 3 14:48:38 PDT 2009


On 2009-10-03 17:13:45 -0400, BCS <none at anon.com> said:

> Hello Denis,
> 
>> That's not always possible. Imagine LGPL'd code, or code which is
>> distributed in precompiled form only (header + library).
>> 
> 
> would, explicitly stating the mangled name work?
> 
> pragam(mangle, "mangled name") // proposed feature
> extern(C++) uint SomeFunction();

Why not just:

	extern(C++, "mangled name") uint SomeFunction();

where "mangled name" could be any constant expression?

Whatever the syntax, this is a great idea. With constant expressions 
for mangled names someone could create a compile-time function or a 
template creating mangled names for namespaced functions and member 
functions. You could change that function/template to match any C++ 
compiler you want.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list