SDL: Including SD_error.h into headers with error-returning functions

From 3f8dba3713f33ecdacb23d845e1caed11cd19f5c Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Thu, 4 Apr 2024 18:38:21 +0200
Subject: [PATCH] Including SD_error.h into headers with error-returning
 functions

---
 include/SDL3/SDL_camera.h     | 1 +
 include/SDL3/SDL_clipboard.h  | 1 +
 include/SDL3/SDL_dialog.h     | 1 +
 include/SDL3/SDL_filesystem.h | 1 +
 include/SDL3/SDL_hidapi.h     | 1 +
 include/SDL3/SDL_hints.h      | 1 +
 include/SDL3/SDL_init.h       | 1 +
 include/SDL3/SDL_main.h       | 1 +
 include/SDL3/SDL_messagebox.h | 1 +
 include/SDL3/SDL_misc.h       | 1 +
 include/SDL3/SDL_pixels.h     | 1 +
 include/SDL3/SDL_power.h      | 1 +
 include/SDL3/SDL_properties.h | 1 +
 include/SDL3/SDL_render.h     | 1 +
 include/SDL3/SDL_storage.h    | 1 +
 include/SDL3/SDL_surface.h    | 1 +
 include/SDL3/SDL_system.h     | 1 +
 include/SDL3/SDL_version.h    | 1 +
 include/SDL3/SDL_video.h      | 1 +
 include/SDL3/SDL_vulkan.h     | 1 +
 20 files changed, 20 insertions(+)

diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h
index 717de3c760672..923fb481debfd 100644
--- a/include/SDL3/SDL_camera.h
+++ b/include/SDL3/SDL_camera.h
@@ -28,6 +28,7 @@
 #ifndef SDL_camera_h_
 #define SDL_camera_h_
 
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_video.h>
 
 #include <SDL3/SDL_begin_code.h>
diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h
index 7e2d3aba6662c..5f0257ee7e1b5 100644
--- a/include/SDL3/SDL_clipboard.h
+++ b/include/SDL3/SDL_clipboard.h
@@ -29,6 +29,7 @@
 #define SDL_clipboard_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_dialog.h b/include/SDL3/SDL_dialog.h
index 4af592e508690..d4a7577cb2512 100644
--- a/include/SDL3/SDL_dialog.h
+++ b/include/SDL3/SDL_dialog.h
@@ -22,6 +22,7 @@
 #ifndef SDL_dialog_h_
 #define SDL_dialog_h_
 
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_video.h>
 
 #include <SDL3/SDL_begin_code.h>
diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h
index 1fabcc2362730..971a19bee3949 100644
--- a/include/SDL3/SDL_filesystem.h
+++ b/include/SDL3/SDL_filesystem.h
@@ -29,6 +29,7 @@
 #define SDL_filesystem_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 
diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h
index 422c329acd993..ecbe0de505f35 100644
--- a/include/SDL3/SDL_hidapi.h
+++ b/include/SDL3/SDL_hidapi.h
@@ -63,6 +63,7 @@
 #define SDL_hidapi_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 9fc0475418093..5c04617ad5907 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -40,6 +40,7 @@
 #define SDL_hints_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_init.h b/include/SDL3/SDL_init.h
index cb2de999729af..d1b925270cad6 100644
--- a/include/SDL3/SDL_init.h
+++ b/include/SDL3/SDL_init.h
@@ -29,6 +29,7 @@
 #define SDL_init_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h
index 0659ad61d4562..7694e3eac5ced 100644
--- a/include/SDL3/SDL_main.h
+++ b/include/SDL3/SDL_main.h
@@ -24,6 +24,7 @@
 
 #include <SDL3/SDL_platform_defines.h>
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_events.h>
 
 /*
diff --git a/include/SDL3/SDL_messagebox.h b/include/SDL3/SDL_messagebox.h
index b9c4d93f14a24..3d68552755a90 100644
--- a/include/SDL3/SDL_messagebox.h
+++ b/include/SDL3/SDL_messagebox.h
@@ -23,6 +23,7 @@
 #define SDL_messagebox_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_video.h>      /* For SDL_Window */
 
 #include <SDL3/SDL_begin_code.h>
