From 33c537c84fea53c899fb5275256518598f66101e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 21 Jul 2015 19:59:48 +0200 Subject: o Fixing compatability with libcxx. --- ble/ByteBuffer.cpp | 3 ++- ble/LinuxBluetooth.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'ble') diff --git a/ble/ByteBuffer.cpp b/ble/ByteBuffer.cpp index ff7c928..f5e50d8 100644 --- a/ble/ByteBuffer.cpp +++ b/ble/ByteBuffer.cpp @@ -1,4 +1,5 @@ #include "ble/ByteBuffer.h" +#include #include #include #include @@ -119,7 +120,7 @@ void ByteBuffer::assertCanAccessIndex(uint8_t *p) const { } std::string ByteBuffer::toString() const { - stringstream s; + std::stringstream s; for (uint8_t *i = (uint8_t *) zero; i < end; i++) { s << hex << setfill('0') << setw(2) << (int) *i << " "; diff --git a/ble/LinuxBluetooth.cpp b/ble/LinuxBluetooth.cpp index 0c6c387..f662d45 100644 --- a/ble/LinuxBluetooth.cpp +++ b/ble/LinuxBluetooth.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include // Got to love magic constants. Taken from bluez.git/tools/btgatt-client.c #define ATT_CID 4 @@ -168,7 +170,7 @@ void LinuxBluetoothGatt::connect() { addr.l2_cid = htobs(ATT_CID); addr.l2_bdaddr_type = BDADDR_LE_PUBLIC; - if (bind(l2cap, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + if (::bind(l2cap, (struct sockaddr *) &addr, sizeof(addr)) < 0) { close(l2cap); throw BluetoothException(&device, "bind(): " + errnoAsString()); } -- cgit v1.2.3