[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua number2int braced asm syntax
- From: David Burgess <dburgess@...>
- Date: Wed, 25 May 2005 10:29:22 +1000
Well I have trouble with this on VC6. It does not always compile,
despite the documentation.
My preference (seeing that this is MS specific) is to use the inline
keyword.
#ifdef __cplusplus
__inline int lua_number2int(int i, double d) {__asm {__asm fld d __asm
fistp i} return i;}
#else
_inline int lua_number2int(int i, double d) {__asm {__asm fld d __asm
fistp i} return i;}
#endif
On 5/25/05, Alex Evans <bluespoon@gmail.com> wrote:
> sorry for personal email, the 'susbscribe to lua-l' link online seems
> to be broken (timeout) atm, at least from my corner of the net
>
> I believe the syntax you're after re braced asm in vc is the horrific:
>
> #define lua_number2int(i,d) __asm { __asm fld d __asm fistp i }
>
> this compiles with vc7 and vc7.1 on my machine with lua. I am not sure
> whether it fixes the 'bug' because I am not sure how to reproduce it
> (no hangs on my machine thus far with any variation on lua work 6)
>
> thanks
> alex
>