lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The default is __cdecl.

I'm now thinking "a C project" in C++Builder 2009 isn't really a C project.  The following page shows the prefix is added or not added depending on the linkage.

http://msdn.microsoft.com/en-us/library/zkwh89ks.aspx


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley
Sent: Monday, July 27, 2009 12:48 PM
To: Lua list
Subject: Re: Standard calling convention on Windows?

Your compiler's default calling convention?

Microsoft Visual C++ creates projects with __cdecl as the default
calling convention (or at least recent versions do), though I cannot
speak for other compilers.

On Mon, Jul 27, 2009 at 5:44 PM, King, Mike<MKing@klmicrowave.com> wrote:
> Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix.  When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix.  What am I missing?
>
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley
> Sent: Monday, July 27, 2009 12:32 PM
> To: Lua list
> Subject: Re: Standard calling convention on Windows?
>
> I'm not aware of any formal standard, though the de-facto standard is
> probably __cdecl. Given that some of the API functions have to be
> __cdecl due to variable argument lists, it makes sense to export all
> of them as __cdecl. Though as a counter-example, all of the (recent)
> games by Relic Entertainment use Lua via a DLL and export everything
> as __stdcall (apart from the aforementioned vararg functions).
>
> On Mon, Jul 27, 2009 at 5:11 PM, steve donovan<steve.j.donovan@gmail.com> wrote:
>> On Mon, Jul 27, 2009 at 5:37 PM, King, Mike<MKing@klmicrowave.com> wrote:
>>> Is there a standard calling convention for building the Lua DLL on Windows?
>>> The Lua DLLs I've seen from a couple of projects are not using the __cdecl
>>> convention.  Is the standard __stdcall?  Is there a standard?
>>
>> They are exported as just plain cdecl C functions.
>>
>> steve d.
>>
>
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.
>

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.