[Issue 5815] Using -O is causing wrong code to be generated for extern(C) method call.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 8 23:25:43 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5815



--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> 2011-04-08 23:22:01 PDT ---
If you look it up in shlwapi.h in the SDK, it is declared as

LWSTDAPI_(BOOL)     PathRemoveFileSpecA(__inout LPSTR pszPath);

and LWSTDAPI_(BOOL) expands to 'extern "C" __declspec(dllimport) BOOL
__stdcall'.
__stdcall translates to D as extern(Windows).

I have tried your code, and I get a link error with "extern(C)". I have used
coff2implib to convert the library from the sdk, because I have had problems
with implib on DLLs in the past, it especially misses a number of symbols.

With "extern(Windows)", I can link and run your code without problems.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list