summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-09-18 20:41:59 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-09-18 20:41:59 (GMT)
commit3e7fe5a7a0db605d791921abf0b910f6b41e0359 (patch)
tree0e9438ee00efa4deffc7ca660edc63861969b3ca /Source
parenta98881ac8ff9e12a690ebee381af17e475e3ab03 (diff)
parentdfa0ebd646203e4cecc150ff7589392d899e13d4 (diff)
downloadCMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.zip
CMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.tar.gz
CMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.tar.bz2
Merge topic 'if-version-depth'
dfa0ebd if: Compare up to 8 components in VERSION tests
Diffstat (limited to 'Source')
-rw-r--r--Source/cmIfCommand.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index ffc0f35..56d7170 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -409,14 +409,18 @@ namespace
enum Op { OpLess, OpEqual, OpGreater };
bool HandleVersionCompare(Op op, const char* lhs_str, const char* rhs_str)
{
- // Parse out up to 4 components.
- unsigned int lhs[4] = {0,0,0,0};
- unsigned int rhs[4] = {0,0,0,0};
- sscanf(lhs_str, "%u.%u.%u.%u", &lhs[0], &lhs[1], &lhs[2], &lhs[3]);
- sscanf(rhs_str, "%u.%u.%u.%u", &rhs[0], &rhs[1], &rhs[2], &rhs[3]);
+ // Parse out up to 8 components.
+ unsigned int lhs[8] = {0,0,0,0,0,0,0,0};
+ unsigned int rhs[8] = {0,0,0,0,0,0,0,0};
+ sscanf(lhs_str, "%u.%u.%u.%u.%u.%u.%u.%u",
+ &lhs[0], &lhs[1], &lhs[2], &lhs[3],
+ &lhs[4], &lhs[5], &lhs[6], &lhs[7]);
+ sscanf(rhs_str, "%u.%u.%u.%u.%u.%u.%u.%u",
+ &rhs[0], &rhs[1], &rhs[2], &rhs[3],
+ &rhs[4], &rhs[5], &rhs[6], &rhs[7]);
// Do component-wise comparison.
- for(unsigned int i=0; i < 4; ++i)
+ for(unsigned int i=0; i < 8; ++i)
{
if(lhs[i] < rhs[i])
{