From 336d248562c1d59f82157e6d5d8dc34eab444b23 Mon Sep 17 00:00:00 2001 From: Guy Mishol Date: Thu, 2 Jan 2025 14:56:28 +0200 Subject: [PATCH] Fix a build warning caused by using undeclared min function Use of undeclared min function causes build warning. Declare the min and max function in file ble_l2cap_coc.c --- nimble/host/src/ble_l2cap_coc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nimble/host/src/ble_l2cap_coc.c b/nimble/host/src/ble_l2cap_coc.c index a3d1b1c22d..d4cb15f971 100644 --- a/nimble/host/src/ble_l2cap_coc.c +++ b/nimble/host/src/ble_l2cap_coc.c @@ -27,6 +27,14 @@ #if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) != 0 && NIMBLE_BLE_CONNECT +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef max +#define max(a, b) ((a) > (b) ? (a) : (b)) +#endif + #define BLE_L2CAP_SDU_SIZE 2 STAILQ_HEAD(ble_l2cap_coc_srv_list, ble_l2cap_coc_srv);