diff options
-rw-r--r-- | toxav/toxav.c | 9 | ||||
-rw-r--r-- | toxcore/tox.c | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index 4c2cb4ef..7a883cf2 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -121,10 +121,11 @@ uint32_t toxav_version_patch(void) | |||
121 | 121 | ||
122 | bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) | 122 | bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) |
123 | { | 123 | { |
124 | if (major != TOXAV_VERSION_MAJOR) | 124 | return (TOXAV_VERSION_MAJOR == major && /* Force the major version */ |
125 | return 0; | 125 | (TOXAV_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ |
126 | else | 126 | (TOXAV_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ |
127 | return 1; | 127 | ) |
128 | ) | ||
128 | } | 129 | } |
129 | 130 | ||
130 | ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) | 131 | ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) |
diff --git a/toxcore/tox.c b/toxcore/tox.c index 3a9c4481..677fd112 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -87,10 +87,11 @@ uint32_t tox_version_patch(void) | |||
87 | 87 | ||
88 | bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) | 88 | bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) |
89 | { | 89 | { |
90 | if (major != TOX_VERSION_MAJOR) | 90 | return (TOX_VERSION_MAJOR == major && /* Force the major version */ |
91 | return 0; | 91 | (TOX_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ |
92 | else | 92 | (TOX_VERSION_MINOR == minor && TOX_VERSION_PATCH >= patch) /* the patch must be the same or newer */ |
93 | return 1; | 93 | ) |
94 | ) | ||
94 | } | 95 | } |
95 | 96 | ||
96 | 97 | ||