Skip to content

Commit

Permalink
Fixed warnings building with mingw64
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 9, 2020
1 parent 611403d commit 1f4965c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/events/SDL_events.c
Expand Up @@ -33,6 +33,13 @@
#include "../video/SDL_sysvideo.h"
#include "SDL_syswm.h"

#undef SDL_PRIs64
#ifdef __WIN32__
#define SDL_PRIs64 "I64d"
#else
#define SDL_PRIs64 "lld"
#endif

/* An arbitrary limit so we don't have unbounded growth */
#define SDL_MAX_QUEUED_EVENTS 65535

Expand Down Expand Up @@ -278,7 +285,7 @@ SDL_LogEvent(const SDL_Event *event)
#undef PRINT_CONTROLLERDEV_EVENT

#define PRINT_FINGER_EVENT(event) \
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld fingerid=%lld x=%f y=%f dx=%f dy=%f pressure=%f)", \
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" fingerid=%"SDL_PRIs64" x=%f y=%f dx=%f dy=%f pressure=%f)", \
(uint) event->tfinger.timestamp, (long long)event->tfinger.touchId, \
(long long)event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, \
event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure)
Expand All @@ -288,7 +295,7 @@ SDL_LogEvent(const SDL_Event *event)
#undef PRINT_FINGER_EVENT

#define PRINT_DOLLAR_EVENT(event) \
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld gestureid=%lld numfingers=%u error=%f x=%f y=%f)", \
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" gestureid=%"SDL_PRIs64" numfingers=%u error=%f x=%f y=%f)", \
(uint) event->dgesture.timestamp, (long long)event->dgesture.touchId, \
(long long)event->dgesture.gestureId, (uint) event->dgesture.numFingers, \
event->dgesture.error, event->dgesture.x, event->dgesture.y);
Expand All @@ -297,7 +304,7 @@ SDL_LogEvent(const SDL_Event *event)
#undef PRINT_DOLLAR_EVENT

SDL_EVENT_CASE(SDL_MULTIGESTURE)
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld dtheta=%f ddist=%f x=%f y=%f numfingers=%u)",
SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" dtheta=%f ddist=%f x=%f y=%f numfingers=%u)",
(uint) event->mgesture.timestamp, (long long)event->mgesture.touchId,
event->mgesture.dTheta, event->mgesture.dDist,
event->mgesture.x, event->mgesture.y, (uint) event->mgesture.numFingers);
Expand Down

0 comments on commit 1f4965c

Please sign in to comment.