mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-19 11:18:27 +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:
parent
36b2690e40
commit
abc12a832c
15 changed files with 55 additions and 63 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue