mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
Add support for MSVC 2015 (#365)
Co-authored-by: An Tao <antao2002@gmail.com>
This commit is contained in:
parent
53f61e9b66
commit
d5cd882248
@ -155,11 +155,11 @@ if(NOT WIN32)
|
||||
message(FATAL_ERROR "uuid lib error")
|
||||
endif()
|
||||
endif(NOT WIN32)
|
||||
if(NOT MSVC)
|
||||
if(NOT MSVC OR NOT BUILD_ORM)
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${ZLIB_INCLUDE_DIR})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${ZLIB_LIBRARIES})
|
||||
endif(NOT MSVC)
|
||||
endif(NOT MSVC OR NOT BUILD_ORM)
|
||||
|
||||
set(DROGON_SOURCES
|
||||
lib/src/AOPAdvice.cc
|
||||
|
@ -3,15 +3,15 @@
|
||||
# DROGON_INCLUDE_DIRS - include directories for Drogon
|
||||
# DROGON_LIBRARIES - libraries to link against
|
||||
# DROGON_EXECUTABLE - the drogon_ctl executable
|
||||
# DROGON_FOUND
|
||||
# Drogon_FOUND
|
||||
# This module defines the following IMPORTED target:
|
||||
# Drogon::Drogon
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
if(NOT TRANTOR_FOUND)
|
||||
if(NOT Trantor_FOUND)
|
||||
# find trantor
|
||||
find_package(Trantor REQUIRED)
|
||||
find_package(Trantor CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
@ -24,4 +24,3 @@ endif()
|
||||
get_target_property(DROGON_INCLUDE_DIRS Drogon::Drogon INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(DROGON_LIBRARIES Drogon::Drogon)
|
||||
set(DROGON_EXECUTABLE drogon_ctl)
|
||||
set(DROGON_FOUND TRUE)
|
||||
|
@ -58,11 +58,11 @@ HttpRequestPtr toRequest(T &&)
|
||||
}
|
||||
|
||||
template <>
|
||||
HttpRequestPtr toRequest(const Json::Value &pJson);
|
||||
HttpRequestPtr toRequest<const Json::Value &>(const Json::Value &pJson);
|
||||
template <>
|
||||
HttpRequestPtr toRequest(Json::Value &&pJson);
|
||||
template <>
|
||||
inline HttpRequestPtr toRequest(Json::Value &pJson)
|
||||
inline HttpRequestPtr toRequest<Json::Value &>(Json::Value &pJson)
|
||||
{
|
||||
return toRequest((const Json::Value &)pJson);
|
||||
}
|
||||
@ -372,7 +372,7 @@ class HttpRequest
|
||||
};
|
||||
|
||||
template <>
|
||||
inline HttpRequestPtr toRequest(const Json::Value &pJson)
|
||||
inline HttpRequestPtr toRequest<const Json::Value &>(const Json::Value &pJson)
|
||||
{
|
||||
return HttpRequest::newHttpJsonRequest(pJson);
|
||||
}
|
||||
|
@ -54,11 +54,11 @@ HttpResponsePtr toResponse(T &&)
|
||||
exit(1);
|
||||
}
|
||||
template <>
|
||||
HttpResponsePtr toResponse(const Json::Value &pJson);
|
||||
HttpResponsePtr toResponse<const Json::Value &>(const Json::Value &pJson);
|
||||
template <>
|
||||
HttpResponsePtr toResponse(Json::Value &&pJson);
|
||||
template <>
|
||||
inline HttpResponsePtr toResponse(Json::Value &pJson)
|
||||
inline HttpResponsePtr toResponse<Json::Value &>(Json::Value &pJson)
|
||||
{
|
||||
return toResponse((const Json::Value &)pJson);
|
||||
}
|
||||
@ -367,7 +367,7 @@ class HttpResponse
|
||||
virtual void setBody(const char *body, size_t len) = 0;
|
||||
};
|
||||
template <>
|
||||
inline HttpResponsePtr toResponse(const Json::Value &pJson)
|
||||
inline HttpResponsePtr toResponse<const Json::Value &>(const Json::Value &pJson)
|
||||
{
|
||||
return HttpResponse::newHttpJsonResponse(pJson);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class HttpFile
|
||||
/// Return the file content.
|
||||
char *fileData() noexcept
|
||||
{
|
||||
#if __cplusplus >= 201703L | defined _WIN32
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
return fileContent_.data();
|
||||
#else
|
||||
return (char *)(fileContent_.data());
|
||||
|
@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#if __cplusplus >= 201703L | defined _WIN32
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
#include <any>
|
||||
#else
|
||||
#include <boost/any.hpp>
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
namespace drogon
|
||||
{
|
||||
#if __cplusplus >= 201703L | defined _WIN32
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
using std::any;
|
||||
using std::any_cast;
|
||||
#else
|
||||
|
@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#if __cplusplus >= 201703L | defined _WIN32
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
#include <string_view>
|
||||
#else
|
||||
#include <boost/utility/string_view.hpp>
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
namespace drogon
|
||||
{
|
||||
#if __cplusplus >= 201703L | defined _WIN32
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
using std::string_view;
|
||||
#else
|
||||
using boost::string_view;
|
||||
|
@ -87,11 +87,14 @@ HttpAppFrameworkImpl::HttpAppFrameworkImpl()
|
||||
uploadPath_(rootPath_ + "uploads")
|
||||
{
|
||||
}
|
||||
|
||||
static std::function<void()> f = [] {
|
||||
LOG_TRACE << "Initialize the main event loop in the main thread";
|
||||
};
|
||||
|
||||
/// Make sure that the main event loop is initialized in the main thread.
|
||||
drogon::InitBeforeMainFunction drogon::HttpAppFrameworkImpl::initFirst_([]() {
|
||||
HttpAppFrameworkImpl::instance().getLoop()->runInLoop([]() {
|
||||
LOG_TRACE << "Initialize the main event loop in the main thread";
|
||||
});
|
||||
HttpAppFrameworkImpl::instance().getLoop()->runInLoop(f);
|
||||
});
|
||||
|
||||
namespace drogon
|
||||
|
@ -115,7 +115,7 @@ class ConstReverseResultIterator : private ConstResultIterator
|
||||
using iterator_type::iterator_category;
|
||||
using iterator_type::pointer;
|
||||
using iterator_type::reference;
|
||||
using iterator_type::value_type;
|
||||
// using iterator_type::value_type;
|
||||
|
||||
ConstReverseResultIterator(const ConstReverseResultIterator &rhs)
|
||||
: ConstResultIterator(rhs)
|
||||
|
@ -111,7 +111,7 @@ class ConstReverseRowIterator : private ConstRowIterator
|
||||
using iterator_type::iterator_category;
|
||||
using iterator_type::pointer;
|
||||
using iterator_type::reference;
|
||||
using iterator_type::value_type;
|
||||
// using iterator_type::value_type;
|
||||
|
||||
ConstReverseRowIterator(const ConstReverseRowIterator &rhs)
|
||||
: ConstRowIterator(rhs)
|
||||
|
2
trantor
2
trantor
@ -1 +1 @@
|
||||
Subproject commit b152c54b1fd36c04fde8b400f5637617962260c9
|
||||
Subproject commit e052988f277d039e3392bd4d213a531e45b822a8
|
Loading…
Reference in New Issue
Block a user