aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-16 17:19:54 -0800
committerJosh Blum <josh@joshknows.com>2011-02-16 17:19:54 -0800
commit2af3e5c49d9729339af06ce90a5810b316dc1513 (patch)
treecd9a4ef9afd2e40eaaf4752f4546499a43cf7555 /host
parent8878b35d596e2f4db8b3e0189adfcaee81c8300f (diff)
downloaduhd-2af3e5c49d9729339af06ce90a5810b316dc1513.tar.gz
uhd-2af3e5c49d9729339af06ce90a5810b316dc1513.tar.bz2
uhd-2af3e5c49d9729339af06ce90a5810b316dc1513.zip
uhd: tweaks for windows msvc compiler warnings and errors
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt7
-rw-r--r--host/include/uhd/config.hpp2
-rw-r--r--host/include/uhd/types/ref_vector.hpp2
-rw-r--r--host/lib/transport/libusb1_zero_copy.cpp4
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp2
5 files changed, 11 insertions, 6 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index baa5ab662..523944355 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -79,7 +79,12 @@ IF(MSVC)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/msvc)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max
- ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) #avoid warnings from boost::split
+ ADD_DEFINITIONS( #stop all kinds of compatibility warnings
+ -D_SCL_SECURE_NO_WARNINGS
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_SECURE_NO_DEPRECATE
+ -D_CRT_NONSTDC_NO_DEPRECATE
+ )
ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
ENDIF(MSVC)
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index 912fbc204..1a04680e9 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -27,7 +27,7 @@
//# pragma warning(disable: 4512) // assignment operator can't not be generated
//# pragma warning(disable: 4100) // unreferenced formal parameter
//# pragma warning(disable: 4996) // <symbol> was declared deprecated
-//# pragma warning(disable: 4355) // 'this' : used in base member initializer list
+# pragma warning(disable: 4355) // 'this' : used in base member initializer list
//# pragma warning(disable: 4706) // assignment within conditional expression
# pragma warning(disable: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B'
//# pragma warning(disable: 4127) // conditional expression is constant
diff --git a/host/include/uhd/types/ref_vector.hpp b/host/include/uhd/types/ref_vector.hpp
index 2928cb150..bbfb5434d 100644
--- a/host/include/uhd/types/ref_vector.hpp
+++ b/host/include/uhd/types/ref_vector.hpp
@@ -27,7 +27,7 @@ namespace uhd{
* - Provides a std::vector-like interface for an array.
* - Statically sized, and does not manage the memory.
*/
-template <typename T> class ref_vector{
+template <typename T> class UHD_API ref_vector{
public:
/*!
* Create a reference vector of size 1 from a pointer.
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp
index 60f290fcf..87adece45 100644
--- a/host/lib/transport/libusb1_zero_copy.cpp
+++ b/host/lib/transport/libusb1_zero_copy.cpp
@@ -147,7 +147,7 @@ public:
(recv_endpoint & 0x7f) | 0x80, // endpoint
static_cast<unsigned char *>(_recv_buffer_pool->at(i)), // buffer
this->get_recv_frame_size(), // length
- static_cast<libusb_transfer_cb_fn>(&libusb_async_cb), // callback
+ libusb_transfer_cb_fn(&libusb_async_cb), // callback
static_cast<void *>(&_callbacks.back()), // user_data
0 // timeout
);
@@ -173,7 +173,7 @@ public:
(send_endpoint & 0x7f) | 0x00, // endpoint
static_cast<unsigned char *>(_send_buffer_pool->at(i)), // buffer
this->get_send_frame_size(), // length
- static_cast<libusb_transfer_cb_fn>(&libusb_async_cb), // callback
+ libusb_transfer_cb_fn(&libusb_async_cb), // callback
static_cast<void *>(&_callbacks.back()), // user_data
0 // timeout
);
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index e28b6efb5..8beeccf8f 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -84,7 +84,7 @@ public:
}
private:
- static void fake_deleter(void */*obj*/){
+ static void fake_deleter(void *){
//dont do anything and assume the bastard committed it
//static_cast<offset_managed_send_buffer *>(obj)->commit(0);
}