Windows ws build fix

This commit is contained in:
Benjamin Sergeant 2020-01-07 17:37:38 -08:00
parent 8410a65754
commit 7e521e38ef
2 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,9 @@
#ifndef _WIN32 #ifndef _WIN32
#include <signal.h> #include <signal.h>
#else
#include <process.h>
#define getpid _getpid
#endif #endif

View File

@ -9,13 +9,13 @@
// Broadcast server can be ran with `ws broadcast_server` // Broadcast server can be ran with `ws broadcast_server`
// //
#include "linenoise.hpp"
#include "nlohmann/json.hpp" #include "nlohmann/json.hpp"
#include <ixwebsocket/IXSocket.h> #include <ixwebsocket/IXSocket.h>
#include <ixwebsocket/IXWebSocket.h> #include <ixwebsocket/IXWebSocket.h>
#include <queue> #include <queue>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <sstream> #include <sstream>
#include <iostream>
// for convenience // for convenience
using json = nlohmann::json; using json = nlohmann::json;
@ -172,9 +172,10 @@ namespace ix
{ {
// Read line // Read line
std::string line; std::string line;
auto quit = linenoise::Readline("> ", line); std::cout << user << " > " << std::flush;
std::getline(std::cin, line);
if (quit) if (!std::cin)
{ {
break; break;
} }