kmsdrm: Fix an LTO type mismatch warning

Include SDL_kmsdrmopengles.h before SDL_kmsdrmvulkan.h, as the Vulkan header can pull in Wayland headers, which pull in EGL headers with EGL types defined as Wayland types, which causes warnings when building with strict-aliasing and LTO.
This commit is contained in:
Frank Praznik
2024-12-04 12:06:18 -05:00
parent 31128b6cdd
commit 24ed947cc3

View File

@@ -23,6 +23,12 @@
#ifdef SDL_VIDEO_DRIVER_KMSDRM #ifdef SDL_VIDEO_DRIVER_KMSDRM
/* Include this before SDL_kmsdrmvulkan.h, as the Vulkan header can pull in
* Wayland headers, which pull in EGL headers with EGL types defined as Wayland
* types, which causes warnings when building with strict-aliasing and LTO.
*/
#include "SDL_kmsdrmopengles.h"
/* include this here before SDL_sysvideo.h to avoid vulkan type /* include this here before SDL_sysvideo.h to avoid vulkan type
* redefinition errors. it already includes SDL_sysvideo.h. */ * redefinition errors. it already includes SDL_sysvideo.h. */
#include "SDL_kmsdrmvulkan.h" #include "SDL_kmsdrmvulkan.h"
@@ -43,7 +49,6 @@
#include "SDL_kmsdrmevents.h" #include "SDL_kmsdrmevents.h"
#include "SDL_kmsdrmmouse.h" #include "SDL_kmsdrmmouse.h"
#include "SDL_kmsdrmvideo.h" #include "SDL_kmsdrmvideo.h"
#include "SDL_kmsdrmopengles.h"
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <poll.h> #include <poll.h>