Skip to content

Commit

Permalink
Conditionally enable non-portable assert on LP64.
Browse files Browse the repository at this point in the history
This only works on LP64. It may fail on Windows, which can be LLP64
(IL32P64).
  • Loading branch information
iphydf committed Dec 12, 2016
1 parent ba476e8 commit f208fb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions toxcore/Messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit f208fb5

Please sign in to comment.