mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Visual Studio 2013 compilation fixes.
- Missing header file callouts in some cases (library deltas) - Lack of support for auto parameters in lambdas - Defining of ERROR by windows.h - Dispatcher::Connection needs a move constructor (default not generated) - Need explicit enable_if on std::string move template in Value to avoid trying to move const char[] (string literal) - Compile flags
This commit is contained in:
@@ -85,6 +85,13 @@ class DispatcherBase {
|
||||
Connection() = default;
|
||||
explicit Connection(std::unique_ptr<NetworkConnection> net_)
|
||||
: net(std::move(net_)) {}
|
||||
Connection(Connection&& rhs) {
|
||||
net = std::move(rhs.net);
|
||||
outgoing = std::move(rhs.outgoing);
|
||||
last_update = std::move(rhs.last_update);
|
||||
}
|
||||
Connection(const Connection&) = delete;
|
||||
Connection& operator=(const Connection&) = delete;
|
||||
void QueueOutgoing(std::shared_ptr<Message> msg);
|
||||
|
||||
std::unique_ptr<NetworkConnection> net;
|
||||
|
||||
@@ -60,6 +60,7 @@ class Logger {
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#undef ERROR
|
||||
#define ERROR(x) LOG(NT_LOG_ERROR, x)
|
||||
#define WARNING(x) LOG(NT_LOG_WARNING, x)
|
||||
#define INFO(x) LOG(NT_LOG_INFO, x)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "Storage.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
@@ -567,7 +568,8 @@ static void WriteString(std::ostream& os, llvm::StringRef str) {
|
||||
|
||||
void Storage::SavePersistent(std::ostream& os) const {
|
||||
// copy values out of storage as quickly as possible so lock isn't held
|
||||
std::vector<std::pair<std::string, std::shared_ptr<Value>>> entries;
|
||||
typedef std::pair<std::string, std::shared_ptr<Value>> NewEntry;
|
||||
std::vector<NewEntry> entries;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
entries.reserve(m_entries.size());
|
||||
@@ -581,7 +583,7 @@ void Storage::SavePersistent(std::ostream& os) const {
|
||||
|
||||
// sort in name order
|
||||
std::sort(entries.begin(), entries.end(),
|
||||
[](const auto& a, const auto& b) { return a.first < b.first; });
|
||||
[](const NewEntry& a, const NewEntry& b) { return a.first < b.first; });
|
||||
|
||||
std::string base64_encoded;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void NetworkTable::AddTableListener(StringRef key,
|
||||
void NetworkTable::RemoveTableListener(ITableListener* listener) {
|
||||
auto matches_begin =
|
||||
std::remove_if(m_listeners.begin(), m_listeners.end(),
|
||||
[=](const auto& x) { return x.first == listener; });
|
||||
[=](const Listener& x) { return x.first == listener; });
|
||||
|
||||
for (auto i = matches_begin; i != m_listeners.end(); ++i)
|
||||
nt::RemoveEntryListener(i->second);
|
||||
|
||||
Reference in New Issue
Block a user