Some small windows compile fixes
This commit is contained in:
parent
0b0f957ead
commit
66a73c31cb
@ -26,7 +26,7 @@ find_package(DataPipes REQUIRED)
|
|||||||
include_directories(${DataPipes_INCLUDE_DIR})
|
include_directories(${DataPipes_INCLUDE_DIR})
|
||||||
|
|
||||||
# LibEvent fucks up the CMAKE_FIND_LIBRARY_SUFFIXES variable
|
# LibEvent fucks up the CMAKE_FIND_LIBRARY_SUFFIXES variable
|
||||||
if (NOT find_event AND FALSE)
|
if (NOT find_event)
|
||||||
function(find_event static)
|
function(find_event static)
|
||||||
if(static)
|
if(static)
|
||||||
set(LIBEVENT_STATIC_LINK TRUE)
|
set(LIBEVENT_STATIC_LINK TRUE)
|
||||||
@ -66,18 +66,20 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(CompilerFlags
|
set(CompilerFlags
|
||||||
CMAKE_CXX_FLAGS
|
CMAKE_CXX_FLAGS
|
||||||
CMAKE_CXX_FLAGS_DEBUG
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
CMAKE_CXX_FLAGS_RELEASE
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
CMAKE_C_FLAGS
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
CMAKE_C_FLAGS_DEBUG
|
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
CMAKE_C_FLAGS_RELEASE
|
CMAKE_C_FLAGS
|
||||||
)
|
CMAKE_C_FLAGS_DEBUG
|
||||||
foreach(CompilerFlag ${CompilerFlags})
|
CMAKE_C_FLAGS_RELEASE
|
||||||
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
)
|
||||||
endforeach()
|
foreach(CompilerFlag ${CompilerFlags})
|
||||||
add_compile_options("/EHsc") #We require exception handling
|
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
||||||
|
endforeach()
|
||||||
|
add_compile_options("/EHsc") #We require exception handling
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3") #-DNDEBUG We want assert!
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3") #-DNDEBUG We want assert!
|
||||||
endif()
|
endif()
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
#include "escape.h"
|
#include "escape.h"
|
||||||
#include "converters/converter.h"
|
#include "converters/converter.h"
|
||||||
@ -131,7 +132,7 @@ namespace ts {
|
|||||||
std::vector<std::string_view> flags{};
|
std::vector<std::string_view> flags{};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename vector_t = std::vector<std::string>>
|
template <class vector_t = std::vector<std::string>, class vector_iter = std::vector<std::string>::iterator>
|
||||||
class command_builder_impl {
|
class command_builder_impl {
|
||||||
public:
|
public:
|
||||||
explicit command_builder_impl(std::string command, size_t expected_bulk_size = 128, size_t expected_bulks = 1) : _identifier{std::move(command)}, expected_bulk_size{expected_bulk_size} {
|
explicit command_builder_impl(std::string command, size_t expected_bulk_size = 128, size_t expected_bulks = 1) : _identifier{std::move(command)}, expected_bulk_size{expected_bulk_size} {
|
||||||
@ -214,7 +215,7 @@ namespace ts {
|
|||||||
this->put_unchecked(index, key, std::string_view{data});
|
this->put_unchecked(index, key, std::string_view{data});
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
command_builder_impl(size_t expected, size_t identifier, vector_t::iterator begin, vector_t::iterator end) : expected_bulk_size{expected}, _identifier{identifier}, bulks{begin, end} {}
|
command_builder_impl(size_t expected, size_t identifier, vector_iter begin, vector_iter end) : expected_bulk_size{expected}, _identifier{identifier}, bulks{begin, end} {}
|
||||||
|
|
||||||
void impl_put_unchecked(std::string& data, size_t index, const std::string_view& key, const std::string_view& value) {
|
void impl_put_unchecked(std::string& data, size_t index, const std::string_view& key, const std::string_view& value) {
|
||||||
auto escaped_value = ts::query::escape(std::string{value});
|
auto escaped_value = ts::query::escape(std::string{value});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user