소스 검색

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 <[email protected]>

(cherry-picked from commit 81dee3194990351148c6e2ccd9bb3b4a7bed3079)
Simon McVittie 2 년 전
부모
커밋
4a0ad650d0
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      test/testevdev.c

+ 1 - 0
test/testevdev.c

@@ -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))