asmaloney/libE57Format

cannot compile with clang (missing limits include)

christian-rauch opened this issue · 0 comments

When trying to compile with clang, E57XmlParser.cpp will be compiled without the required <limits> header:

/run/build/CloudCompare/plugins/core/IO/qE57IO/extern/libE57Format/src/E57XmlParser.cpp: In member function ‘virtual XMLSize_t E57FileInputStream::readBytes(XMLByte*, XMLSize_t)’:
/run/build/CloudCompare/plugins/core/IO/qE57IO/extern/libE57Format/src/E57XmlParser.cpp:143:37: error: ‘numeric_limits’ is not a member of ‘std’
  143 |       const int64_t size_max = std::numeric_limits<size_t>::max();
      |                                     ^~~~~~~~~~~~~~

This header is only included for GCC>11:

#if __GNUC__ >= 11
#include <limits>
#endif

Is there a reason why this header should not be included for other compiler and versions?