Currently, extern (Windows) int foo(int a, int b); mangles on non-Windows systems as: foo@16 This doesn't really make any sense or have any use. It is not compatible with anything. I propose changing it to behave like extern(C). This has the advantage that there is significant C code out there that mangles with Windows on Windows and otherwise C, and this will make these sorts of things easily compatible with D declarations. It will require recompiling of any non-Windows libraries that use extern(Windows).
Have you forgotten about `extern(System)` ?
(In reply to yebblies from comment #1) > Have you forgotten about `extern(System)` ? Yes :-) But it isn't quite right, it should be equivalent to extern(C) for Win64, too. And extern(Windows) is still pointless on non-Windows systems.
(In reply to Walter Bright from comment #0) > I propose changing it to behave like extern(C). This has the advantage that > there is significant C code out there that mangles with Windows on Windows > and otherwise C, and this will make these sorts of things easily compatible > with D declarations. Refactoring will be easy: replace all extern(Windows) with extern(System). That said, we can probably have extern(System) in core.sys.windows too.
Yes, this seems unnecessary.
UnixODBC uses windows calling convention on non-Windows systems.