diff --git a/include/SDL3/SDL_misc.h b/include/SDL3/SDL_misc.h
index e50d91bd1389c..e873199898efc 100644
--- a/include/SDL3/SDL_misc.h
+++ b/include/SDL3/SDL_misc.h
@@ -29,6 +29,7 @@
 #define SDL_misc_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 
diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h
index 94533f24a8a00..b0606ce627835 100644
--- a/include/SDL3/SDL_pixels.h
+++ b/include/SDL3/SDL_pixels.h
@@ -65,6 +65,7 @@
 #define SDL_pixels_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_endian.h>
 
 #include <SDL3/SDL_begin_code.h>
diff --git a/include/SDL3/SDL_power.h b/include/SDL3/SDL_power.h
index 117fc0fc1fdb1..15e5baa4472a1 100644
--- a/include/SDL3/SDL_power.h
+++ b/include/SDL3/SDL_power.h
@@ -29,6 +29,7 @@
  */
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h
index 80c2f52396ee6..f9d895a9e4537 100644
--- a/include/SDL3/SDL_properties.h
+++ b/include/SDL3/SDL_properties.h
@@ -29,6 +29,7 @@
 #define SDL_properties_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h
index 46cf94a6253f9..c11526eca0884 100644
--- a/include/SDL3/SDL_render.h
+++ b/include/SDL3/SDL_render.h
@@ -49,6 +49,7 @@
 #define SDL_render_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_events.h>
 #include <SDL3/SDL_properties.h>
 #include <SDL3/SDL_rect.h>
diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h
index 2ea2d190d73ff..21490f2ed8bc9 100644
--- a/include/SDL3/SDL_storage.h
+++ b/include/SDL3/SDL_storage.h
@@ -29,6 +29,7 @@
 #define SDL_storage_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_filesystem.h>
 #include <SDL3/SDL_properties.h>
 
diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h
index 19f77e9ff61e8..ddef6abdaffa6 100644
--- a/include/SDL3/SDL_surface.h
+++ b/include/SDL3/SDL_surface.h
@@ -29,6 +29,7 @@
 #define SDL_surface_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_blendmode.h>
 #include <SDL3/SDL_pixels.h>
 #include <SDL3/SDL_properties.h>
diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h
index 25964ba350419..3d84100851cb1 100644
--- a/include/SDL3/SDL_system.h
+++ b/include/SDL3/SDL_system.h
@@ -29,6 +29,7 @@
 #define SDL_system_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_keyboard.h>
 #include <SDL3/SDL_render.h>
 #include <SDL3/SDL_video.h>
diff --git a/include/SDL3/SDL_version.h b/include/SDL3/SDL_version.h
index 492898a1b596d..11fc353ec46f2 100644
--- a/include/SDL3/SDL_version.h
+++ b/include/SDL3/SDL_version.h
@@ -29,6 +29,7 @@
 #define SDL_version_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 
 #include <SDL3/SDL_begin_code.h>
 /* Set up for C function definitions, even when using C++ */
diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h
index fff4e8fa85003..0be8e627d14a1 100644
--- a/include/SDL3/SDL_video.h
+++ b/include/SDL3/SDL_video.h
@@ -29,6 +29,7 @@
 #define SDL_video_h_
 
 #include <SDL3/SDL_stdinc.h>
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_pixels.h>
 #include <SDL3/SDL_properties.h>
 #include <SDL3/SDL_rect.h>
diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h
index 64544c8b699cd..64e7349e4071a 100644
--- a/include/SDL3/SDL_vulkan.h
+++ b/include/SDL3/SDL_vulkan.h
@@ -28,6 +28,7 @@
 #ifndef SDL_vulkan_h_
 #define SDL_vulkan_h_
 
+#include <SDL3/SDL_error.h>
 #include <SDL3/SDL_video.h>
 
 #include <SDL3/SDL_begin_code.h>