Conditionally enable non-portable assert on LP64.

This only works on LP64. It may fail on Windows, which can be LLP64
(IL32P64).
This commit is contained in:
iphydf 2016-12-10 13:26:34 +00:00
parent ba476e82bb
commit f208fb53b1
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -2752,7 +2752,9 @@ static uint32_t friends_list_save(const Messenger *m, uint8_t *data)
uint8_t *next_data = friend_save(&temp, cur_data);
#ifdef TOX_DEBUG
assert(next_data - cur_data == friend_size());
#ifdef __LP64__
assert(memcmp(cur_data, &temp, friend_size()) == 0);
#endif
#endif
cur_data = next_data;
num++;
@ -2812,7 +2814,9 @@ static int friends_list_load(Messenger *m, const uint8_t *data, uint32_t length)
const uint8_t *next_data = friend_load(&temp, cur_data);
#ifdef TOX_DEBUG
assert(next_data - cur_data == friend_size());
#ifdef __LP64__
assert(memcmp(&temp, cur_data, friend_size()) == 0);
#endif
#endif
cur_data = next_data;