ithewei 5 anni fa
parent
commit
8c4b4fa886
5 ha cambiato i file con 12 aggiunte e 11 eliminazioni
  1. 1 1
      Makefile
  2. 1 0
      base/hplatform.h
  3. 1 1
      echo-servers/libhv_echo.c
  4. 3 3
      http/HttpMessage.cpp
  5. 6 6
      utils/iniparser.cpp

+ 1 - 1
Makefile

@@ -115,7 +115,7 @@ echo-servers:
 	$(CC)  -g -Wall -std=c99   -o bin/libevent_echo echo-servers/libevent_echo.c -levent
 	$(CC)  -g -Wall -std=c99   -o bin/libev_echo    echo-servers/libev_echo.c    -lev
 	$(CC)  -g -Wall -std=c99   -o bin/libuv_echo    echo-servers/libuv_echo.c    -luv
-	$(CC)  -g -Wall -std=c99   -o bin/libhv_echo    echo-servers/libhv_echo.c    -Iinclude/hv -Llib -lhv
+	$(CC)  -g -Wall -std=c99   -o bin/libhv_echo    echo-servers/libhv_echo.c    -lhv
 	$(CXX) -g -Wall -std=c++11 -o bin/asio_echo     echo-servers/asio_echo.cpp   -lboost_system
 	$(CXX) -g -Wall -std=c++11 -o bin/poco_echo     echo-servers/poco_echo.cpp   -lPocoNet -lPocoUtil -lPocoFoundation
 	$(CXX) -g -Wall -std=c++11 -o bin/muduo_echo    echo-servers/muduo_echo.cpp  -lmuduo_net -lmuduo_base -lpthread

+ 1 - 0
base/hplatform.h

@@ -48,6 +48,7 @@
 // _MSC_VER
 #ifdef _MSC_VER
 #pragma warning (disable: 4100) // unused param
+#pragma warning (disable: 4251) // STL dll
 #pragma warning (disable: 4819) // Unicode
 #pragma warning (disable: 4996) // _CRT_SECURE_NO_WARNINGS
 #endif

+ 1 - 1
echo-servers/libhv_echo.c

@@ -1,4 +1,4 @@
-#include "hloop.h"
+#include "hv/hloop.h"
 
 void on_close(hio_t* io) {
 }

+ 3 - 3
http/HttpMessage.cpp

@@ -55,7 +55,7 @@ std::string HttpMessage::GetString(const char* key, const std::string& defvalue)
 }
 
 template<>
-int64_t HttpMessage::Get(const char* key, int64_t defvalue) {
+HV_EXPORT int64_t HttpMessage::Get(const char* key, int64_t defvalue) {
     if (content_type == APPLICATION_JSON) {
         auto value = json[key];
         if (value.is_number()) {
@@ -83,7 +83,7 @@ int64_t HttpMessage::Get(const char* key, int64_t defvalue) {
 }
 
 template<>
-double HttpMessage::Get(const char* key, double defvalue) {
+HV_EXPORT double HttpMessage::Get(const char* key, double defvalue) {
     if (content_type == APPLICATION_JSON) {
         auto value = json[key];
         if (value.is_number()) {
@@ -107,7 +107,7 @@ double HttpMessage::Get(const char* key, double defvalue) {
 }
 
 template<>
-bool HttpMessage::Get(const char* key, bool defvalue) {
+HV_EXPORT bool HttpMessage::Get(const char* key, bool defvalue) {
     if (content_type == APPLICATION_JSON) {
         auto value = json[key];
         if (value.is_boolean()) {

+ 6 - 6
utils/iniparser.cpp

@@ -323,35 +323,35 @@ void IniParser::SetValue(const string& key, const string& value, const string& s
 }
 
 template<>
-bool IniParser::Get(const string& key, const string& section, bool defvalue) {
+HV_EXPORT bool IniParser::Get(const string& key, const string& section, bool defvalue) {
     string str = GetValue(key, section);
     return str.empty() ? defvalue : getboolean(str.c_str());
 }
 
 template<>
-int IniParser::Get(const string& key, const string& section, int defvalue) {
+HV_EXPORT int IniParser::Get(const string& key, const string& section, int defvalue) {
     string str = GetValue(key, section);
     return str.empty() ? defvalue : atoi(str.c_str());
 }
 
 template<>
-float IniParser::Get(const string& key, const string& section, float defvalue) {
+HV_EXPORT float IniParser::Get(const string& key, const string& section, float defvalue) {
     string str = GetValue(key, section);
     return str.empty() ? defvalue : atof(str.c_str());
 }
 
 template<>
-void IniParser::Set(const string& key, const bool& value, const string& section) {
+HV_EXPORT void IniParser::Set(const string& key, const bool& value, const string& section) {
     SetValue(key, value ? "true" : "false", section);
 }
 
 template<>
-void IniParser::Set(const string& key, const int& value, const string& section) {
+HV_EXPORT void IniParser::Set(const string& key, const int& value, const string& section) {
     SetValue(key, asprintf("%d", value), section);
 }
 
 template<>
-void IniParser::Set(const string& key, const float& value, const string& section) {
+HV_EXPORT void IniParser::Set(const string& key, const float& value, const string& section) {
     SetValue(key, asprintf("%f", value), section);
 }