support older compiler

This commit is contained in:
Vadim Lopatin 2016-03-25 14:59:02 +03:00
parent 695003ba2b
commit 8b827420c2
1 changed files with 7 additions and 1 deletions

View File

@ -82,7 +82,13 @@ class SettingsFile {
}
static int limitInt(long value, int minvalue, int maxvalue) {
return clamp(cast(int)value, minvalue, maxvalue);
if (value < minValue)
return minValue;
if (value > maxValue)
return maxValue;
return value;
// remove clamp to support older compilers
//return clamp(cast(int)value, minvalue, maxvalue);
}
static string limitString(string value, const string[] values)