From 2258f21c2d04e7ed0ccc7ff94300724225de4b6f Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Fri, 26 Dec 2008 23:21:20 +0000 Subject: [PATCH] Include inttypes.h, if we have it, and use the standard format macro PRIi64 if it is defined. --- stepmania/configure.ac | 1 + stepmania/src/RageSoundPosMap.cpp | 2 ++ stepmania/src/global.h | 3 +++ 3 files changed, 6 insertions(+) diff --git a/stepmania/configure.ac b/stepmania/configure.ac index 7fcc1982dd..96a57b0a8e 100644 --- a/stepmania/configure.ac +++ b/stepmania/configure.ac @@ -222,6 +222,7 @@ AC_CHECK_LIB( pthread, pthread_cond_timedwait, AC_DEFINE([HAVE_PTHREAD_COND_TIME # Always: AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extensions]) +AC_DEFINE(__STDC_FORMAT_MACROS, 1, [Use PRId64 and similar]) AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse ) AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" ) diff --git a/stepmania/src/RageSoundPosMap.cpp b/stepmania/src/RageSoundPosMap.cpp index 592117d0a7..d073666fe8 100644 --- a/stepmania/src/RageSoundPosMap.cpp +++ b/stepmania/src/RageSoundPosMap.cpp @@ -178,6 +178,8 @@ int64_t pos_map_queue::Search( int64_t iSourceFrame, bool *bApproximate ) const */ #if defined(WIN32) #define LI "%I64i" +#elif defined(PRIi64) +#define LI "%" PRIi64 #else #define LI "%lli" #endif diff --git a/stepmania/src/global.h b/stepmania/src/global.h index 0767d0cfe8..39df57a997 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -55,6 +55,9 @@ #if !defined(MISSING_STDINT_H) /* need to define int64_t if so */ #include #endif +#if defined(HAVE_INTTYPES_H) +#include +#endif /* Branch optimizations: */ #if defined(__GNUC__)