This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 2a14c85d5 nimble/host: Fix a build warning caused by using undeclared
min function
2a14c85d5 is described below
commit 2a14c85d5a6124b8835b89a40da7afb68446c39e
Author: Guy Mishol <[email protected]>
AuthorDate: Fri Jan 3 17:05:29 2025 +0200
nimble/host: 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 a3d1b1c22..d4cb15f97 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);