App: Add #include <climit> and switch to std::numeric_limits (#27742)

* add missing include to fix compilation on Fedora 44
* change short limit notation
This commit is contained in:
FilippoR
2026-02-28 15:02:23 +01:00
committed by GitHub
parent 93f76a8991
commit 8653d94287
+2 -1
View File
@@ -29,6 +29,7 @@
#include <vector>
#include <string>
#include <memory>
#include <limits>
#include <Base/Persistence.h>
#include "DynamicProperty.h"
@@ -143,7 +144,7 @@ struct AppExport PropertyData
short int getOffsetTo(const App::Property* prop) const {
auto *pt = (const char*)prop;
auto *base = (const char *)m_container;
if(pt<base || pt>base+SHRT_MAX)
if(pt<base || pt>base+std::numeric_limits<short>::max())
return -1;
return (short) (pt-base);
}