projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fdfc1f
)
Use PRIuMAX for Android format strings.
author
Michael Lee
<mzlee@fb.com>
Wed, 13 Jan 2016 00:22:02 +0000
(16:22 -0800)
committer
facebook-github-bot-4
<folly-bot@fb.com>
Wed, 13 Jan 2016 01:20:24 +0000
(17:20 -0800)
Summary: Provide a more Android compatible version of sformat.
Reviewed By: sgolemon
Differential Revision:
D2825105
fb-gh-sync-id:
ce328d17b9f8008d81bc7dd5bf7f0905e560dfe1
folly/Format-inl.h
patch
|
blob
|
history
diff --git
a/folly/Format-inl.h
b/folly/Format-inl.h
index 64591d6af702e8dfadafffeb2737b87def6a5132..ea9ce8752f06b7d8938ddd156a9e5310571fa386 100644
(file)
--- a/
folly/Format-inl.h
+++ b/
folly/Format-inl.h
@@
-19,6
+19,7
@@
#endif
#include <array>
+#include <cinttypes>
#include <deque>
#include <map>
#include <unordered_map>
@@
-501,6
+502,9
@@
class FormatValue<
valBufBegin,
(int)((valBuf + valBufSize) - valBufBegin)
);
+#elif defined(__ANDROID__)
+ int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
+ "%" PRIuMAX, static_cast<uintmax_t>(uval));
#else
int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
"%'ju", static_cast<uintmax_t>(uval));