aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/CMakeLists.txt9
-rw-r--r--host/Modules/UHDPackage.cmake12
-rw-r--r--host/include/uhd/config.hpp2
-rw-r--r--host/include/uhd/utils/byteswap.ipp6
-rw-r--r--host/lib/transport/CMakeLists.txt4
5 files changed, 19 insertions, 14 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 3808481bf..7df04995c 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -80,16 +80,21 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
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( #stop all kinds of compatibility warnings
-D_SCL_SECURE_NO_WARNINGS
+ -D_SCL_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
+ -D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE
)
ENDIF(MSVC)
+IF(WIN32)
+ ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
+ ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max
+ENDIF(WIN32)
+
########################################################################
# Setup Boost
########################################################################
diff --git a/host/Modules/UHDPackage.cmake b/host/Modules/UHDPackage.cmake
index 7ac677d28..4986e314c 100644
--- a/host/Modules/UHDPackage.cmake
+++ b/host/Modules/UHDPackage.cmake
@@ -21,18 +21,18 @@ INCLUDE(UHDVersion) #sets version information
########################################################################
# Setup additional defines for OS types
########################################################################
-IF(UNIX AND EXISTS "/etc/debian_version")
+IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ SET(LINUX TRUE)
+ENDIF()
+
+IF(LINUX AND EXISTS "/etc/debian_version")
SET(DEBIAN TRUE)
ENDIF()
-IF(UNIX AND EXISTS "/etc/redhat-release")
+IF(LINUX AND EXISTS "/etc/redhat-release")
SET(REDHAT TRUE)
ENDIF()
-IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- SET(LINUX TRUE)
-ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-
########################################################################
# Setup package file name
########################################################################
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index fdb168950..6fd2932cf 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -49,7 +49,7 @@ typedef ptrdiff_t ssize_t;
#endif //BOOST_MSVC
//define cross platform attribute macros
-#if defined(BOOST_HAS_DECLSPEC)
+#if defined(BOOST_MSVC)
#define UHD_EXPORT __declspec(dllexport)
#define UHD_IMPORT __declspec(dllimport)
#define UHD_INLINE __forceinline
diff --git a/host/include/uhd/utils/byteswap.ipp b/host/include/uhd/utils/byteswap.ipp
index a070a7cf5..c090dee55 100644
--- a/host/include/uhd/utils/byteswap.ipp
+++ b/host/include/uhd/utils/byteswap.ipp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@
/***********************************************************************
* Platform-specific implementation details for byteswap below:
**********************************************************************/
-#if defined(UHD_PLATFORM_WIN32) //http://msdn.microsoft.com/en-us/library/a3140177%28VS.80%29.aspx
- #include <stdlib.h>
+#if defined(BOOST_MSVC) //http://msdn.microsoft.com/en-us/library/a3140177%28VS.80%29.aspx
+ #include <cstdlib>
UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){
return _byteswap_ushort(x);
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
index 656ca9987..a7179d561 100644
--- a/host/lib/transport/CMakeLists.txt
+++ b/host/lib/transport/CMakeLists.txt
@@ -31,10 +31,10 @@ IF(ENABLE_USB)
MESSAGE(STATUS "USB support enabled via libusb.")
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR})
LIBUHD_APPEND_LIBS(${LIBUSB_LIBRARIES})
- IF(WIN32)
+ IF(MSVC)
#needed when statically linking libusb
LIBUHD_APPEND_LIBS(Setupapi.lib)
- ENDIF(WIN32)
+ ENDIF(MSVC)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_control.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_zero_copy.cpp