www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - stdcall functions?

reply "Chris Miller" <chris dprogramming.com> writes:
How can I make a stdcall function on Linux with DMD? extern(Windows)  
works, but it gives it DMC's Windows name mangling (e.g. foo 4) that is  
not compatible with Linux' stdcall C functions.

If this won't be changed in DMD's Linux version, I suppose I could settle  
with manually telling ld how to translate the names. Anyone know if this  
is possible or how?
Apr 22 2007
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD? extern(Windows) 
 works, but it gives it DMC's Windows name mangling (e.g. foo 4) that is 
 not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.
Apr 23 2007
parent reply "Chris Miller" <chris dprogramming.com> writes:
On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright  
<newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD? extern(Windows)  
 works, but it gives it DMC's Windows name mangling (e.g. foo 4) that is  
 not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.

GCC has __attribute__((__stdcall__)) Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall. Also, there's a static assert in std.c.windows.windows preventing it from working with winelib; I had to comment that line out and it at least compiled, just wouldn't link due to the stdcall stuff.
Apr 23 2007
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Chris Miller wrote:
 On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright 
 <newshound1 digitalmars.com> wrote:
 
 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD? extern(Windows) 
 works, but it gives it DMC's Windows name mangling (e.g. foo 4) that 
 is not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.

GCC has __attribute__((__stdcall__)) Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall.

If Linux's stdcall functions are for compatibility with Windows, why aren't they compatible with Windows name mangling?
Apr 23 2007
parent reply "Chris Miller" <chris dprogramming.com> writes:
On Mon, 23 Apr 2007 06:15:36 -0400, Walter Bright  
<newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright  
 <newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD? extern(Windows)  
 works, but it gives it DMC's Windows name mangling (e.g. foo 4) that  
 is not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.

Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall.

If Linux's stdcall functions are for compatibility with Windows, why aren't they compatible with Windows name mangling?

I don't think that's its one and only purpose. Just what I want it for now. Besides, I don't think all Windows compilers mangle stdcall that way, and linux ones don't.
Apr 23 2007
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Chris Miller wrote:
 Just what I want it for 
 now. Besides, I don't think all Windows compilers mangle stdcall that 
 way, and linux ones don't.

Hmm, DMD matches the way Microsoft's compiler mangles stdcall names.
Apr 23 2007
prev sibling parent reply =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= <thomas-dloop kuehne.cn> writes:
Content-Type: multipart/mixed;
 boundary="------------080202020007060006070108"

This is a multi-part message in MIME format.
--------------080202020007060006070108
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Chris Miller wrote:
 On Mon, 23 Apr 2007 06:15:36 -0400, Walter Bright
 <newshound1 digitalmars.com> wrote:
=20
 Chris Miller wrote:
 On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright
 <newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD?
 extern(Windows) works, but it gives it DMC's Windows name mangling
 (e.g. foo 4) that is not compatible with Linux' stdcall C functions=





 I didn't know Linux even had stdcall C functions.

Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall=



 If Linux's stdcall functions are for compatibility with Windows, why
 aren't they compatible with Windows name mangling?

I don't think that's its one and only purpose. Just what I want it for now. Besides, I don't think all Windows compilers mangle stdcall that way, and linux ones don't.

