SDL/src/audio
Misa 3bf7994fe2 Add and use `SDL_FALLTHROUGH` for fallthroughs
Case fallthrough warnings can be suppressed using the __fallthrough__
compiler attribute. Unfortunately, not all compilers have this
attribute, or even have __has_attribute to check if they have the
__fallthrough__ attribute. [[fallthrough]] is also available in C++17
and the next C2x, but not everyone uses C++17 or C2x.

So define the SDL_FALLTHROUGH macro to deal with those problems - if we
are using C++17 or C2x, it expands to [[fallthrough]]; else if the
compiler has __has_attribute and has the __fallthrough__ attribute, then
it expands to __attribute__((__fallthrough__)); else it expands to an
empty statement, with a /* fallthrough */ comment (it's a do {} while
(0) statement, because users of this macro need to use a semicolon,
because [[fallthrough]] and __attribute__((__fallthrough__)) require a
semicolon).

Clang before Clang 10 and GCC before GCC 7 have problems with using
__attribute__ as a sole statement and warn about a "declaration not
declaring anything", so fall back to using the /* fallthrough */ comment
if we are using those older compiler versions.

Applications using SDL are also free to use this macro (because it is
defined in begin_code.h).

All existing /* fallthrough */ comments have been replaced with this
macro. Some of them were unnecessary because they were the last case in
a switch; using SDL_FALLTHROUGH in those cases would result in a compile
error on compilers that support __fallthrough__, for having a
__attribute__((__fallthrough__)) statement that didn't immediately
precede a case label.
2021-11-12 07:26:14 +03:00
..
aaudio Fixed crash on Android 8, due to bugs in AAudio implementation 2021-11-02 15:59:26 -07:00
alsa alsa: Make hotplug thread optional. 2021-10-30 16:02:12 -04:00
android Updated copyright for 2021 2021-01-02 10:25:38 -08:00
arts Updated copyright for 2021 2021-01-02 10:25:38 -08:00
coreaudio Removed duplicate SDL_AtomicGet() 2021-05-28 12:29:54 -04:00
directsound Add SDL_GetAudioDeviceSpec. 2021-03-05 12:03:07 -08:00
disk audio: Changed a disk and dummy backends to use _this instead of this. 2021-04-06 18:35:20 -04:00
dsp Make sure SDL file descriptors don't leak into child processes 2021-09-08 14:47:40 -07:00
dummy audio: Fixed assertion failure if trying to use dummy backend. 2021-04-06 18:35:20 -04:00
emscripten emscripten: Feed silence to device when paused 2021-08-14 12:24:35 +01:00
esd Updated copyright for 2021 2021-01-02 10:25:38 -08:00
fusionsound Updated copyright for 2021 2021-01-02 10:25:38 -08:00
haiku Updated copyright for 2021 2021-01-02 10:25:38 -08:00
jack Updated copyright for 2021 2021-01-02 10:25:38 -08:00
nacl Updated copyright for 2021 2021-01-02 10:25:38 -08:00
nas Fixed some accidental uses of external C runtime functions 2021-09-22 09:06:45 -07:00
netbsd Make sure SDL file descriptors don't leak into child processes 2021-09-08 14:47:40 -07:00
openslES OpenSLES: CloseDevice() is called at higher level, if OpenDevice() fails 2021-04-29 09:29:02 +02:00
os2 replaced many uses of libc calls with SDL_ counterparts in os2 sources. 2021-10-04 23:00:28 +03:00
paudio core: Convert SDL_IOReady()'s 2nd parameter to flags 2021-10-30 21:23:45 -07:00
pipewire Add SDL_HINT_APP_NAME and DBUS inhibition hint 2021-08-30 09:15:11 -04:00
psp Updated copyright for 2021 2021-01-02 10:25:38 -08:00
pulseaudio Add SDL_HINT_APP_NAME and DBUS inhibition hint 2021-08-30 09:15:11 -04:00
qsa core: Convert SDL_IOReady()'s 2nd parameter to flags 2021-10-30 21:23:45 -07:00
sndio Updated copyright for 2021 2021-01-02 10:25:38 -08:00
sun core: Convert SDL_IOReady()'s 2nd parameter to flags 2021-10-30 21:23:45 -07:00
vita Set volume on device open 2021-04-24 14:13:09 -07:00
wasapi SDL_wasapi.c: fixed build against older SDKs. 2021-08-12 01:40:50 +03:00
winmm Fixed warnings building with Visual Studio 2021-05-25 10:34:04 -07:00
SDL_audio.c Restore previous behavior of empty SDL_AUDIODRIVER trying all drivers. 2021-08-30 05:00:51 +03:00
SDL_audio_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_audiocvt.c Fixed bug #4534: NEON implementation of Convert51ToStereo (Thanks Ryan!) 2021-10-14 23:17:08 +02:00
SDL_audiodev.c Make sure SDL file descriptors don't leak into child processes 2021-09-08 14:47:40 -07:00
SDL_audiodev_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_audiotypecvt.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_mixer.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_sysaudio.h AAudio: add bootstrap in SDL_audio.c 2021-04-15 21:00:00 +02:00
SDL_wave.c Add and use `SDL_FALLTHROUGH` for fallthroughs 2021-11-12 07:26:14 +03:00
SDL_wave.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00