Skip to content

Commit

Permalink
hidapi/SDL_hidapijoystick.c: fix build in C90 mode:
Browse files Browse the repository at this point in the history
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_InitializeDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: (Each undeclared identifier is reported only once
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: for each function it appears in.)
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_UpdateDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:339: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:341: error: ISO C90 forbids mixed declarations and code
  • Loading branch information
sezero committed Sep 7, 2018
1 parent afc1738 commit 33381d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/joystick/hidapi/SDL_hidapijoystick.c
Expand Up @@ -278,7 +278,7 @@ HIDAPI_InitializeDiscovery()
if (SDL_HIDAPI_discovery.m_pUdevMonitor) {
udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor);
SDL_HIDAPI_discovery.m_nUdevFd = udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor);
SDL_HIDAPI_discovery.m_bCanGetNotifications = true;
SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_TRUE;
}
}

Expand Down Expand Up @@ -329,16 +329,17 @@ HIDAPI_UpdateDiscovery()
*/
for (;;) {
struct pollfd PollUdev;
struct udev_device *pUdevDevice;

PollUdev.fd = SDL_HIDAPI_discovery.m_nUdevFd;
PollUdev.events = POLLIN;
if (poll(&PollUdev, 1, 0) != 1) {
break;
}

SDL_HIDAPI_discovery.m_bHaveDevicesChanged = true;
SDL_HIDAPI_discovery.m_bHaveDevicesChanged = SDL_TRUE;

struct udev_device *pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor);
pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor);
if (pUdevDevice) {
udev_device_unref(pUdevDevice);
}
Expand Down

0 comments on commit 33381d3

Please sign in to comment.