Apparently not all platforms agree on providing MININT and MAXINT constants. Work around it by calculating those values ourselves.

Originally committed to SVN as r2917.
This commit is contained in:
Niels Martin Hansen 2009-05-12 20:48:05 +00:00
parent 55d5b668fa
commit 3ddf48665a

View file

@ -332,8 +332,11 @@ namespace Automation4 {
nospin:
if (!hasspin) {
lua_pop(L, 1);
min = MININT;
max = MAXINT;
// Assuming we are using a binary machine with finite word length,
// that represents integers as two's complement, this will get us
// the largest and smallest values representable by the int type.
max = (int)((~(unsigned int)0) >> 1);
min = ~max;
}
}