min/max macros replacement