diff options
author | sudden6 <sudden6@gmx.at> | 2016-12-11 17:45:03 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-12-13 02:06:25 +0000 |
commit | 3cfe5544b1cb01771b5a1f722311502127265d0b (patch) | |
tree | 4c6887dd506dbfd20df8709a6a2e0046c123cc10 /toxcore/tox.c | |
parent | 2dc2ac52b93e3a922337294c1e32f7bed794788f (diff) |
Fix version compatibility test.
Also added some test cases for it.
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index f964e18c..5d239be2 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -86,11 +86,7 @@ uint32_t tox_version_patch(void) | |||
86 | 86 | ||
87 | bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) | 87 | bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) |
88 | { | 88 | { |
89 | return (TOX_VERSION_MAJOR == major && /* Force the major version */ | 89 | return TOX_VERSION_IS_API_COMPATIBLE(major, minor, patch); |
90 | (TOX_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ | ||
91 | (TOX_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ | ||
92 | ) | ||
93 | ); | ||
94 | } | 90 | } |
95 | 91 | ||
96 | 92 | ||