SDL: Fix Xbox builds

From e98cf3c8704325cf7f7060a6c4cdeb16fb81a0ee Mon Sep 17 00:00:00 2001
From: Daniel Ludwig <[EMAIL REDACTED]>
Date: Fri, 27 Sep 2024 11:33:00 +0200
Subject: [PATCH] Fix Xbox builds

---
 src/gpu/d3d12/SDL_gpu_d3d12.c | 10 ++++++----
 src/stdlib/SDL_getenv.c       |  4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c
index 981b4b1f565da..c2ef63408e1fd 100644
--- a/src/gpu/d3d12/SDL_gpu_d3d12.c
+++ b/src/gpu/d3d12/SDL_gpu_d3d12.c
@@ -921,8 +921,9 @@ static ID3D12CommandQueue *s_CommandQueue;
 #endif
 
 #if defined(SDL_PLATFORM_XBOXONE)
-// This is not defined in d3d12_x.h.
+// These are not defined in d3d12_x.h.
 typedef HRESULT (D3DAPI* PFN_D3D12_XBOX_CREATE_DEVICE)(_In_opt_ IGraphicsUnknown*, _In_ const D3D12XBOX_CREATE_DEVICE_PARAMETERS*, _In_ REFIID, _Outptr_opt_ void**);
+#define D3D12_STANDARD_MULTISAMPLE_PATTERN DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN
 #endif
 
 // Logging
@@ -6094,6 +6095,7 @@ static bool D3D12_INTERNAL_CreateSwapchain(
             renderer->blitFrom2DArrayShader,
             renderer->blitFrom3DShader,
             renderer->blitFromCubeShader,
+            renderer->blitFromCubeArrayShader,
             &renderer->blitPipelines,
             &renderer->blitPipelineCount,
             &renderer->blitPipelineCapacity);
@@ -8117,7 +8119,7 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
             IID_GRAPHICS_PPV_ARGS(&renderer->device));
         if (FAILED(res)) {
             D3D12_INTERNAL_DestroyRenderer(renderer);
-            ERROR_CHECK_RETURN("Could not create D3D12Device", NULL);
+            CHECK_D3D12_ERROR_AND_RETURN("Could not create D3D12Device", NULL);
         }
 
         res = renderer->device->SetFrameIntervalX(
@@ -8127,7 +8129,7 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
             D3D12XBOX_FRAME_INTERVAL_FLAG_NONE);
         if (FAILED(res)) {
             D3D12_INTERNAL_DestroyRenderer(renderer);
-            ERROR_CHECK_RETURN("Could not get set frame interval", NULL);
+            CHECK_D3D12_ERROR_AND_RETURN("Could not get set frame interval", NULL);
         }
 
         res = renderer->device->ScheduleFrameEventX(
@@ -8137,7 +8139,7 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
             D3D12XBOX_SCHEDULE_FRAME_EVENT_FLAG_NONE);
         if (FAILED(res)) {
             D3D12_INTERNAL_DestroyRenderer(renderer);
-            ERROR_CHECK_RETURN("Could not schedule frame events", NULL);
+            CHECK_D3D12_ERROR_AND_RETURN("Could not schedule frame events", NULL);
         }
 
         s_Device = renderer->device;
diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c
index 6b691e3df1513..c50f23bcacd51 100644
--- a/src/stdlib/SDL_getenv.c
+++ b/src/stdlib/SDL_getenv.c
@@ -23,7 +23,7 @@
 #include "../SDL_hashtable.h"
 #include "SDL_getenv_c.h"
 
-#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
+#if defined(SDL_PLATFORM_WINDOWS)
 #include "../core/windows/SDL_windows.h"
 #endif
 
@@ -31,7 +31,7 @@
 #include "../core/android/SDL_android.h"
 #endif
 
-#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
+#if defined(SDL_PLATFORM_WINDOWS)
 #define HAVE_WIN32_ENVIRONMENT
 #elif defined(HAVE_GETENV) && \
       (defined(HAVE_SETENV) || defined(HAVE_PUTENV)) && \