cmake: fix uses of undefined macro identifiers (-Wundef)
This commit is contained in:
1 parent
cc7c0a2dab
commit
d81d986858
430 files changed
+1289
-1260
No files matched your search
@@ -25,7 +25,7 @@
|
||||
#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
|
||||
|
||||
/* Global for SDL_windowshaptic.c */
|
||||
#if (defined(SDL_HAPTIC_DINPUT) && SDL_HAPTIC_DINPUT) || (defined(SDL_HAPTIC_XINPUT) && SDL_HAPTIC_XINPUT)
|
||||
#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT)
|
||||
SDL_Haptic *SDL_haptics = NULL;
|
||||
#else
|
||||
static SDL_Haptic *SDL_haptics = NULL;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define MAX_HAPTICS 32 /* It's doubtful someone has more then 32 evdev */
|
||||
|
||||
static int MaybeAddDevice(const char *path);
|
||||
#if SDL_USE_LIBUDEV
|
||||
#ifdef SDL_USE_LIBUDEV
|
||||
static int MaybeRemoveDevice(const char *path);
|
||||
static void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
|
||||
#endif /* SDL_USE_LIBUDEV */
|
||||
@@ -164,7 +164,7 @@ int SDL_SYS_HapticInit(void)
|
||||
MaybeAddDevice(path);
|
||||
}
|
||||
|
||||
#if SDL_USE_LIBUDEV
|
||||
#ifdef SDL_USE_LIBUDEV
|
||||
if (SDL_UDEV_Init() < 0) {
|
||||
return SDL_SetError("Could not initialize UDEV");
|
||||
}
|
||||
@@ -203,7 +203,7 @@ static SDL_hapticlist_item *HapticByDevIndex(int device_index)
|
||||
return item;
|
||||
}
|
||||
|
||||
#if SDL_USE_LIBUDEV
|
||||
#ifdef SDL_USE_LIBUDEV
|
||||
static void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath)
|
||||
{
|
||||
if (!devpath || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) {
|
||||
@@ -293,7 +293,7 @@ static int MaybeAddDevice(const char *path)
|
||||
return numhaptics;
|
||||
}
|
||||
|
||||
#if SDL_USE_LIBUDEV
|
||||
#ifdef SDL_USE_LIBUDEV
|
||||
static int MaybeRemoveDevice(const char *path)
|
||||
{
|
||||
SDL_hapticlist_item *item;
|
||||
@@ -608,7 +608,7 @@ void SDL_SYS_HapticQuit(void)
|
||||
SDL_free(item);
|
||||
}
|
||||
|
||||
#if SDL_USE_LIBUDEV
|
||||
#ifdef SDL_USE_LIBUDEV
|
||||
SDL_UDEV_DelCallback(haptic_udev_callback);
|
||||
SDL_UDEV_Quit();
|
||||
#endif /* SDL_USE_LIBUDEV */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "SDL_haptic.h"
|
||||
#include "../SDL_syshaptic.h"
|
||||
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
|
||||
#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT)
|
||||
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_mutex.h"
|
||||
@@ -160,7 +160,7 @@ int SDL_SYS_HapticOpen(SDL_Haptic *haptic)
|
||||
*/
|
||||
int SDL_SYS_HapticMouse(void)
|
||||
{
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
SDL_hapticlist_item *item;
|
||||
int index = 0;
|
||||
|
||||
@@ -183,12 +183,12 @@ int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
|
||||
if (joystick->driver != &SDL_WINDOWS_JoystickDriver) {
|
||||
return 0;
|
||||
}
|
||||
#if SDL_HAPTIC_XINPUT
|
||||
#ifdef SDL_HAPTIC_XINPUT
|
||||
if (joystick->hwdata->bXInputHaptic) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ extern "C" {
|
||||
*/
|
||||
struct haptic_hwdata
|
||||
{
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
LPDIRECTINPUTDEVICE8 device;
|
||||
#endif
|
||||
DWORD axes[3]; /* Axes to use. */
|
||||
@@ -54,14 +54,14 @@ struct haptic_hwdata
|
||||
/*
|
||||
* Haptic system effect data.
|
||||
*/
|
||||
#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
|
||||
#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT)
|
||||
struct haptic_hweffect
|
||||
{
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
DIEFFECT effect;
|
||||
LPDIRECTINPUTEFFECT ref;
|
||||
#endif
|
||||
#if SDL_HAPTIC_XINPUT
|
||||
#ifdef SDL_HAPTIC_XINPUT
|
||||
XINPUT_VIBRATION vibration;
|
||||
#endif
|
||||
};
|
||||
@@ -74,7 +74,7 @@ typedef struct SDL_hapticlist_item
|
||||
{
|
||||
char *name;
|
||||
SDL_Haptic *haptic;
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
#ifdef SDL_HAPTIC_DINPUT
|
||||
DIDEVICEINSTANCE instance;
|
||||
DIDEVCAPS capabilities;
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "SDL_haptic.h"
|
||||
#include "../SDL_syshaptic.h"
|
||||
|
||||
#if SDL_HAPTIC_XINPUT
|
||||
#ifdef SDL_HAPTIC_XINPUT
|
||||
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_timer.h"
|
||||
|
||||
Reference in new issue
Block a user