diff options
author | Anton Danielsson <anton.danielsson@dirac.se> | 2015-10-05 10:07:29 +0200 |
---|---|---|
committer | Anton Danielsson <anton.danielsson@dirac.se> | 2015-10-09 08:47:34 +0200 |
commit | c1e03a4b58b79bcffa880e897588272d3f6ac05a (patch) | |
tree | d0a80849f855363fdf215704bcd442a191f5baba | |
parent | aecd746691918e5f6333e94dff57015d2d238525 (diff) | |
download | google-benchmark-c1e03a4b58b79bcffa880e897588272d3f6ac05a.tar.gz |
Changed "std::vsnprintf" to "vsnprintf" to be able to build with the android-ndk.
-rw-r--r-- | src/string_util.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/string_util.cc b/src/string_util.cc index 6dc7f5e..7af9944 100644 --- a/src/string_util.cc +++ b/src/string_util.cc @@ -6,6 +6,8 @@ #include <memory> #include <sstream> +#include <stdio.h> + #include "arraysize.h" namespace benchmark { @@ -127,7 +129,7 @@ std::string StringPrintFImp(const char *msg, va_list args) // allocation guess what the size might be std::array<char, 256> local_buff; std::size_t size = local_buff.size(); - auto ret = std::vsnprintf(local_buff.data(), size, msg, args_cp); + auto ret = vsnprintf(local_buff.data(), size, msg, args_cp); va_end(args_cp); @@ -141,7 +143,7 @@ std::string StringPrintFImp(const char *msg, va_list args) // add 1 to size to account for null-byte in size cast to prevent overflow size = static_cast<std::size_t>(ret) + 1; auto buff_ptr = std::unique_ptr<char[]>(new char[size]); - ret = std::vsnprintf(buff_ptr.get(), size, msg, args); + ret = vsnprintf(buff_ptr.get(), size, msg, args); return std::string(buff_ptr.get()); } |