use compatible type max definitions

UINT8_MAX/UINT16_MAX only work on osx and glibc builds with certain
defines.