This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit c72c87f9452023b2fa3cf5cb979ab27e27a7142d
Author: Szymon Janc <[email protected]>
AuthorDate: Mon May 4 13:33:55 2026 +0200

    nimble/transport: Add compiler error on invalid socket type
    
    Give clear compiler error if no valid socket type is selected.
---
 nimble/transport/socket/src/ble_hci_socket.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/nimble/transport/socket/src/ble_hci_socket.c 
b/nimble/transport/socket/src/ble_hci_socket.c
index f095d173a..fb4fc75ff 100644
--- a/nimble/transport/socket/src/ble_hci_socket.c
+++ b/nimble/transport/socket/src/ble_hci_socket.c
@@ -49,9 +49,7 @@
 #include <sys/errno.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#endif
-
-#if MYNEWT_VAL_CHOICE(BLE_SOCK_TYPE, linux_blue)
+#elif MYNEWT_VAL_CHOICE(BLE_SOCK_TYPE, linux_blue)
 #include <sys/errno.h>
 #define BTPROTO_HCI       1
 #define HCI_CHANNEL_RAW          0
@@ -66,11 +64,11 @@ struct sockaddr_hci {
     unsigned short hci_dev;
     unsigned short hci_channel;
 };
-#endif
-
-#if MYNEWT_VAL_CHOICE(BLE_SOCK_TYPE, nuttx)
+#elif MYNEWT_VAL_CHOICE(BLE_SOCK_TYPE, nuttx)
 #include <errno.h>
 #include <netpacket/bluetooth.h>
+#else
+#error "Invalid HCI socket type"
 #endif
 
 #include <fcntl.h>

Reply via email to