MCPcopy Create free account
hub / github.com/Kitware/CMake / consistentNumberProperty

Function consistentNumberProperty

Source/cmGeneratorTarget_CompatibleInterface.cxx:477–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477static std::pair<bool, char const*> consistentNumberProperty(char const* lhs,
478 char const* rhs,
479 CompatibleType t)
480{
481 char* pEnd;
482
483 long lnum = strtol(lhs, &pEnd, 0);
484 if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) {
485 return { false, nullptr };
486 }
487
488 long rnum = strtol(rhs, &pEnd, 0);
489 if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE) {
490 return { false, nullptr };
491 }
492
493 if (t == NumberMaxType) {
494 return { true, std::max(lnum, rnum) == lnum ? lhs : rhs };
495 }
496
497 return { true, std::min(lnum, rnum) == lnum ? lhs : rhs };
498}
499
500template <>
501std::pair<bool, char const*> consistentProperty(char const* lhs,

Callers 1

consistentPropertyFunction · 0.85

Calls 1

minFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…