Fix -Wundef warnings due to use of unguarded SDL_RENDER_DISABLED

This commit is contained in:
Anonymous Maarten
2023-03-27 15:57:40 +02:00
parent 63fa1bae3e
commit ece25f27fa
28 changed files with 40 additions and 40 deletions

View File

@@ -59,7 +59,7 @@ extern "C" {
#include "SDL_winrtapp_common.h"
#include "SDL_winrtapp_direct3d.h"
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
/* Calling IDXGIDevice3::Trim on the active Direct3D 11.x device is necessary
* when Windows 8.1 apps are about to get suspended.
*/
@@ -618,7 +618,7 @@ void SDL_WinRTApp::OnSuspending(Platform::Object ^ sender, SuspendingEventArgs ^
// Let the Direct3D 11 renderer prepare for the app to be backgrounded.
// This is necessary for Windows 8.1, possibly elsewhere in the future.
// More details at: http://msdn.microsoft.com/en-us/library/windows/apps/Hh994929.aspx
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
if (WINRT_GlobalSDLWindow) {
SDL_Renderer *renderer = SDL_GetRenderer(WINRT_GlobalSDLWindow);
if (renderer && (SDL_strcmp(renderer->info.name, "direct3d11") == 0)) {

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if (defined(SDL_VIDEO_RENDER_D3D) || defined(SDL_VIDEO_RENDER_D3D11) || defined(SDL_VIDEO_RENDER_D3D12)) && !SDL_RENDER_DISABLED
#if (defined(SDL_VIDEO_RENDER_D3D) || defined(SDL_VIDEO_RENDER_D3D11) || defined(SDL_VIDEO_RENDER_D3D12)) && !defined(SDL_RENDER_DISABLED)
#include "SDL_d3dmath.h"
@@ -129,4 +129,4 @@ Float4X4 MatrixRotationZ(float r)
return m;
}
#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED */
#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if (defined(SDL_VIDEO_RENDER_D3D) || defined(SDL_VIDEO_RENDER_D3D11) || defined(SDL_VIDEO_RENDER_D3D12)) && !SDL_RENDER_DISABLED
#if (defined(SDL_VIDEO_RENDER_D3D) || defined(SDL_VIDEO_RENDER_D3D11) || defined(SDL_VIDEO_RENDER_D3D12)) && !defined(SDL_RENDER_DISABLED)
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@@ -78,4 +78,4 @@ Float4X4 MatrixRotationZ(float r);
}
#endif
#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED */
#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) */

View File

@@ -87,7 +87,7 @@ this should probably be removed at some point in the future. --ryan. */
SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_DST_COLOR, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \
SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD)
#if !SDL_RENDER_DISABLED
#ifndef SDL_RENDER_DISABLED
static const SDL_RenderDriver *render_drivers[] = {
#ifdef SDL_VIDEO_RENDER_D3D12
&D3D12_RenderDriver,
@@ -668,7 +668,7 @@ static int UpdateLogicalPresentation(SDL_Renderer *renderer);
int SDL_GetNumRenderDrivers(void)
{
#if !SDL_RENDER_DISABLED
#if !defined(SDL_RENDER_DISABLED)
return SDL_arraysize(render_drivers);
#else
return 0;
@@ -677,7 +677,7 @@ int SDL_GetNumRenderDrivers(void)
const char *SDL_GetRenderDriver(int index)
{
#if !SDL_RENDER_DISABLED
#if !defined(SDL_RENDER_DISABLED)
if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
SDL_SetError("index must be in the range of 0 - %d",
SDL_GetNumRenderDrivers() - 1);
@@ -741,7 +741,7 @@ int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_
return 0;
}
#if !SDL_RENDER_DISABLED
#if !defined(SDL_RENDER_DISABLED)
static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer)
{
/* all of these functions are required to be implemented, even as no-ops, so we don't
@@ -801,7 +801,7 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind
SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 flags)
{
#if !SDL_RENDER_DISABLED
#if !defined(SDL_RENDER_DISABLED)
SDL_Renderer *renderer = NULL;
const int n = SDL_GetNumRenderDrivers();
SDL_bool batching = SDL_TRUE;
@@ -948,7 +948,7 @@ error:
SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
{
#if !SDL_RENDER_DISABLED && SDL_VIDEO_RENDER_SW
#if !defined(SDL_RENDER_DISABLED) && SDL_VIDEO_RENDER_SW
SDL_Renderer *renderer;
renderer = SW_CreateRendererForSurface(surface);

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D) && !defined(SDL_RENDER_DISABLED)
#include "../../core/windows/SDL_windows.h"
@@ -1735,7 +1735,7 @@ SDL_GetRenderD3D9Device(SDL_Renderer *renderer)
{
IDirect3DDevice9 *device = NULL;
#if defined(SDL_VIDEO_RENDER_D3D) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D) && !defined(SDL_RENDER_DISABLED)
D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;
/* Make sure that this is a D3D renderer */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D) && !defined(SDL_RENDER_DISABLED)
#include "../../core/windows/SDL_windows.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
#define COBJMACROS
#include "../../core/windows/SDL_windows.h"
@@ -2407,7 +2407,7 @@ SDL_GetRenderD3D11Device(SDL_Renderer *renderer)
{
ID3D11Device *device = NULL;
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata;
/* Make sure that this is a D3D renderer */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
#include "../../video/winrt/SDL_winrtvideo_cpp.h"
extern "C" {

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
#ifdef __cplusplus
extern "C" {

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D11) && !defined(SDL_RENDER_DISABLED)
#define COBJMACROS
#include "../../core/windows/SDL_windows.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED)
#define SDL_D3D12_NUM_BUFFERS 2
#define SDL_D3D12_NUM_VERTEX_BUFFERS 256
@@ -3050,7 +3050,7 @@ extern "C"
{
ID3D12Device *device = NULL;
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED)
D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata;
/* Make sure that this is a D3D renderer */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED && (defined(__XBOXONE__) || defined(__XBOXSERIES__))
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) && (defined(__XBOXONE__) || defined(__XBOXSERIES__))
#include "SDL_render_d3d12_xbox.h"
#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info."

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
#include "../../core/windows/SDL_windows.h"
#include <d3d12.h>

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED && defined(__XBOXONE__)
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) && defined(__XBOXONE__)
#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info."

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED && defined(__XBOXSERIES__)
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) && defined(__XBOXSERIES__)
#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info."

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_METAL && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_METAL && !defined(SDL_RENDER_DISABLED)
#include "../SDL_sysrender.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_OGL && !defined(SDL_RENDER_DISABLED)
#include "../../video/SDL_sysvideo.h" /* For SDL_RecreateWindow */
#include <SDL3/SDL_opengl.h>
#include "../SDL_sysrender.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_OGL && !defined(SDL_RENDER_DISABLED)
#include <SDL3/SDL_opengl.h>
#include "SDL_shaders_gl.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_OGL_ES2 && !defined(SDL_RENDER_DISABLED)
#include "../../video/SDL_sysvideo.h" /* For SDL_RecreateWindow */
#include <SDL3/SDL_opengles2.h>
@@ -2275,4 +2275,4 @@ SDL_RenderDriver GLES2_RenderDriver = {
0 }
};
#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !defined(SDL_RENDER_DISABLED) */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_OGL_ES2 && !defined(SDL_RENDER_DISABLED)
#include <SDL3/SDL_opengles2.h>
#include "SDL_shaders_gles2.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_draw.h"
#include "SDL_blendfillrect.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_draw.h"
#include "SDL_blendline.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_draw.h"
#include "SDL_blendpoint.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_draw.h"
#include "SDL_drawline.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_draw.h"
#include "SDL_drawpoint.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "../SDL_sysrender.h"
#include "SDL_render_sw_c.h"

View File

@@ -30,7 +30,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#if defined(__WIN32__) || defined(__GDK__)
#include "../../core/windows/SDL_windows.h"

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !defined(SDL_RENDER_DISABLED)
#include "SDL_triangle.h"