stdcall functions?

Anders Bergh anders at andersman.org
Mon Apr 23 14:02:29 PDT 2007


__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 at dprogramming.com> 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.
>
> 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



More information about the Digitalmars-d mailing list