From 51440bb5fddaee916c611114f4ff3cb6943f38de Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Tue, 19 Sep 2017 18:35:30 -0700 Subject: [PATCH] Remove extraneous #include. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This include was causing build errors on a Linux system with the following identity: Linux bleh 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux The build errors were: In file included from repos/apache-mynewt-core/kernel/os/include/os/os.h:77:0, from repos/apache-mynewt-core/net/nimble/transport/socket/src/ble_hci_socket.c:46: repos/apache-mynewt-core/kernel/os/include/os/endian.h:43:40: error: expected declaration specifiers or ‘...’ before ‘(’ token #define os_bswap_32(x) ((uint32_t) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))) ^ In file included from repos/apache-mynewt-core/kernel/os/include/os/os.h:77:0, from repos/apache-mynewt-core/net/nimble/transport/socket/src/ble_hci_socket.c:46: repos/apache-mynewt-core/kernel/os/include/os/endian.h:48:6: error: expected declaration specifiers or ‘...’ before ‘(’ token ((((x) & 0xff00) >> 8) | \ ^ In file included from repos/apache-mynewt-core/kernel/os/include/os/os.h:77:0, from repos/apache-mynewt-core/net/nimble/transport/socket/src/ble_hci_socket.c:46: repos/apache-mynewt-core/kernel/os/include/os/endian.h:43:40: error: expected declaration specifiers or ‘...’ before ‘(’ token #define os_bswap_32(x) ((uint32_t) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))) ^ In file included from repos/apache-mynewt-core/kernel/os/include/os/os.h:77:0, from repos/apache-mynewt-core/net/nimble/transport/socket/src/ble_hci_socket.c:46: repos/apache-mynewt-core/kernel/os/include/os/endian.h:48:6: error: expected declaration specifiers or ‘...’ before ‘(’ token ((((x) & 0xff00) >> 8) | \ The problem was caused by Mynewt's hton/ntoh macros interfering with the system's functions with the same name declared in `netinet/in.h`. `os.h` gets included later in this file anyway (after the inclusion of `netinet/in.h`), so removing this include does not cause any problems. X-Original-Commit: e47ad6536bc7f72b00359f196f82c6927ea62bcc --- nimble/transport/socket/src/ble_hci_socket.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nimble/transport/socket/src/ble_hci_socket.c b/nimble/transport/socket/src/ble_hci_socket.c index 951d43321..896f6e8c5 100755 --- a/nimble/transport/socket/src/ble_hci_socket.c +++ b/nimble/transport/socket/src/ble_hci_socket.c @@ -43,7 +43,6 @@ #include #include #include -#include "os/os.h" #if MYNEWT_VAL(BLE_SOCK_USE_TCP) #include