diff --git a/src/stockfish.cpp b/src/stockfish.cpp index f1e6fba..44d9ea4 100644 --- a/src/stockfish.cpp +++ b/src/stockfish.cpp @@ -35,7 +35,11 @@ int stockfish_main() { fakeout << QUITOK << "\n"; +#if _WIN32 + Sleep(100); +#else usleep(100000); +#endif fakeout.close(); fakein.close(); @@ -52,7 +56,7 @@ ssize_t stockfish_stdin_write(char *data) { std::string data; char buffer[BUFFER_SIZE + 1]; -char *stockfish_stdout_read() { +char* stockfish_stdout_read() { if (getline(fakeout, data)) { size_t len = data.length(); size_t i; @@ -62,5 +66,5 @@ char *stockfish_stdout_read() { buffer[i] = 0; return buffer; } - return NULL; + return nullptr; } \ No newline at end of file diff --git a/src/stockfish.h b/src/stockfish.h index 376321b..c950bcf 100644 --- a/src/stockfish.h +++ b/src/stockfish.h @@ -5,6 +5,8 @@ #else #include #endif + +#include #include #include diff --git a/src/stream_fix.h b/src/stream_fix.h index 7fabef4..8044f36 100644 --- a/src/stream_fix.h +++ b/src/stream_fix.h @@ -46,7 +46,7 @@ class FakeStream { private: bool closed = false; std::queue string_queue; - std::string line; + //std::string line; std::mutex mutex_guard; std::condition_variable mutex_signal; };