aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-20 11:30:11 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2011-10-21 11:17:33 +0300
commit4e3d7a4b9cd0200ca738d71f5f1063b5c5264e58 (patch)
treeced003d188b28818d6fda36778f26ef6c5117b98
parent1268f7bc598e5e773411b3f0e4d9bd6327a3662e (diff)
downloadbluez-hcidump-4e3d7a4b9cd0200ca738d71f5f1063b5c5264e58.tar.gz
Add btohll macro
Handle 64 bit swap
-rw-r--r--lib/bluetooth.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 738e07a..b0680e2 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -93,13 +93,17 @@ enum {
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobs(d) (d)
#define htobl(d) (d)
+#define htobll(d) (d)
#define btohs(d) (d)
#define btohl(d) (d)
+#define btohll(d) (d)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define htobs(d) bswap_16(d)
#define htobl(d) bswap_32(d)
+#define htobll(d) bswap_64(d)
#define btohs(d) bswap_16(d)
#define btohl(d) bswap_32(d)
+#define btohll(d) bswap_64(d)
#else
#error "Unknown byte order"
#endif