From 29169ddf26a342fd9a77c1f548e442c59b7a2569 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Tue, 12 Jan 2016 16:22:02 -0800 Subject: [PATCH] Use PRIuMAX for Android format strings. Summary: Provide a more Android compatible version of sformat. Reviewed By: sgolemon Differential Revision: D2825105 fb-gh-sync-id: ce328d17b9f8008d81bc7dd5bf7f0905e560dfe1 --- folly/Format-inl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/Format-inl.h b/folly/Format-inl.h index 64591d6a..ea9ce875 100644 --- a/folly/Format-inl.h +++ b/folly/Format-inl.h @@ -19,6 +19,7 @@ #endif #include +#include #include #include #include @@ -501,6 +502,9 @@ class FormatValue< valBufBegin, (int)((valBuf + valBufSize) - valBufBegin) ); +#elif defined(__ANDROID__) + int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin, + "%" PRIuMAX, static_cast(uval)); #else int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin, "%'ju", static_cast(uval)); -- 2.34.1