moved std::to_string to util.h from android

This commit is contained in:
orignal 2016-06-14 11:55:44 -04:00
parent 07cc547bab
commit a5be4c9d0e
7 changed files with 19 additions and 54 deletions

View file

@ -10,13 +10,6 @@
#include <algorithm>
#include <ctime>
#ifdef ANDROID
# include "to_string.h"
# include <errno.h>
#else
# define to_string(x) std::to_string(x)
#endif
namespace i2p {
namespace http {
const std::vector<std::string> HTTP_METHODS = {
@ -187,11 +180,7 @@ namespace http {
out += user + "@";
}
if (port) {
#ifndef ANDROID
out += host + ":" + to_string(port);
#else
out += host + ":" + tostr::to_string(port);
#endif
out += host + ":" + std::to_string(port);
} else {
out += host;
}
@ -349,11 +338,7 @@ namespace http {
if (status == "OK" && code != 200)
status = HTTPCodeToStatus(code); // update
if (body.length() > 0 && headers.count("Content-Length") == 0)
#ifndef ANDROID
add_header("Content-Length", to_string(body.length()).c_str());
#else
add_header("Content-Length", tostr::to_string(body.length()).c_str());
#endif
add_header("Content-Length", std::to_string(body.length()).c_str());
/* build response */
std::stringstream ss;
ss << version << " " << code << " " << status << CRLF;