use SDL_COMPILE_TIME_ASSERT instead of SDL_STATIC_ASSERT

This commit is contained in:
pionere 2022-01-12 16:40:52 +01:00 committed by Ryan C. Gordon
parent 3936af99d8
commit 014e2bbdb2
2 changed files with 1 additions and 2 deletions

View File

@ -76,7 +76,6 @@ assert can have unique static variables associated with it.
#endif #endif
#define SDL_FILE __FILE__ #define SDL_FILE __FILE__
#define SDL_LINE __LINE__ #define SDL_LINE __LINE__
#define SDL_STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1];
/* /*
sizeof (x) makes the compiler still parse the expression even without sizeof (x) makes the compiler still parse the expression even without

View File

@ -448,7 +448,7 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
SDL_bool isstack; SDL_bool isstack;
/* Create temporary buffer for ICONIMAGE structure */ /* Create temporary buffer for ICONIMAGE structure */
SDL_STATIC_ASSERT(sizeof(BITMAPINFOHEADER) == 40, WIN_SetWindowIcon_uses_BITMAPINFOHEADER_to_prepare_an_ICONIMAGE); SDL_COMPILE_TIME_ASSERT(WIN_SetWindowIcon_uses_BITMAPINFOHEADER_to_prepare_an_ICONIMAGE, sizeof(BITMAPINFOHEADER) == 40);
mask_len = (icon->h * (icon->w + 7)/8); mask_len = (icon->h * (icon->w + 7)/8);
icon_len = sizeof(BITMAPINFOHEADER) + icon->h * icon->w * sizeof(Uint32) + mask_len; icon_len = sizeof(BITMAPINFOHEADER) + icon->h * icon->w * sizeof(Uint32) + mask_len;
icon_bmp = SDL_small_alloc(BYTE, icon_len, &isstack); icon_bmp = SDL_small_alloc(BYTE, icon_len, &isstack);