diff --git a/src/string_util.cc b/src/string_util.cc index 6dc7f5ec..7af99444 100644 --- a/src/string_util.cc +++ b/src/string_util.cc @@ -6,6 +6,8 @@ #include #include +#include + #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 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(ret) + 1; auto buff_ptr = std::unique_ptr(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()); }