Commit ae47252f authored by Marian Triebe's avatar Marian Triebe

Fix build with OpenSSL enabled on windows

closes #601
parent 9f87c071
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
# define WINVER WindowsVista # define WINVER WindowsVista
# include <w32api.h> # include <w32api.h>
# endif # endif
# include <windows.h>
# include <winsock2.h> # include <winsock2.h>
# include <windows.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# include <ws2ipdef.h> # include <ws2ipdef.h>
#else #else
......
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
#define CAF_SUITE openssl_authentication #define CAF_SUITE openssl_authentication
#include "caf/test/unit_test.hpp" #include "caf/test/unit_test.hpp"
#include <unistd.h> #ifndef CAF_WINDOWS
# include <unistd.h>
#else
# include <io.h>
# include <windows.h>
# define F_OK 0
# define PATH_MAX MAX_PATH
#endif
#include <vector> #include <vector>
#include <sstream> #include <sstream>
...@@ -60,10 +67,14 @@ public: ...@@ -60,10 +67,14 @@ public:
// TODO: https://github.com/actor-framework/actor-framework/issues/555 // TODO: https://github.com/actor-framework/actor-framework/issues/555
path += "/../../libcaf_openssl/test"; path += "/../../libcaf_openssl/test";
char rpath[PATH_MAX]; char rpath[PATH_MAX];
#ifndef CAF_WINDOWS
auto rp = realpath(path.c_str(), rpath); auto rp = realpath(path.c_str(), rpath);
#else
auto rp = GetFullPathName(path.c_str(), PATH_MAX, rpath, nullptr);
#endif
std::string result; std::string result;
if (rp) if (rp)
result = rp; result = rpath;
return result; return result;
} }
}; };
......
...@@ -56,7 +56,9 @@ struct fixture { ...@@ -56,7 +56,9 @@ struct fixture {
config client_side_config; config client_side_config;
actor_system client_side{client_side_config}; actor_system client_side{client_side_config};
fixture() { fixture() {
#ifdef CAF_LINUX
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
#endif
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment