[Issue 1306] New: extern (Windows) should work like extern (C) for variables
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 2 01:21:52 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1306
Summary: extern (Windows) should work like extern (C) for
variables
Product: D
Version: 1.017
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: link-failure
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: torhu at yahoo.com
In some cases, extern (Windows) causes '@0' to get added to the end of symbols
that represent variables. This causes linking errors. I wasn't able to create
a simple test case, but the problem should be clear.
Scenario:
I have a few hundred function pointers in a C library. To link with those, I
have to use extern (C). But to actually call the functions, I need the
function pointers to have type extern (Windows). Since extern (Windows)
changes the mangling of the pointers, I can't link both link with the C
library, and call the functions successfully. So I'm stuck, and probably need
some ugly workaround.
I compiled 'int __stdcall x;' with msvc 6, which it accepted with a warning.
Looking at the object file, the symbol was not affected by __stdcall. So DMD's
behavior is probably wrong.
--
More information about the Digitalmars-d-bugs
mailing list