SDL: don't let SDL_render.c:render_drivers[] have an empty initializer list. (6efe5)

From 6efe5f30ed5d0452e4923e5c10526546d78cd3b2 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 15 Feb 2024 20:55:04 +0300
Subject: [PATCH] don't let SDL_render.c:render_drivers[] have an empty
 initializer list.

---
 src/SDL_internal.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/SDL_internal.h b/src/SDL_internal.h
index f2b3d4155b4e..a8e077583b68 100644
--- a/src/SDL_internal.h
+++ b/src/SDL_internal.h
@@ -246,6 +246,22 @@
 #define SDL_VIDEO_RENDER_VITA_GXM 0
 #endif /* SDL_RENDER_DISABLED */
 
+#define SDL_HAS_RENDER_DRIVER \
+       (SDL_VIDEO_RENDER_SW       | \
+        SDL_VIDEO_RENDER_D3D      | \
+        SDL_VIDEO_RENDER_D3D11    | \
+        SDL_VIDEO_RENDER_D3D12    | \
+        SDL_VIDEO_RENDER_METAL    | \
+        SDL_VIDEO_RENDER_OGL      | \
+        SDL_VIDEO_RENDER_OGL_ES2  | \
+        SDL_VIDEO_RENDER_PS2      | \
+        SDL_VIDEO_RENDER_PSP      | \
+        SDL_VIDEO_RENDER_VITA_GXM)
+
+#if !defined(SDL_RENDER_DISABLED) && !SDL_HAS_RENDER_DRIVER
+#error SDL_RENDER enabled without any backend drivers.
+#endif
+
 #include <SDL3/SDL.h>
 #include <SDL3/SDL_intrin.h>