[PATCH 07/15 6.6.y] minmax: improve macro expansion and type checking