tracktwo / xcomsave

46 stars 16 forks source link

include <limits> is missing in xcomio.h #24

Closed shaygover closed 2 years ago

shaygover commented 2 years ago

Had to add it to avoid this:

/path/xcomsave/xcomio.cpp: In member function ‘void xcom::xcom_io::write_unicode_string(const xcom::xcom_string&)’: /path/xcomsave/xcomio.cpp:216:66: error: ‘numeric_limits’ is not a member of ‘std’ 216 | if ((conv16.length() + 1) > static_cast(std::numeric_limits::max())) { | ^~~~~~ /path/xcomsave/xcomio.cpp:216:88: error: expected primary-expression before ‘>’ token 216 | ((conv16.length() + 1) > static_cast(std::numeric_limits::max())) { | ^

/path/xcomsave/xcomio.cpp:216:91: error: ‘::max’ has not been declared; did you mean ‘std::max’? 216 | ((conv16.length() + 1) > static_cast(std::numeric_limits::max())) { | ^~~ | std::max In file included from /usr/include/c++/11.1.0/algorithm:62, from /path/xcomsave/xcom.h:28, from /path/xcomsave/xcomio.cpp:24: /usr/include/c++/11.1.0/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here 3467 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /path/xcomsave/xcomio.cpp:240:64: error: ‘numeric_limits’ is not a member of ‘std’ 240 | if ((conv.length() + 1) > static_cast(std::numeric_limits::max())) { | ^~~~~~ /path/xcomsave/xcomio.cpp:240:86: error: expected primary-expression before ‘>’ token 240 | if ((conv.length() + 1) > static_cast(std::numeric_limits::max())) { | ^

/path/xcomsave/xcomio.cpp:240:89: error: ‘::max’ has not been declared; did you mean ‘std::max’? 240 | f ((conv.length() + 1) > static_cast(std::numeric_limits::max())) { | ^~~ | std::max In file included from /usr/include/c++/11.1.0/algorithm:62, from /path/xcomsave/xcom.h:28, from /path/xcomsave/xcomio.cpp:24: /usr/include/c++/11.1.0/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here 3467 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ make[2]: [CMakeFiles/xcomsave.dir/build.make:90: CMakeFiles/xcomsave.dir/xcomio.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:115: CMakeFiles/xcomsave.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

tracktwo commented 2 years ago

Thanks! I'll commit a fix when I get the chance.

tracktwo commented 2 years ago

Fixed in the main branch