Including some header files for linux

This commit is contained in:
an-tao 2018-10-06 23:32:53 +08:00
parent 900cc62306
commit a05b846fe3
2 changed files with 8 additions and 4 deletions

View File

@ -21,6 +21,8 @@
#include <unordered_map>
#include <string>
#include <sstream>
#include <stdio.h>
#include <stdarg.h>
typedef std::unordered_map<std::string,any> ViewDataMap;
namespace drogon
@ -69,7 +71,7 @@ namespace drogon
va_copy(backup_ap, ap);
auto result=vsnprintf((char *)strBuffer.data(), strBuffer.size(), format, backup_ap);
va_end(backup_ap);
if ((result >= 0) && (result < strBuffer.size())) {
if ((result >= 0) && ((std::string::size_type)result < strBuffer.size())) {
strBuffer.resize(result);
}
else
@ -86,7 +88,7 @@ namespace drogon
auto result=vsnprintf((char *)strBuffer.data(), strBuffer.size(), format, backup_ap);
va_end(backup_ap);
if ((result >= 0) && (result < strBuffer.size())) {
if ((result >= 0) && ((std::string::size_type)result < strBuffer.size())) {
strBuffer.resize(result);
break;
}

View File

@ -4,6 +4,8 @@
#include <string.h>
#include <zlib.h>
#include <uuid.h>
#include <stdio.h>
#include <stdarg.h>
namespace drogon{
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@ -320,7 +322,7 @@ namespace drogon{
va_copy(backup_ap, ap);
auto result=vsnprintf((char *)strBuffer.data(), strBuffer.size(), format, backup_ap);
va_end(backup_ap);
if ((result >= 0) && (result < strBuffer.size())) {
if ((result >= 0) && ((std::string::size_type)result < strBuffer.size())) {
strBuffer.resize(result);
}
else
@ -337,7 +339,7 @@ namespace drogon{
auto result=vsnprintf((char *)strBuffer.data(), strBuffer.size(), format, backup_ap);
va_end(backup_ap);
if ((result >= 0) && (result < strBuffer.size())) {
if ((result >= 0) && ((std::string::size_type)result < strBuffer.size())) {
strBuffer.resize(result);
break;
}