mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 03:48:14 +00:00
Revert "Add and use SDL_FALLTHROUGH
for fallthroughs"
This reverts commit 66a08aa391
.
This causes problems with older compilers:
https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
This commit is contained in:
@@ -496,13 +496,25 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
||||
if (dwords == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* !!! FIXME: there are better ways to do this, but this is just to clean this up for now. */
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
|
||||
switch (dwords % 4) {
|
||||
case 0: do { *_p++ = _val; SDL_FALLTHROUGH;
|
||||
case 3: *_p++ = _val; SDL_FALLTHROUGH;
|
||||
case 2: *_p++ = _val; SDL_FALLTHROUGH;
|
||||
case 1: *_p++ = _val;
|
||||
case 0: do { *_p++ = _val; /* fallthrough */
|
||||
case 3: *_p++ = _val; /* fallthrough */
|
||||
case 2: *_p++ = _val; /* fallthrough */
|
||||
case 1: *_p++ = _val; /* fallthrough */
|
||||
} while ( --_n );
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user