Hi,
I am using Nimble in ESP-IDF from a C project and GCC complains about undefined function min() (small letters).
MIN() (big letters) is used also in this file and works with C projects as it is defined in indirectly included mesh/glue.h (via mesh/mesh.h).
Please change other occurrences from min to MIN.
Hi, I am using Nimble in ESP-IDF from a C project and GCC complains about undefined function min() (small letters). MIN() (big letters) is used also in this file and works with C projects as it is defined in indirectly included mesh/glue.h (via mesh/mesh.h). Please change other occurrences from min to MIN.
---8<---
--- lpn_orig.c 2024-02-14 21:01:16.662505000 +0100 +++ lpn.c 2024-02-22 20:05:41.852456394 +0100 @@ -32,7 +32,7 @@
endif
define LPN_RECV_DELAY MYNEWT_VAL(BLE_MESH_LPN_RECV_DELAY)
-#define SCAN_LATENCY min(MYNEWT_VAL(BLE_MESH_LPN_SCAN_LATENCY), \ +#define SCAN_LATENCY MIN(MYNEWT_VAL(BLE_MESH_LPN_SCAN_LATENCY), \ LPN_RECV_DELAY)
define FRIEND_REQ_RETRY_TIMEOUT K_SECONDS(MYNEWT_VAL(BLE_MESH_LPN_RETRY_TIMEOUT))
@@ -152,12 +152,12 @@ { / If we're waiting for segment acks keep polling at high freq / if (bt_mesh_tx_in_progress()) {
return MIN(POLL_TIMEOUT_MAX(lpn), K_SECONDS(1)); }
if (lpn->poll_timeout < POLL_TIMEOUT_MAX(lpn)) { lpn->poll_timeout *= 2;
@@ -1000,7 +1000,7 @@ }
--->8---
Best regards