| Thread overview | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 11, 2014 extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
I've got an enhancement request to have it behave like extern(C):
https://issues.dlang.org/show_bug.cgi?id=12894
Thoughts? Anyone use extern(Windows) on non-Windows systems?
| ||||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote:
> I've got an enhancement request to have it behave like extern(C):
>
> https://issues.dlang.org/show_bug.cgi?id=12894
>
> Thoughts? Anyone use extern(Windows) on non-Windows systems?
What is the extern(Windows) is supposed to do differently on
windows than existing externs ?
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 6/11/2014 3:24 PM, deadalnix wrote:
> On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote:
>> I've got an enhancement request to have it behave like extern(C):
>>
>> https://issues.dlang.org/show_bug.cgi?id=12894
>>
>> Thoughts? Anyone use extern(Windows) on non-Windows systems?
>
> What is the extern(Windows) is supposed to do differently on
> windows than existing externs ?
It changes the calling convention and name mangling to match what Microsoft uses for the Windows API.
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 11 June 2014 at 22:25:22 UTC, Walter Bright wrote:
> It changes the calling convention and name mangling to match what Microsoft uses for the Windows API.
OK, but I don't get why you wouldn't be able to use
extern(C/C++/Whatever) and it adapt to the system. Obviously
there is something about windows that I'm not really aware of.
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 6/11/2014 3:27 PM, deadalnix wrote: > On Wednesday, 11 June 2014 at 22:25:22 UTC, Walter Bright wrote: >> It changes the calling convention and name mangling to match what Microsoft >> uses for the Windows API. > > OK, but I don't get why you wouldn't be able to use > extern(C/C++/Whatever) and it adapt to the system. That's what it does now. > Obviously there is something about windows that I'm not really aware of. http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx | |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 11 June 2014 23:20, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> I've got an enhancement request to have it behave like extern(C):
>
> https://issues.dlang.org/show_bug.cgi?id=12894
>
> Thoughts? Anyone use extern(Windows) on non-Windows systems?
I'd doubt there's be anyone that uses extern(Windows) on non-windows systems, but there may be people who wish to force stdcall for whatever reason. Currently, extern(C) on Windows could either be a stdcall, cdecl or thiscall function.
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
On 12 June 2014 00:17, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 11 June 2014 23:20, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>> I've got an enhancement request to have it behave like extern(C):
>>
>> https://issues.dlang.org/show_bug.cgi?id=12894
>>
>> Thoughts? Anyone use extern(Windows) on non-Windows systems?
>
> I'd doubt there's be anyone that uses extern(Windows) on non-windows systems, but there may be people who wish to force stdcall for whatever reason. Currently, extern(C) on Windows could either be a stdcall, cdecl or thiscall function.
Honestly, I'd first deprecate/remove extern(Pascal), then think about
deprecating extern(Windows) later.
| ||||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On 6/11/2014 4:17 PM, Iain Buclaw via Digitalmars-d wrote:
> I'd doubt there's be anyone that uses extern(Windows) on non-windows
> systems, but there may be people who wish to force stdcall for
> whatever reason. Currently, extern(C) on Windows could either be a
> stdcall, cdecl or thiscall function.
>
Even Microsoft gave up on stdcall for Win64 and uses the C convention.
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 11 June 2014 at 23:27:09 UTC, Walter Bright wrote:
> Even Microsoft gave up on stdcall for Win64 and uses the C convention.
I think that's because the 64 bit C convention is a lot closer to the stdcall convention anyway, putting more args in registers etc...
| |||
June 11, 2014 Re: extern(Windows) behavior on non-Windows systems | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 6/11/2014 4:34 PM, Adam D. Ruppe wrote:
> On Wednesday, 11 June 2014 at 23:27:09 UTC, Walter Bright wrote:
>> Even Microsoft gave up on stdcall for Win64 and uses the C convention.
>
> I think that's because the 64 bit C convention is a lot closer to the stdcall
> convention anyway, putting more args in registers etc...
I just think that the purpose of having a separate Windows API calling convention no longer makes any sense. It dates back to the 16 bit world when Pascal had a different calling convention and a lot of people thought that was better.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply