[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 (work3) now available
- From: Mike Pall <mikelu-0412@...>
- Date: Sat, 11 Dec 2004 08:50:49 +0100
Hi,
David Burgess wrote:
> + #elif (defined (WIN32) || defined (_WIN32))
> + #include <io.h>
> + #define stdin_is_tty() _isatty(0)
> #else
I think it is sufficient to test for _WIN32. M$ does it that way,
they should know. ;-)
> + #elif ((defined (WIN32) || defined (_WIN32)) && defined(_M_IX86))
> + #include <math.h>
> + #pragma warning(disable: 4514)
> + __inline int lrint (double flt)
> + { int i;
> + _asm {
> + fld flt
> + fistp i
> + };
> + return i;
> + }
> + #define lua_number2int(i,d) ((i)=lrint((d)))
> #else
Testing for _WIN32 is testing for the OS API. But since your code is
specific to the compiler (and CPU) you want to test for _MSC_VER and
_M_IX86.
I'm cross-compiling on a Linux host for a WIN32 PE executable target
and things like this do matter then.
Bye,
Mike