From 48acda653f5cf0bb9a27f8861518201372cf6b32 Mon Sep 17 00:00:00 2001
From: Patzke <cpatzke@win.desy.de>
Date: Tue, 30 Jan 2018 10:53:04 +0100
Subject: [PATCH] Windows fix

---
 common/cpp/src/system_io.cpp | 5 ++---
 producer/api/CMakeLists.txt  | 4 ++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/common/cpp/src/system_io.cpp b/common/cpp/src/system_io.cpp
index 2419106b0..ab3b0eaf3 100644
--- a/common/cpp/src/system_io.cpp
+++ b/common/cpp/src/system_io.cpp
@@ -46,9 +46,8 @@ void SystemIO::Skip(SocketDescriptor socket_fd, size_t length, hidra2::IOErrors*
     std::unique_ptr<uint8_t[]> buffer;
     try {
         buffer.reset(new uint8_t[kSkipBufferSize]);
-    } catch(std::exception& e) {
-        assert(false);
-        *err = IOErrors::kUnknownError;
+    } catch(...) {
+        *err = IOErrors::kMemoryAllocationError;
         return;
     }
     size_t already_skipped = 0;
diff --git a/producer/api/CMakeLists.txt b/producer/api/CMakeLists.txt
index f5767e080..2a4af8fa6 100644
--- a/producer/api/CMakeLists.txt
+++ b/producer/api/CMakeLists.txt
@@ -12,6 +12,10 @@ add_library(${TARGET_NAME} STATIC ${SOURCE_FILES} $<TARGET_OBJECTS:common>)
 target_include_directories(${TARGET_NAME} PUBLIC include ${CMAKE_SOURCE_DIR}/common/cpp/include)
 set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
 
+#Add all necessary common libraries
+GET_PROPERTY(HIDRA2_COMMON_IO_LIBRARIES GLOBAL PROPERTY HIDRA2_COMMON_IO_LIBRARIES)
+target_link_libraries(${TARGET_NAME} ${HIDRA2_COMMON_IO_LIBRARIES})
+
 ################################
 # Testing
 ################################
-- 
GitLab