diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-14 22:13:54 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-14 22:13:54 +0000 |
commit | f34c3ce69ca6ecac9dedf7c13804064b860d8463 (patch) | |
tree | fbd2855b45ff24bead6342375f87fe00abb20a05 /host/include | |
parent | 9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e (diff) | |
parent | 959669e383c75fdcbd11091466516bd5af66cfb5 (diff) | |
download | uhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.tar.gz uhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.tar.bz2 uhd-f34c3ce69ca6ecac9dedf7c13804064b860d8463.zip |
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/config.hpp | 11 | ||||
-rw-r--r-- | host/include/uhd/utils/byteswap.ipp | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp index 2360174a4..dacd3a96b 100644 --- a/host/include/uhd/config.hpp +++ b/host/include/uhd/config.hpp @@ -101,4 +101,15 @@ #define UHD_DEPRECATED #endif +// Platform defines for conditional parts of headers: +// Taken from boost/config/select_platform_config.hpp, +// however, we define macros, not strings for platforms. +#if defined(linux) || defined(__linux) || defined(__linux__) + #define UHD_PLATFORM_LINUX +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + #define UHD_PLATFORM_WIN32 +#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) + #define UHD_PLATFORM_MACOS +#endif + #endif /* INCLUDED_UHD_CONFIG_HPP */ diff --git a/host/include/uhd/utils/byteswap.ipp b/host/include/uhd/utils/byteswap.ipp index 11c82a4ec..a070a7cf5 100644 --- a/host/include/uhd/utils/byteswap.ipp +++ b/host/include/uhd/utils/byteswap.ipp @@ -21,7 +21,7 @@ /*********************************************************************** * Platform-specific implementation details for byteswap below: **********************************************************************/ -#ifdef BOOST_MSVC //http://msdn.microsoft.com/en-us/library/a3140177%28VS.80%29.aspx +#if defined(UHD_PLATFORM_WIN32) //http://msdn.microsoft.com/en-us/library/a3140177%28VS.80%29.aspx #include <stdlib.h> UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ @@ -50,7 +50,7 @@ return __builtin_bswap64(x); } -#elif defined(__FreeBSD__) || defined(__MACOSX__) || defined(__APPLE__) +#elif defined(UHD_PLATFORM_MACOS) #include <libkern/OSByteOrder.h> UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ @@ -65,7 +65,7 @@ return OSSwapInt64(x); } -#elif defined(linux) || defined(__linux) +#elif defined(UHD_PLATFORM_LINUX) #include <byteswap.h> UHD_INLINE boost::uint16_t uhd::byteswap(boost::uint16_t x){ |