From 726655250558546fb797267c6f507d48880f6113 Mon Sep 17 00:00:00 2001 From: Buginator Date: Sun, 31 Jan 2010 19:11:59 +0000 Subject: [PATCH] Fix for 64bit compilers. Reported by atis_home (thanks!) closes ticket:1523 git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9594 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/framework/types.h | 3 +++ lib/netplay/netlog.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/framework/types.h b/lib/framework/types.h index c35aa92c2..0455dd29e 100644 --- a/lib/framework/types.h +++ b/lib/framework/types.h @@ -43,6 +43,9 @@ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) +#ifdef WZ_CC_MSVC +#define PRIu64 "I64u" +#endif #endif // WZ_C99 /* Basic numeric types */ diff --git a/lib/netplay/netlog.c b/lib/netplay/netlog.c index 662d94869..8f5f95f48 100644 --- a/lib/netplay/netlog.c +++ b/lib/netplay/netlog.c @@ -165,17 +165,17 @@ BOOL NETstopLogging(void) snprintf(buf, sizeof(buf), "\n-Sync statistics -\n"); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); PHYSFS_write(pFileHandle, dash_line, strlen(dash_line), 1); - snprintf(buf, sizeof(buf), "sent/unsent DroidCheck %llu / %llu\n", sync_counter.sentDroidCheck, sync_counter.unsentDroidCheck); + snprintf(buf, sizeof(buf), "sent/unsent DroidCheck %"PRIu64" / %"PRIu64"\n", sync_counter.sentDroidCheck, sync_counter.unsentDroidCheck); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); - snprintf(buf, sizeof(buf), "sent/unsent StructureCheck %llu / %llu\n", sync_counter.sentStructureCheck, sync_counter.unsentStructureCheck); + snprintf(buf, sizeof(buf), "sent/unsent StructureCheck %"PRIu64" / %"PRIu64"\n", sync_counter.sentStructureCheck, sync_counter.unsentStructureCheck); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); - snprintf(buf, sizeof(buf), "sent/unsent PowerCheck %llu / %llu\n", sync_counter.sentPowerCheck, sync_counter.unsentPowerCheck); + snprintf(buf, sizeof(buf), "sent/unsent PowerCheck %"PRIu64" / %"PRIu64"\n", sync_counter.sentPowerCheck, sync_counter.unsentPowerCheck); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); - snprintf(buf, sizeof(buf), "sent/unsent ScoreCheck %llu / %llu\n", sync_counter.sentScoreCheck, sync_counter.unsentScoreCheck); + snprintf(buf, sizeof(buf), "sent/unsent ScoreCheck %"PRIu64" / %"PRIu64"\n", sync_counter.sentScoreCheck, sync_counter.unsentScoreCheck); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); - snprintf(buf, sizeof(buf), "sent/unsent Ping %llu / %llu\n", sync_counter.sentPing, sync_counter.unsentPing); + snprintf(buf, sizeof(buf), "sent/unsent Ping %"PRIu64" / %"PRIu64"\n", sync_counter.sentPing, sync_counter.unsentPing); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); - snprintf(buf, sizeof(buf), "sent/unsent isMPDirtyBit %llu / %llu\n", sync_counter.sentisMPDirtyBit, sync_counter.unsentisMPDirtyBit); + snprintf(buf, sizeof(buf), "sent/unsent isMPDirtyBit %"PRIu64" / %"PRIu64"\n", sync_counter.sentisMPDirtyBit, sync_counter.unsentisMPDirtyBit); PHYSFS_write(pFileHandle, buf, strlen(buf), 1); PHYSFS_write(pFileHandle, dash_line, strlen(dash_line), 1);