[Issue 24511] New: __stdcall functions from C are extern(C) in D.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 19 04:21:34 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24511

          Issue ID: 24511
           Summary: __stdcall functions from C are extern(C) in D.
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: contact at harrygillanders.com

__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).

--


More information about the Digitalmars-d-bugs mailing list