Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS

This commit is contained in:
Anonymous Maarten
2023-03-27 19:22:24 +02:00
parent 6f91c36d28
commit b716db204d
8 changed files with 18 additions and 13 deletions

View File

@@ -171,7 +171,7 @@ int SDL_InitSubSystem(Uint32 flags)
/* Clear the error message */
SDL_ClearError();
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
SDL_DBus_Init();
#endif
@@ -496,7 +496,7 @@ void SDL_Quit(void)
SDL_ClearHints();
SDL_AssertionsQuit();
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
SDL_DBus_Quit();
#endif

View File

@@ -23,7 +23,7 @@
#include "SDL_sandbox.h"
#include "../../stdlib/SDL_vacopy.h"
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
/* we never link directly to libdbus. */
static const char *dbus_library = "libdbus-1.so.3";
static void *dbus_handle = NULL;

View File

@@ -23,6 +23,9 @@
#ifdef HAVE_IBUS_IBUS_H
#include "SDL_ibus.h"
#include "SDL_dbus.h"
#ifdef SDL_USE_LIBDBUS
#include "../../video/SDL_sysvideo.h"
#include "../../events/SDL_keyboard_c.h"
@@ -748,4 +751,6 @@ void SDL_IBus_PumpEvents(void)
}
}
#endif // SDL_USE_LIBDBUS
#endif

View File

@@ -40,7 +40,7 @@
#include "SDL_dbus.h"
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
/* d-bus queries to org.freedesktop.RealtimeKit1. */
#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1"
@@ -258,7 +258,7 @@ int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
return 0;
}
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
/* Note that this fails you most likely:
* Have your process's scheduler incorrectly configured.
See the requirements at:
@@ -314,7 +314,7 @@ int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int sc
}
}
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
/* Note that this fails you most likely:
* Have your process's scheduler incorrectly configured.
See the requirements at:

View File

@@ -525,7 +525,7 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second
}
/* d-bus queries to org.freedesktop.UPower. */
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
#define UPOWER_DBUS_NODE "org.freedesktop.UPower"
#define UPOWER_DBUS_PATH "/org/freedesktop/UPower"
#define UPOWER_DBUS_INTERFACE "org.freedesktop.UPower"
@@ -616,7 +616,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second
{
SDL_bool retval = SDL_FALSE;
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
SDL_DBusContext *dbus = SDL_DBus_GetContext();
char **paths = NULL;
int i, numpaths = 0;

View File

@@ -177,7 +177,7 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorDa
if ((xcursor_size = SDL_getenv("XCURSOR_SIZE"))) {
size = SDL_atoi(xcursor_size);
}
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
if (size <= 0) {
wayland_dbus_read_cursor_size(&size);
}
@@ -213,7 +213,7 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorDa
return SDL_FALSE;
}
xcursor_theme = SDL_getenv("XCURSOR_THEME");
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
if (xcursor_theme == NULL) {
/* Allocates the string with SDL_strdup, which must be freed. */
free_theme_str = wayland_dbus_read_cursor_theme(&xcursor_theme);

View File

@@ -2167,7 +2167,7 @@ int Wayland_SuspendScreenSaver(_THIS)
{
SDL_VideoData *data = _this->driverdata;
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
return 0;
}

View File

@@ -1729,7 +1729,7 @@ void X11_PumpEvents(_THIS)
if (!data->screensaver_activity || now >= (data->screensaver_activity + 30000)) {
X11_XResetScreenSaver(data->display);
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
SDL_DBus_ScreensaverTickle();
#endif
@@ -1775,7 +1775,7 @@ int X11_SuspendScreenSaver(_THIS)
int major_version, minor_version;
#endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
#if SDL_USE_LIBDBUS
#ifdef SDL_USE_LIBDBUS
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
return 0;
}