Fix limits macro usage in C++