From ae988ed37bfc4371bddf1e362cb7e52102330ab6 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Tue, 12 May 2009 20:48:05 +0000 Subject: [PATCH] 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. --- aegisub/src/auto4_lua_dialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aegisub/src/auto4_lua_dialog.cpp b/aegisub/src/auto4_lua_dialog.cpp index aace4d407..6410c7651 100644 --- a/aegisub/src/auto4_lua_dialog.cpp +++ b/aegisub/src/auto4_lua_dialog.cpp @@ -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; } }