Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS
This commit is contained in:
1 parent
6f91c36d28
commit
b716db204d
8 files changed
+18
-13
No files matched your search
@@ -171,7 +171,7 @@ int SDL_InitSubSystem(Uint32 flags)
|
|||||||
/* Clear the error message */
|
/* Clear the error message */
|
||||||
SDL_ClearError();
|
SDL_ClearError();
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
SDL_DBus_Init();
|
SDL_DBus_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ void SDL_Quit(void)
|
|||||||
SDL_ClearHints();
|
SDL_ClearHints();
|
||||||
SDL_AssertionsQuit();
|
SDL_AssertionsQuit();
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
SDL_DBus_Quit();
|
SDL_DBus_Quit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "SDL_sandbox.h"
|
#include "SDL_sandbox.h"
|
||||||
#include "../../stdlib/SDL_vacopy.h"
|
#include "../../stdlib/SDL_vacopy.h"
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
/* we never link directly to libdbus. */
|
/* we never link directly to libdbus. */
|
||||||
static const char *dbus_library = "libdbus-1.so.3";
|
static const char *dbus_library = "libdbus-1.so.3";
|
||||||
static void *dbus_handle = NULL;
|
static void *dbus_handle = NULL;
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
#ifdef HAVE_IBUS_IBUS_H
|
#ifdef HAVE_IBUS_IBUS_H
|
||||||
#include "SDL_ibus.h"
|
#include "SDL_ibus.h"
|
||||||
#include "SDL_dbus.h"
|
#include "SDL_dbus.h"
|
||||||
|
|
||||||
|
#ifdef SDL_USE_LIBDBUS
|
||||||
|
|
||||||
#include "../../video/SDL_sysvideo.h"
|
#include "../../video/SDL_sysvideo.h"
|
||||||
#include "../../events/SDL_keyboard_c.h"
|
#include "../../events/SDL_keyboard_c.h"
|
||||||
|
|
||||||
@@ -748,4 +751,6 @@ void SDL_IBus_PumpEvents(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // SDL_USE_LIBDBUS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#include "SDL_dbus.h"
|
#include "SDL_dbus.h"
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
|
|
||||||
/* d-bus queries to org.freedesktop.RealtimeKit1. */
|
/* d-bus queries to org.freedesktop.RealtimeKit1. */
|
||||||
#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1"
|
#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1"
|
||||||
@@ -258,7 +258,7 @@ int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
/* Note that this fails you most likely:
|
/* Note that this fails you most likely:
|
||||||
* Have your process's scheduler incorrectly configured.
|
* Have your process's scheduler incorrectly configured.
|
||||||
See the requirements at:
|
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:
|
/* Note that this fails you most likely:
|
||||||
* Have your process's scheduler incorrectly configured.
|
* Have your process's scheduler incorrectly configured.
|
||||||
See the requirements at:
|
See the requirements at:
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* d-bus queries to org.freedesktop.UPower. */
|
/* 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_NODE "org.freedesktop.UPower"
|
||||||
#define UPOWER_DBUS_PATH "/org/freedesktop/UPower"
|
#define UPOWER_DBUS_PATH "/org/freedesktop/UPower"
|
||||||
#define UPOWER_DBUS_INTERFACE "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;
|
SDL_bool retval = SDL_FALSE;
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
SDL_DBusContext *dbus = SDL_DBus_GetContext();
|
SDL_DBusContext *dbus = SDL_DBus_GetContext();
|
||||||
char **paths = NULL;
|
char **paths = NULL;
|
||||||
int i, numpaths = 0;
|
int i, numpaths = 0;
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorDa
|
|||||||
if ((xcursor_size = SDL_getenv("XCURSOR_SIZE"))) {
|
if ((xcursor_size = SDL_getenv("XCURSOR_SIZE"))) {
|
||||||
size = SDL_atoi(xcursor_size);
|
size = SDL_atoi(xcursor_size);
|
||||||
}
|
}
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
wayland_dbus_read_cursor_size(&size);
|
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;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
xcursor_theme = SDL_getenv("XCURSOR_THEME");
|
xcursor_theme = SDL_getenv("XCURSOR_THEME");
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
if (xcursor_theme == NULL) {
|
if (xcursor_theme == NULL) {
|
||||||
/* Allocates the string with SDL_strdup, which must be freed. */
|
/* Allocates the string with SDL_strdup, which must be freed. */
|
||||||
free_theme_str = wayland_dbus_read_cursor_theme(&xcursor_theme);
|
free_theme_str = wayland_dbus_read_cursor_theme(&xcursor_theme);
|
||||||
|
|||||||
@@ -2167,7 +2167,7 @@ int Wayland_SuspendScreenSaver(_THIS)
|
|||||||
{
|
{
|
||||||
SDL_VideoData *data = _this->driverdata;
|
SDL_VideoData *data = _this->driverdata;
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
|
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1729,7 +1729,7 @@ void X11_PumpEvents(_THIS)
|
|||||||
if (!data->screensaver_activity || now >= (data->screensaver_activity + 30000)) {
|
if (!data->screensaver_activity || now >= (data->screensaver_activity + 30000)) {
|
||||||
X11_XResetScreenSaver(data->display);
|
X11_XResetScreenSaver(data->display);
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
SDL_DBus_ScreensaverTickle();
|
SDL_DBus_ScreensaverTickle();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1775,7 +1775,7 @@ int X11_SuspendScreenSaver(_THIS)
|
|||||||
int major_version, minor_version;
|
int major_version, minor_version;
|
||||||
#endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
|
#endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
|
||||||
|
|
||||||
#if SDL_USE_LIBDBUS
|
#ifdef SDL_USE_LIBDBUS
|
||||||
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
|
if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user