The attached program might help: 1) use extern(Windows) in your sources 2) compile 3) dmd_wine_fixer <your_object_file> 4) link Thomas --------------080202020007060006070108 Content-Type: application/octet-stream; name="dmd_wine_fixer" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dmd_wine_fixer" f0VMRgEBAQAAAAAAAAAAAAIAAwABAAAAIIYECDQAAADIDgAAAAAAADQAIAAIACgAGgAZAAYA AAA0AAAANIAECDSABAgAAQAAAAEAAAUAAAAEAAAAAwAAADQBAAA0gQQINIEECBMAAAATAAAA BAAAAAEAAAABAAAAAAAAAACABAgAgAQITAsAAEwLAAAFAAAAABAAAAEAAABMCwAATJsECEyb BAhEAQAATAEAAAYAAAAAEAAAAgAAAGALAABgmwQIYJsECNgAAADYAAAABgAAAAQAAAAEAAAA SAEAAEiBBAhIgQQIIAAAACAAAAAEAAAABAAAAFHldGQAAAAAAAAAAAAAAAAAAAAAAAAAAAYA AAAEAAAAgBUEZQAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAQAAAAvbGliL2xkLWxpbnV4LnNv LjIAAAQAAAAQAAAAAQAAAEdOVQAAAAAAAgAAAAYAAAAJAAAAEQAAABIAAAADAAAAAAAAAAoA AAAMAAAACQAAAAAAAAAAAAAACwAAAAAAAAAIAAAAEAAAAAAAAAANAAAADwAAAAEAAAARAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAGAAAABQAAAAAA AAACAAAABAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqAAAAAAAAACQAAAASAAAA GgAAAAAAAAC0AAAAEgAAAGIAAAAAAAAAHQAAABIAAAAjAAAAAAAAAIMBAAASAAAAPwAAAAAA AABAAQAAEgAAAEwAAACQnAQIBAAAABEAFwBaAAAAAAAAAJ8AAAASAAAAMgAAAAAAAACpAAAA EgAAAJoAAAAAAAAATQEAABIAAAA4AAAAAAAAANMCAAASAAAAiAAAAAAAAACeAQAAEgAAAEUA AAAAAAAAygEAABIAAACgAAAAAAAAAOEAAAASAAAAcwAAAAAAAAAyAAAAEgAAAHkAAADoiQQI BAAAABEADgBTAAAAAAAAAHIBAAASAAAAAQAAAAAAAAAAAAAAIAAAAABfX2dtb25fc3RhcnRf XwBsaWJjLnNvLjYAc3RyZXJyb3IAbWFsbG9jAGZwcmludGYAZnNlZWsAbWVtY21wAGZyZWFk AGZjbG9zZQBzdGRlcnIAZndyaXRlAF9feHN0YXQAX19lcnJub19sb2NhdGlvbgBmb3BlbgBf SU9fc3RkaW5fdXNlZABfX2xpYmNfc3RhcnRfbWFpbgBmcHV0cwBmcmVlAC9ob21lL3RrL21p c2MvbGliOi9ob21lL3RrL21pc2MvbGliOi9ob21lL3RrL21pc2MvbGliOi9ob21lL3RrL21p c2MvbGliOgBHTElCQ18yLjEAR0xJQkNfMi4wAAAAAgACAAIAAgACAAIAAgACAAIAAgACAAMA AgADAAEAAgAAAAAAAQACABAAAAAQAAAAAAAAABFpaQ0AAAMA7gAAABAAAAAQaWkNAAACAPgA AAAAAAAAOJwECAYRAACQnAQIBQYAAEicBAgHAQAATJwECAcCAABQnAQIBwMAAFScBAgHBAAA WJwECAcFAABcnAQIBwcAAGCcBAgHCAAAZJwECAcJAABonAQIBwoAAGycBAgHCwAAcJwECAcM AAB0nAQIBw0AAHicBAgHDgAAfJwECAcQAACAnAQIBxEAAFWJ5YPsCOg9AQAA6JQBAADojwQA AMnDAP81QJwECP8lRJwECAAAAAD/JUicBAhoAAAAAOng/////yVMnAQIaAgAAADp0P////8l UJwECGgQAAAA6cD/////JVScBAhoGAAAAOmw/////yVYnAQIaCAAAADpoP////8lXJwECGgo AAAA6ZD/////JWCcBAhoMAAAAOmA/////yVknAQIaDgAAADpcP////8laJwECGhAAAAA6WD/ ////JWycBAhoSAAAAOlQ/////yVwnAQIaFAAAADpQP////8ldJwECGhYAAAA6TD/////JXic BAhoYAA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AAAAABAAAAAwAAAAAAAAAAAAAA/g0AAMcA AAAAAAAAAAAAAAEAAAAAAAAA --------------080202020007060006070108--
Apr 23 2007
parent reply "Chris Miller" <chris dprogramming.com> writes:
On Mon, 23 Apr 2007 15:33:53 -0400, Thomas K√ľhne <thomas-dloop kuehne.cn>  
wrote:

 The attached program might help:
 1) use extern(Windows) in your sources
 2) compile
 3) dmd_wine_fixer <your_object_file>
 4) link

 Thomas

I was thinking of doing something like this. Thanks, you beat me to it. I have yet to test it because I might have to run it across dozens of files.
Apr 24 2007
parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= <thomas-dloop kuehne.cn> writes:
Content-Type: multipart/mixed;
 boundary="------------000603060205050301060005"

This is a multi-part message in MIME format.
--------------000603060205050301060005
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Chris Miller wrote:
 On Mon, 23 Apr 2007 15:33:53 -0400, Thomas K=C3=BChne
 <thomas-dloop kuehne.cn> wrote:
=20
 The attached program might help:
 1) use extern(Windows) in your sources
 2) compile
 3) dmd_wine_fixer <your_object_file>
 4) link

 Thomas

I was thinking of doing something like this. Thanks, you beat me to it.=

=20
 I have yet to test it because I might have to run it across dozens of
 files.

