summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/lib/transport/CMakeLists.txt11
-rw-r--r--host/lib/transport/udp_zero_copy.cpp9
2 files changed, 16 insertions, 4 deletions
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
index 3cae6180a..8e8ea5ea8 100644
--- a/host/lib/transport/CMakeLists.txt
+++ b/host/lib/transport/CMakeLists.txt
@@ -90,6 +90,17 @@ IF(WIN32)
LIBUHD_APPEND_LIBS(ws2_32)
ENDIF()
+#atlbase.h is not included with visual studio express
+#conditionally check for atlbase.h and define if found
+INCLUDE(CheckIncludeFileCXX)
+CHECK_INCLUDE_FILE_CXX(atlbase.h HAVE_ATLBASE_H)
+IF(HAVE_ATLBASE_H)
+ SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp
+ PROPERTIES COMPILE_DEFINITIONS "HAVE_ATLBASE_H"
+ )
+ENDIF(HAVE_ATLBASE_H)
+
########################################################################
# Append to the list of sources for lib uhd
########################################################################
diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp
index e43a96dd0..0ccc92b82 100644
--- a/host/lib/transport/udp_zero_copy.cpp
+++ b/host/lib/transport/udp_zero_copy.cpp
@@ -35,7 +35,8 @@ static const size_t DEFAULT_NUM_FRAMES = 32;
/***********************************************************************
* Check registry for correct fast-path setting (windows only)
**********************************************************************/
-#ifdef UHD_PLATFORM_WIN32
+#ifdef HAVE_ATLBASE_H
+#define CHECK_REG_SEND_THRESH
#include <atlbase.h> //CRegKey
static void check_registry_for_fast_send_threshold(const size_t mtu){
static bool warned = false;
@@ -56,7 +57,7 @@ static void check_registry_for_fast_send_threshold(const size_t mtu){
}
reg_key.Close();
}
-#endif /*UHD_PLATFORM_WIN32*/
+#endif /*HAVE_ATLBASE_H*/
/***********************************************************************
* Reusable managed receiver buffer:
@@ -149,9 +150,9 @@ public:
{
UHD_LOG << boost::format("Creating udp transport for %s %s") % addr % port << std::endl;
- #ifdef UHD_PLATFORM_WIN32
+ #ifdef CHECK_REG_SEND_THRESH
check_registry_for_fast_send_threshold(this->get_send_frame_size());
- #endif /*UHD_PLATFORM_WIN32*/
+ #endif /*CHECK_REG_SEND_THRESH*/
//resolve the address
asio::ip::udp::resolver resolver(_io_service);