Removed a bunch of unnecessary #ifdefs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
diff --git a/src/power/SDL_syspower.h b/src/power/SDL_syspower.h
index 4dc0602..534eea7 100644
--- a/src/power/SDL_syspower.h
+++ b/src/power/SDL_syspower.h
@@ -27,41 +27,19 @@
#include "SDL_power.h"
-#ifndef SDL_POWER_DISABLED
-#ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */
+/* Not all of these are available in a given build. Use #ifdefs, etc. */
SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_WINDOWS /* handles Win32, Win64, PocketPC. */
SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_UIKIT /* handles iPhone/iPad/etc */
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_MACOSX /* handles Mac OS X, Darwin. */
SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_HAIKU /* with BeOS euc.jp apm driver. Does this work on Haiku? */
SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_ANDROID /* handles Android. */
SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_PSP /* handles PSP. */
SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_WINRT /* handles WinRT */
SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *);
-#endif
-#ifdef SDL_POWER_EMSCRIPTEN /* handles Emscripten */
SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *);
-#endif
-
-#ifdef SDL_POWER_HARDWIRED
SDL_bool SDL_GetPowerInfo_Hardwired(SDL_PowerState *, int *, int *);
-#endif
-#endif
#endif /* SDL_syspower_h_ */
diff --git a/src/power/haiku/SDL_syspower.c b/src/power/haiku/SDL_syspower.c
index 8e90098..6a7eae4 100644
--- a/src/power/haiku/SDL_syspower.c
+++ b/src/power/haiku/SDL_syspower.c
@@ -20,7 +20,9 @@
*/
#include "../../SDL_internal.h"
+/* uses BeOS euc.jp apm driver. */
/* !!! FIXME: does this thing even work on Haiku? */
+
#ifndef SDL_POWER_DISABLED
#if SDL_POWER_HAIKU
diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h
index 13fae80..4c1ac1b 100644
--- a/src/render/SDL_sysrender.h
+++ b/src/render/SDL_sysrender.h
@@ -173,33 +173,16 @@ struct SDL_RenderDriver
SDL_RendererInfo info;
};
-#if !SDL_RENDER_DISABLED
-
-#if SDL_VIDEO_RENDER_D3D
+/* Not all of these are available in a given build. Use #ifdefs, etc. */
extern SDL_RenderDriver D3D_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_D3D11
extern SDL_RenderDriver D3D11_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL
extern SDL_RenderDriver GL_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES2
extern SDL_RenderDriver GLES2_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES
extern SDL_RenderDriver GLES_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_DIRECTFB
extern SDL_RenderDriver DirectFB_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_PSP
extern SDL_RenderDriver PSP_RenderDriver;
-#endif
extern SDL_RenderDriver SW_RenderDriver;
-#endif /* !SDL_RENDER_DISABLED */
-
#endif /* SDL_sysrender_h_ */
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h
index b440858..1827019 100644
--- a/src/video/SDL_sysvideo.h
+++ b/src/video/SDL_sysvideo.h
@@ -372,57 +372,24 @@ typedef struct VideoBootStrap
SDL_VideoDevice *(*create) (int devindex);
} VideoBootStrap;
-#if SDL_VIDEO_DRIVER_COCOA
+/* Not all of these are available in a given build. Use #ifdefs, etc. */
extern VideoBootStrap COCOA_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_X11
extern VideoBootStrap X11_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_MIR
extern VideoBootStrap MIR_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DIRECTFB
extern VideoBootStrap DirectFB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WINDOWS
extern VideoBootStrap WINDOWS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WINRT
extern VideoBootStrap WINRT_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_HAIKU
extern VideoBootStrap HAIKU_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PANDORA
extern VideoBootStrap PND_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_UIKIT
extern VideoBootStrap UIKIT_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_ANDROID
extern VideoBootStrap Android_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PSP
extern VideoBootStrap PSP_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_RPI
extern VideoBootStrap RPI_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DUMMY
extern VideoBootStrap DUMMY_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WAYLAND
extern VideoBootStrap Wayland_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_NACL
extern VideoBootStrap NACL_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_VIVANTE
extern VideoBootStrap VIVANTE_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_EMSCRIPTEN
extern VideoBootStrap Emscripten_bootstrap;
-#endif
extern SDL_VideoDevice *SDL_GetVideoDevice(void);
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);