Commit 29169ddf authored by Michael Lee's avatar Michael Lee Committed by facebook-github-bot-4

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
parent 3fdfc1f5
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#endif #endif
#include <array> #include <array>
#include <cinttypes>
#include <deque> #include <deque>
#include <map> #include <map>
#include <unordered_map> #include <unordered_map>
...@@ -501,6 +502,9 @@ class FormatValue< ...@@ -501,6 +502,9 @@ class FormatValue<
valBufBegin, valBufBegin,
(int)((valBuf + valBufSize) - valBufBegin) (int)((valBuf + valBufSize) - valBufBegin)
); );
#elif defined(__ANDROID__)
int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
"%" PRIuMAX, static_cast<uintmax_t>(uval));
#else #else
int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin, int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
"%'ju", static_cast<uintmax_t>(uval)); "%'ju", static_cast<uintmax_t>(uval));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment