Fixed warnings building with mingw64
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Mar 2020 21:24:06 -0700
changeset 13600e42055c6d8b5
parent 13599 5cfc87d218e1
child 13601 3d3649fe086e
Fixed warnings building with mingw64
src/events/SDL_events.c
     1.1 --- a/src/events/SDL_events.c	Sun Mar 08 21:02:40 2020 -0700
     1.2 +++ b/src/events/SDL_events.c	Sun Mar 08 21:24:06 2020 -0700
     1.3 @@ -33,6 +33,13 @@
     1.4  #include "../video/SDL_sysvideo.h"
     1.5  #include "SDL_syswm.h"
     1.6  
     1.7 +#undef SDL_PRIs64
     1.8 +#ifdef __WIN32__
     1.9 +#define SDL_PRIs64	"I64d"
    1.10 +#else
    1.11 +#define SDL_PRIs64	"lld"
    1.12 +#endif
    1.13 +
    1.14  /* An arbitrary limit so we don't have unbounded growth */
    1.15  #define SDL_MAX_QUEUED_EVENTS   65535
    1.16  
    1.17 @@ -278,7 +285,7 @@
    1.18          #undef PRINT_CONTROLLERDEV_EVENT
    1.19  
    1.20          #define PRINT_FINGER_EVENT(event) \
    1.21 -            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld fingerid=%lld x=%f y=%f dx=%f dy=%f pressure=%f)", \
    1.22 +            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" fingerid=%"SDL_PRIs64" x=%f y=%f dx=%f dy=%f pressure=%f)", \
    1.23                  (uint) event->tfinger.timestamp, (long long)event->tfinger.touchId, \
    1.24                  (long long)event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, \
    1.25                  event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure)
    1.26 @@ -288,7 +295,7 @@
    1.27          #undef PRINT_FINGER_EVENT
    1.28  
    1.29          #define PRINT_DOLLAR_EVENT(event) \
    1.30 -            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld gestureid=%lld numfingers=%u error=%f x=%f y=%f)", \
    1.31 +            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" gestureid=%"SDL_PRIs64" numfingers=%u error=%f x=%f y=%f)", \
    1.32                  (uint) event->dgesture.timestamp, (long long)event->dgesture.touchId, \
    1.33                  (long long)event->dgesture.gestureId, (uint) event->dgesture.numFingers, \
    1.34                  event->dgesture.error, event->dgesture.x, event->dgesture.y);
    1.35 @@ -297,7 +304,7 @@
    1.36          #undef PRINT_DOLLAR_EVENT
    1.37  
    1.38          SDL_EVENT_CASE(SDL_MULTIGESTURE)
    1.39 -            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%lld dtheta=%f ddist=%f x=%f y=%f numfingers=%u)",
    1.40 +            SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" dtheta=%f ddist=%f x=%f y=%f numfingers=%u)",
    1.41                  (uint) event->mgesture.timestamp, (long long)event->mgesture.touchId,
    1.42                  event->mgesture.dTheta, event->mgesture.dDist,
    1.43                  event->mgesture.x, event->mgesture.y, (uint) event->mgesture.numFingers);