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

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

(cherry picked from commit bc30fb295d1e0d6bd170729e51fd6bf6d7a2e969)
---
 src/SDL_internal.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/SDL_internal.h b/src/SDL_internal.h
index ae638e8322df..b193edef62f2 100644
--- a/src/SDL_internal.h
+++ b/src/SDL_internal.h
@@ -187,6 +187,24 @@
 #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_ES   | \
+        SDL_VIDEO_RENDER_OGL_ES2  | \
+        SDL_VIDEO_RENDER_DIRECTFB | \
+        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 "SDL_assert.h"
 #include "SDL_log.h"