SDL.h now exists solely as a header that includes everything else, instead
of one that forces you to include everything else when you just want the
declaration for SDL_Init().
Fixes#6840.
This fixes the following error:
error: PCH file was compiled for the target 'thumbv7-none-linux-android16' but the current translation unit is being compiled for target 'armv7-none-linux-android16'
LINKER_LANGUAGE needs to be used as following:
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
cmake [options] -S <path-to-source> -B <path-to-build>
Specify a source directory to (re-)generate a build system for it in the
current working directory. Specify an existing build directory to
re-generate its build system.
Run 'cmake --help' for more information.
Haiku does not not this property explicitly set because CMake knows .cc files are c++
Make sure the window framebuffer is cleaned up before shutting down OpenGL, as it might be implemented using an OpenGL texture.
Fixes this call stack:
```
(gdb) p _this
$1 = (SDL_VideoDevice *) 0x42e360
(gdb) p _this->egl_data
$2 = (struct SDL_EGL_VideoData *) 0x0
```
```
./src/thread/pthread/SDL_syssem.c:140:12: warning: variable 'retval' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
while (sem_trywait(&sem->sem) != 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/thread/pthread/SDL_syssem.c:149:12: note: uninitialized use occurs here
return retval;
^~~~~~
./src/thread/pthread/SDL_syssem.c:140:12: note: remove the condition if it is always true
while (sem_trywait(&sem->sem) != 0) {
```
This was a legitimate bug, thank you clang!
Fixes https://github.com/libsdl-org/SDL/issues/6830
```
./src/joystick/SDL_joystick.c:105:12: warning: no previous extern declaration for non-static variable 'SDL_joystick_lock' [-Wmissing-variable-declarations]
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
^
./src/joystick/SDL_joystick.c:105:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
^
```
1 warning generated.
(cherry picked from commit 3b0cd441584ada86c4456afb4e8b3edaf2173073)
makes the SDL_main code shorter
Also added a generic SDL_RunApp() implementation for platforms that
don't really need it.
Some platforms (that use SDL_main but haven't been ported yet) are
still missing, but are added in the following commits.