If stakx's answer is not sufficient, you may want to look into "min" and "max" variables. There may be some preprocessor definition, preventing the whole thing from working.
Try adding
#undef min
#undef max
just before your code, to see if the error stands.