Преглед на файлове

Fix C++ build errors in Linux

bel преди 11 години
родител
ревизия
724753a7da
променени са 3 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. 2 0
      examples/embedded_cpp/embedded_cpp.cpp
  2. 2 8
      include/CivetServer.h
  3. 9 0
      src/CivetServer.cpp

+ 2 - 0
examples/embedded_cpp/embedded_cpp.cpp

@@ -9,6 +9,8 @@
 
 #ifdef _WIN32
 #include <Windows.h>
+#else
+#include <unistd.h>
 #endif
 
 #define DOCUMENT_ROOT "."

+ 2 - 8
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;

+ 9 - 0
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);
+}