stdcall functions?

Thomas Kühne thomas-dloop at kuehne.cn
Mon Apr 23 12:33:53 PDT 2007


Chris Miller wrote:
> On Mon, 23 Apr 2007 06:15:36 -0400, Walter Bright
> <newshound1 at digitalmars.com> wrote:
> 
>> Chris Miller wrote:
>>> On Mon, 23 Apr 2007 03:32:31 -0400, Walter Bright
>>> <newshound1 at 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 at 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?
> 
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmd_wine_fixer
Type: application/octet-stream
Size: 4824 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070423/9be17f2b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 155 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070423/9be17f2b/attachment.pgp>


More information about the Digitalmars-d mailing list