lua-users home
lua-l archive

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


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
>