replace min/max with MIN/MAX
this avoids collisions with other headers that define min and max