lua-users home
lua-l archive

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


Chris Tavares <ctavares@develop.com> wrote:

>> Thank you very much, this is exactly what I was looking for!
>> Too bad it is compiler dependent (although it supports two of the most
>> populars), and have inline assembly code (so it isn't portable for Alpha
>> or Epoc, plus I have less control on it)...
>> But it resolves a problem far more complex than I though.
>
>Well, the problem is that you MUST use assembly to do this sort of thing -
>higher level languages don't give you enough control over the stack and
>registers to have any hope of setting up a call properly.

Though this is a fine solution, I wouldn't go as far as that.  You can
simply create a switch to calls with 0 to N arguments, with N some
reasonable value.  Plus, for Windows a duplicate set for cdecl vs
stdcall.  No brownie points for elegance, but it's pure C.

-jcw