lua-users home
lua-l archive

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


  [[ oops, did not mean to send previous message as it is unfinished and
contains an error ]]

  Delphi can actually use cdecl calls if you specify as such in the import
unit, though VB requires stdcall.  And the stdcall convention will support
varargs, though it changes "who" is responsible for the stack cleanup. 
(though I don't believe that either Delphi or VB has native syntax for
calling a vararg function)

  I guess my point was simply that the more "typical" way of coding a truly
generic DLL is to avoid varargs where possible, and definately use the
stdcall convention.  It's just easier to provide multi-language support
where that's the case.  And that seems like a worthy goal for an embedded
scripting language - to be as platform-friendly/platform-generic as
possible.

  Anyway, like I said there are ways around it, I just wanted to mention
it.

 >> In fact to use the stdcall convention you have to edit all the 
 >> declaration and implementation of exported functions.

  ..unless your compiler has a global switch for default calling
convention.  :-)

  Cheers,

  Dave