lua-users home
lua-l archive

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

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<> 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: [] 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<> wrote:
>> On Mon, Jul 27, 2009 at 5:37 PM, King, Mike<> 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.