From 757231cc6e777b8f4717d1467ef7efa01c7fde15 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Wed, 3 Jan 2018 17:41:16 +0000 Subject: Add the fmt library (#4065) * Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style. --- src/UI/CMakeLists.txt | 1 + src/UI/Window.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/UI') diff --git a/src/UI/CMakeLists.txt b/src/UI/CMakeLists.txt index 6477882b3..32a5af4a5 100644 --- a/src/UI/CMakeLists.txt +++ b/src/UI/CMakeLists.txt @@ -38,4 +38,5 @@ SET (HDRS if(NOT MSVC) add_library(UI ${SRCS} ${HDRS}) + target_link_libraries(UI fmt::fmt) endif() diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index cf02c0f00..55df04798 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -674,7 +674,7 @@ int cWindow::DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int { if (a_LimitItems && (static_cast(a_Item.m_ItemCount) < a_SlotNums.size())) { - LOGWARNING("%s: Distributing less items (%d) than slots (" SIZE_T_FMT ")", __FUNCTION__, static_cast(a_Item.m_ItemCount), a_SlotNums.size()); + LOGWARNING("%s: Distributing less items (%d) than slots (%zu)", __FUNCTION__, static_cast(a_Item.m_ItemCount), a_SlotNums.size()); // This doesn't seem to happen with the 1.5.1 client, so we don't worry about it for now return 0; } -- cgit v1.2.3