Windows ws build fix

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

View File

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

View File

@ -9,13 +9,13 @@
// Broadcast server can be ran with `ws broadcast_server`
//
#include "linenoise.hpp"
#include "nlohmann/json.hpp"
#include <ixwebsocket/IXSocket.h>
#include <ixwebsocket/IXWebSocket.h>
#include <queue>
#include <spdlog/spdlog.h>
#include <sstream>
#include <iostream>
// for convenience
using json = nlohmann::json;
@ -172,9 +172,10 @@ namespace ix
{
// Read 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;
}