From 724753a7dae6f325dfafb9b56304781cc57d1e6d Mon Sep 17 00:00:00 2001 From: bel Date: Tue, 24 Jun 2014 21:44:21 +0200 Subject: [PATCH] Fix C++ build errors in Linux --- examples/embedded_cpp/embedded_cpp.cpp | 2 ++ include/CivetServer.h | 10 ++-------- src/CivetServer.cpp | 9 +++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/embedded_cpp/embedded_cpp.cpp b/examples/embedded_cpp/embedded_cpp.cpp index 8b32f40f..3ada0ad5 100644 --- a/examples/embedded_cpp/embedded_cpp.cpp +++ b/examples/embedded_cpp/embedded_cpp.cpp @@ -9,6 +9,8 @@ #ifdef _WIN32 #include +#else +#include #endif #define DOCUMENT_ROOT "." diff --git a/include/CivetServer.h b/include/CivetServer.h index 80c110c0..95d09234 100644 --- a/include/CivetServer.h +++ b/include/CivetServer.h @@ -281,14 +281,8 @@ protected: char * postData; unsigned long postDataLen; - CivetConnection() { - postData = NULL; - postDataLen = 0; - } - - ~CivetConnection() { - free(postData); - } + CivetConnection(); + ~CivetConnection(); }; struct mg_context *context; diff --git a/src/CivetServer.cpp b/src/CivetServer.cpp index 364aa9fd..5acb03b1 100644 --- a/src/CivetServer.cpp +++ b/src/CivetServer.cpp @@ -277,3 +277,12 @@ CivetServer::urlEncode(const char *src, size_t src_len, std::string &dst, bool a } } } + +CivetServer::CivetConnection::CivetConnection() { + postData = NULL; + postDataLen = 0; +} + +CivetServer::CivetConnection::~CivetConnection() { + free(postData); +}