summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-03-14 10:41:14 -0700
committerJosh Blum <josh@joshknows.com>2012-03-14 10:41:32 -0700
commit462b27e7a492911fa19ea64b7f5c380071945ea0 (patch)
tree002cc5c80a571bdd3d91b0d01f8fb202ece6626d /host/lib
parent8a33423ad6877fdb2bc1bc50c6506cff4ce9c5aa (diff)
downloaduhd-462b27e7a492911fa19ea64b7f5c380071945ea0.tar.gz
uhd-462b27e7a492911fa19ea64b7f5c380071945ea0.tar.bz2
uhd-462b27e7a492911fa19ea64b7f5c380071945ea0.zip
uhd: make atlbase options for msvc build
Diffstat (limited to 'host/lib')
-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);