C++/C mangleof inconsistency for OS X

Dan Olson via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 22 10:23:57 PDT 2015


"Daniel Murphy" <yebbliesnospam at gmail.com> writes:

> "Jacob Carlborg"  wrote in message
> news:mh7mka$19r9$1 at digitalmars.com... 
>
>> And what about pragma(mangle), should that output the symbol name
>> completely untouched?
>
> Yes.

Then for systems that add underscore prefix to compiler identifiers, dmd
.mangleof for extern(C) identifiers needs to include '_' prefix. I'll
try this locally on OS X and see what breaks.

It also means ldc merge-2.067, which just got C++ object symbols correct
with https://github.com/ldc-developers/ldc/pull/889, also needs to
include '_' prefix in .mangleof result for extern(C++).

There should be some helper to determine if compiler will add
underscores.  Otherwise I can see some unittests getting ugly.


More information about the Digitalmars-d mailing list