aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-05 16:43:09 +0200
committerStefan Boberg <[email protected]>2021-10-05 16:43:09 +0200
commit564a7b00378e5f4ed7700fe8c5ea21cc2df5572d (patch)
tree9b88e246a2b30558df9ea0c03045892a7812a7e0
parentminor: removed unused <deque> include (diff)
downloadzen-564a7b00378e5f4ed7700fe8c5ea21cc2df5572d.tar.xz
zen-564a7b00378e5f4ed7700fe8c5ea21cc2df5572d.zip
http: Exclude iothreadpool from compilation on non-Windows
-rw-r--r--zenhttp/iothreadpool.cpp6
-rw-r--r--zenhttp/iothreadpool.h8
2 files changed, 12 insertions, 2 deletions
diff --git a/zenhttp/iothreadpool.cpp b/zenhttp/iothreadpool.cpp
index 4f1a6642b..6087e69ec 100644
--- a/zenhttp/iothreadpool.cpp
+++ b/zenhttp/iothreadpool.cpp
@@ -4,6 +4,8 @@
#include <zencore/except.h>
+#if ZEN_PLATFORM_WINDOWS
+
namespace zen {
WinIoThreadPool::WinIoThreadPool(int InThreadCount)
@@ -32,6 +34,8 @@ WinIoThreadPool::~WinIoThreadPool()
void
WinIoThreadPool::CreateIocp(HANDLE IoHandle, PTP_WIN32_IO_CALLBACK Callback, void* Context, std::error_code& ErrorCode)
{
+ ZEN_ASSERT(!m_ThreadPoolIo);
+
m_ThreadPoolIo = CreateThreadpoolIo(IoHandle, Callback, Context, &m_CallbackEnvironment);
if (!m_ThreadPoolIo)
@@ -41,3 +45,5 @@ WinIoThreadPool::CreateIocp(HANDLE IoHandle, PTP_WIN32_IO_CALLBACK Callback, voi
}
} // namespace zen
+
+#endif
diff --git a/zenhttp/iothreadpool.h b/zenhttp/iothreadpool.h
index 4418b940b..8333964c3 100644
--- a/zenhttp/iothreadpool.h
+++ b/zenhttp/iothreadpool.h
@@ -2,9 +2,12 @@
#pragma once
-#include <zencore/windows.h>
+#include <zencore/zencore.h>
-#include <system_error>
+#if ZEN_PLATFORM_WINDOWS
+# include <zencore/windows.h>
+
+# include <system_error>
namespace zen {
@@ -31,3 +34,4 @@ private:
};
} // namespace zen
+#endif