max() is a standard C macro and can't be used for an engine function under lite-C. Use maxv() instead.

http://manual.conitec.net/avar-max.htm