[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 19:33:05 PDT 2011


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



--- Comment #3 from opantm+spam at gmail.com 2011-04-08 19:29:19 PDT ---
(In reply to comment #1)
> x86_64 (i.e. 64 bit code) is not currently supported by DMD on Windows.
> Changing to x86.

Sorry, I did mean x86.

(In reply to comment #2)
> > extern(C) BOOL PathRemoveFileSpecA(LPTSTR);
> 
> You are probably using the wrong calling convention here, it should be
> "extern(Windows)", which corresponds to __stdcall in while "extern(C)" is
> __cdecl in the SDK C++ headers.

As far as I can tell, the calling convention is C. According to MSDN, the
header is "BOOL PathRemoveFileSpec(__inout  LPTSTR pszPath)". As a comparison,
GetCurrentDirectory (which uses extern(Windows)) is "DWORD WINAPI
GetCurrentDirectory(__in   DWORD nBufferLength, __out  LPTSTR lpBuffer)". When
using extern(Windows), it fails to compile due to an undefined symbol error.

-- 
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