Define min and max macros for C++ compilation.
Fix compiler warnings.