testevdev: Add a static assertion for supported sizeof(long)

If this assertion fails on some platform (unlikely), we will need a
third implementation for SwapLongLE().

Signed-off-by: Simon McVittie <smcv@collabora.com>

(cherry-picked from commit 81dee31949)
This commit is contained in:
Simon McVittie 2022-10-12 12:36:41 +01:00 committed by Ozkan Sezer
parent e07f106760
commit 4a0ad650d0

View file

@ -935,6 +935,7 @@ static const GuessTest guess_tests[] =
}
};
SDL_COMPILE_TIME_ASSERT(sizeof_long, sizeof(unsigned long) == 4 || sizeof(unsigned long) == 8);
#define SwapLongLE(X) \
((sizeof(unsigned long) == 4) ? SDL_SwapLE32(X) : SDL_SwapLE64(X))