The attached version should be more useful to you because it doesn't change the infamous _d_throw 4. (Has anybody ever succeeded in setting a break point at _d_throw 4 in GDB without looking up the address first?) Thomas --------------000603060205050301060005 Content-Type: application/octet-stream; name="dmd_wine_fixer" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dmd_wine_fixer" f0VMRgEBAQAAAAAAAAAAAAIAAwABAAAAUIYECDQAAAD4EgAAAAAAADQAIAAIACgAIAAdAAYA AAA0AAAANIAECDSABAgAAQAAAAEAAAUAAAAEAAAAAwAAADQBAAA0gQQINIEECBMAAAATAAAA BAAAAAEAAAABAAAAAAAAAACABAgAgAQIDAwAAAwMAAAFAAAAABAAAAEAAAAMDAAADJwECAyc BAhIAQAAUAEAAAYAAAAAEAAAAgAAACAMAAAgnAQIIJwEC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hdEBAR0xJQkNfMi4wAGZpeF9vYmoAZnNlZWtAQEdMSUJDXzIuMABfc3RhcnQAZnB1 dHNAQEdMSUJDXzIuMABmcHV0Y0BAR0xJQkNfMi4wAF9fbGliY19jc3VfaW5pdABtZW1jbXBA QEdMSUJDXzIuMABfX2Jzc19zdGFydABtYWluAF9fbGliY19zdGFydF9tYWluQEBHTElCQ18y LjAAZGF0YV9zdGFydABfZmluaQBmY2xvc2VAQEdMSUJDXzIuMQBmaXhfb2JqX2ZpbGUAX2Vk YXRhAF9faTY4Ni5nZXRfcGNfdGh1bmsuYngAZnJlZUBAR0xJQkNfMi4wAF9lbmQAZm9wZW5A QEdMSUJDXzIuMQBfSU9fc3RkaW5fdXNlZABmd3JpdGVAQEdMSUJDXzIuMABfX2RhdGFfc3Rh cnQAX0p2X1JlZ2lzdGVyQ2xhc3NlcwBfX2dtb25fc3RhcnRfXwA= --------------000603060205050301060005--
Apr 24 2007
prev sibling parent reply "Chris Miller" <chris dprogramming.com> writes:
On Mon, 23 Apr 2007 17:02:29 -0400, Anders Bergh <anders andersman.org>  
wrote:

 __attribute__((__stdcall__)) does nothing in gcc on Linux. Windows and
 Linux do not share the same ABI, so gcc doesn't care about that
 attribute on non-Windows OS's as far as I know.

It's doing something here, on 32 bits. I tested it by marking a function definition as stdcall but not its prototype; it linked but did odd things before segfaulting. Matching both without stdcall or both with stdcall made it work as normal. However, I did notice with 64 bits, gcc will ignore the stdcall attribute.
Apr 24 2007
parent Neal Becker <ndbecker2 gmail.com> writes:
Chris Miller wrote:

 On Mon, 23 Apr 2007 17:02:29 -0400, Anders Bergh <anders andersman.org>
 wrote:
 
 __attribute__((__stdcall__)) does nothing in gcc on Linux. Windows and
 Linux do not share the same ABI, so gcc doesn't care about that
 attribute on non-Windows OS's as far as I know.

It's doing something here, on 32 bits. I tested it by marking a function definition as stdcall but not its prototype; it linked but did odd things before segfaulting. Matching both without stdcall or both with stdcall made it work as normal. However, I did notice with 64 bits, gcc will ignore the stdcall attribute.

`stdcall' On the Intel 386, the `stdcall' attribute causes the compiler to assume that the called function will pop off the stack space used to pass arguments, unless it takes a variable number of arguments.
Apr 26 2007
prev sibling next sibling parent "Anders Bergh" <anders andersman.org> writes:
On 4/23/07, Thomas K√ľhne <thomas-dloop kuehne.cn> wrote:
 Chris Miller wrote:
 On Mon, 23 Apr 2007 06:15:36 -0400, Walter Bright
 <newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright
 <newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD?
 extern(Windows) works, but it gives it DMC's Windows name mangling
 (e.g. foo 4) that is not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.

Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall.

If Linux's stdcall functions are for compatibility with Windows, why aren't they compatible with Windows name mangling?

I don't think that's its one and only purpose. Just what I want it for now. Besides, I don't think all Windows compilers mangle stdcall that way, and linux ones don't.

The attached program might help: 1) use extern(Windows) in your sources 2) compile 3) dmd_wine_fixer <your_object_file> 4) link Thomas

-- Anders
Apr 23 2007
prev sibling parent "Anders Bergh" <anders andersman.org> writes:
__attribute__((__stdcall__)) does nothing in gcc on Linux. Windows and
Linux do not share the same ABI, so gcc doesn't care about that
attribute on non-Windows OS's as far as I know.

On 4/23/07, Chris Miller <chris dprogramming.com> wrote:
 On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright
 <newshound1 digitalmars.com> wrote:

 Chris Miller wrote:
 How can I make a stdcall function on Linux with DMD? extern(Windows)
 works, but it gives it DMC's Windows name mangling (e.g. foo 4) that is
 not compatible with Linux' stdcall C functions.

I didn't know Linux even had stdcall C functions.

GCC has __attribute__((__stdcall__)) Specifically, I want to work with winelib, which is a Windows API implementation for Linux (and others); and like Windows, uses stdcall. Also, there's a static assert in std.c.windows.windows preventing it from working with winelib; I had to comment that line out and it at least compiled, just wouldn't link due to the stdcall stuff.

-- Anders
Apr 23 2007