Revision 4caf9db3
| b/host/include/uhd/utils/byteswap.hpp | ||
|---|---|---|
| 1 | 1 |
// |
| 2 |
// Copyright 2010 Ettus Research LLC |
|
| 2 |
// Copyright 2010-2011 Ettus Research LLC
|
|
| 3 | 3 |
// |
| 4 | 4 |
// This program is free software: you can redistribute it and/or modify |
| 5 | 5 |
// it under the terms of the GNU General Public License as published by |
| ... | ... | |
| 43 | 43 |
//! host to network: short, long, or long-long |
| 44 | 44 |
template<typename T> T htonx(T); |
| 45 | 45 |
|
| 46 |
//! worknet to host: short, long, or long-long |
|
| 47 |
template<typename T> T wtohx(T); |
|
| 48 |
|
|
| 49 |
//! host to worknet: short, long, or long-long |
|
| 50 |
template<typename T> T htowx(T); |
|
| 51 |
|
|
| 46 | 52 |
} //namespace uhd |
| 47 | 53 |
|
| 48 | 54 |
#include <uhd/utils/byteswap.ipp> |
| b/host/include/uhd/utils/byteswap.ipp | ||
|---|---|---|
| 117 | 117 |
#endif |
| 118 | 118 |
} |
| 119 | 119 |
|
| 120 |
template<typename T> UHD_INLINE T uhd::wtohx(T num){
|
|
| 121 |
#ifdef BOOST_BIG_ENDIAN |
|
| 122 |
return uhd::byteswap(num); |
|
| 123 |
#else |
|
| 124 |
return num; |
|
| 125 |
#endif |
|
| 126 |
} |
|
| 127 |
|
|
| 128 |
template<typename T> UHD_INLINE T uhd::htowx(T num){
|
|
| 129 |
#ifdef BOOST_BIG_ENDIAN |
|
| 130 |
return uhd::byteswap(num); |
|
| 131 |
#else |
|
| 132 |
return num; |
|
| 133 |
#endif |
|
| 134 |
} |
|
| 135 |
|
|
| 120 | 136 |
#endif /* INCLUDED_UHD_UTILS_BYTESWAP_IPP */ |
Also available in: Unified diff