Turns out AVR doesn't have __builtin_min/max
At least for min/max this will ensure types for both arguments are the same. This should be a little bit closer to the <cmath> definition that simply overloads these functions instead.