summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-03 08:27:56 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-03 08:27:56 +0100
commit2f8aaf2046658fae417277a8ffecf3cc51385bea (patch)
tree4cc78aed641ce137986a36cfa4e4b95f8f7ab2d4
parentdb4d104ed965592c1d89c31d96301f0a44640df7 (diff)
Debug Windows platform
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/ProcessWindows.cpp3
-rw-r--r--src/UCI.hpp.in2
3 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 954e92f..7f525f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ SET(COMPILE_PLATFORM UNIX)
if(WIN32)
SET(process src/ProcessWindows.cpp)
SET(COMPILE_PLATFORM WIN32)
+ SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
add_library(uciadapter SHARED src/UCI.cpp ${process})
@@ -17,6 +18,7 @@ file(MAKE_DIRECTORY ${UCIADAPTER_INCLUDE_DIR})
configure_file(src/UCI.hpp.in ${UCIADAPTER_INCLUDE_DIR}/UCI.hpp)
configure_file(src/Process.hpp ${UCIADAPTER_INCLUDE_DIR} COPYONLY)
configure_file(src/ProcessLinux.hpp ${UCIADAPTER_INCLUDE_DIR} COPYONLY)
+configure_file(src/ProcessWindows.hpp ${UCIADAPTER_INCLUDE_DIR} COPYONLY)
include_directories(${UCIADAPTER_INCLUDE_DIR})
# Tests
diff --git a/src/ProcessWindows.cpp b/src/ProcessWindows.cpp
index 77ca13c..e32ab6f 100644
--- a/src/ProcessWindows.cpp
+++ b/src/ProcessWindows.cpp
@@ -42,7 +42,7 @@ void ProcessWindows::CreateChildProcess(std::string engine_path)
// If an error occurs, exit the application.
if (!bSuccess)
- ErrorExit(TEXT("CreateProcess"));
+ throw FailedToStartEngine();
else {
// Close handles to the child process and its primary thread.
// Some applications might keep these handles to monitor the status
@@ -90,7 +90,6 @@ void ProcessWindows::ErrorExit(PTSTR lpszFunction)
ProcessWindows::ProcessWindows() {
- printf("\n->Start of parent execution.\n");
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
diff --git a/src/UCI.hpp.in b/src/UCI.hpp.in
index 86925c5..8e97bbe 100644
--- a/src/UCI.hpp.in
+++ b/src/UCI.hpp.in
@@ -1,4 +1,6 @@
+#ifndef @COMPILE_PLATFORM@
#define @COMPILE_PLATFORM@
+#endif
#ifdef UNIX
#include "ProcessLinux.hpp"
#define INIT_PROCESS(p) \