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).
Comment #1 by contact — 2024-04-19T04:29:31Z
dlang-bot isn't picking it up—here's a PR: https://github.com/dlang/dmd/pull/16399
Comment #2 by contact — 2024-04-21T05:17:09Z
dlang-bot still isn't picking it up—https://github.com/dlang/dmd/pull/16399 was merged into the stable branch.
Comment #3 by dlang-bot — 2024-04-23T14:24:18Z
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