From 88e69721e106e319fb12300d643be41bdac91c01 Mon Sep 17 00:00:00 2001 From: MitchellHansen Date: Mon, 6 Feb 2017 03:02:47 -0800 Subject: [PATCH] Fixed the linux build, added C++14 flag for std::make_unique --- CMakeLists.txt | 2 +- src/NetworkInput.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eedb759..446c90f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,5 +69,5 @@ endif() #target_link_libraries (${PNAME} ${Vulkan_LIBRARIES}) # Setup to use C++11 -set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 11) # Use C++11 +set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14) # Use C++11 diff --git a/src/NetworkInput.cpp b/src/NetworkInput.cpp index 7f2e3d7..ad61178 100644 --- a/src/NetworkInput.cpp +++ b/src/NetworkInput.cpp @@ -1,5 +1,7 @@ #include "NetworkInput.h" #include +#include +#include NetworkInput::NetworkInput() { @@ -119,7 +121,7 @@ void NetworkInput::threaded_client_listener(int port) { int position = 0; while (position < received) { CustomPacket p; - memcpy(p.data, &buffer[position], p.size); + std::memcpy(p.data, &buffer[position], p.size); packets.push_back(p); position += p.size; } @@ -127,7 +129,7 @@ void NetworkInput::threaded_client_listener(int port) { std::cout << "packet_count = " << packets.size() << std::endl; int left_over = 12 - (position - received); - memcpy(buffer, &buffer[received - left_over], left_over); + std::memcpy(buffer, &buffer[received - left_over], left_over); } while (status != sf::TcpSocket::Status::Done); @@ -158,4 +160,4 @@ void NetworkInput::threaded_client_listener(int port) { void NetworkInput::threaded_client_reciever() { -} \ No newline at end of file +}