--- a/timertest.c +++ b/timertest.c @@ -38,6 +38,15 @@ #include #include "dahdi_tools_version.h" +#ifndef TIME_T_INT_FMT +#ifdef __USE_TIME_BITS64 +#include +#define TIME_T_INT_FMT PRId64 +#else +#define TIME_T_INT_FMT "ld" +#endif +#endif + int main(int argc, char *argv[]) { int fd; @@ -72,7 +81,7 @@ int main(int argc, char *argv[]) exit(1); } gettimeofday(&now, NULL); - printf("Timer Expired (%ld ms)!\n", (now.tv_sec - orig.tv_sec) * 1000 + (now.tv_usec - orig.tv_usec) / 1000); + printf("Timer Expired (%" TIME_T_INT_FMT " ms)!\n", (now.tv_sec - orig.tv_sec) * 1000 + (now.tv_usec - orig.tv_usec) / 1000); } exit(0); }