aboutsummaryrefslogtreecommitdiffstats
path: root/host/include/uhd/utils/byteswap.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'host/include/uhd/utils/byteswap.ipp')
-rw-r--r--host/include/uhd/utils/byteswap.ipp16
1 files changed, 16 insertions, 0 deletions
diff --git a/host/include/uhd/utils/byteswap.ipp b/host/include/uhd/utils/byteswap.ipp
index c090dee55..51e9c28a0 100644
--- a/host/include/uhd/utils/byteswap.ipp
+++ b/host/include/uhd/utils/byteswap.ipp
@@ -117,4 +117,20 @@ template<typename T> UHD_INLINE T uhd::htonx(T num){
#endif
}
+template<typename T> UHD_INLINE T uhd::wtohx(T num){
+ #ifdef BOOST_BIG_ENDIAN
+ return uhd::byteswap(num);
+ #else
+ return num;
+ #endif
+}
+
+template<typename T> UHD_INLINE T uhd::htowx(T num){
+ #ifdef BOOST_BIG_ENDIAN
+ return uhd::byteswap(num);
+ #else
+ return num;
+ #endif
+}
+
#endif /* INCLUDED_UHD_UTILS_BYTESWAP_IPP */