Bug 24511 – __stdcall functions from C are extern(C) in D.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2024-04-19T04:21:34Z
Last change time
2024-04-23T14:24:18Z
Keywords
ImportC
Assigned to
No Owner
Creator
Harry Gillanders
Comments
Comment #0 by contact — 2024-04-19T04:21:34Z
__stdcall functions and function-pointer types imported into D from a C file are extern(C) instead of extern(Windows).
A brief test-case:
> // c.c
> void __stdcall stdcallFunction()
> {}
> // d.d
> import c;
> // This should hold true, but it fails.
> static assert(__traits(getLinkage, stdcallFunction) == "Windows");
I would expect __stdcall functions to be extern(Windows).
dlang/dmd pull request #16406 "Merge stable" was merged into master:
- 978a26dd3d4b31cf0d2744ff6f147765a5df3c7b by Harry Gillanders:
Fix Bugzilla Issue 24511 - __stdcall functions from C are extern(C) in D.
https://github.com/dlang/dmd/pull/16406