diff --git a/nimble/host/src/ble_att.c b/nimble/host/src/ble_att.c index 8aab7f919..63d7b9571 100644 --- a/nimble/host/src/ble_att.c +++ b/nimble/host/src/ble_att.c @@ -22,6 +22,15 @@ #include "ble_hs_priv.h" #if 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 + static uint16_t ble_att_preferred_mtu_val; /** Dispatch table for incoming ATT requests. Sorted by op code. */ diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 3d0ab4d62..abae0db06 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -26,6 +26,14 @@ #include "ble_hs_priv.h" #include "ble_hs_resolv_priv.h" +#ifndef min +#define min(a, b) ((a)<(b)?(a):(b)) +#endif + +#ifndef max +#define max(a, b) ((a)>(b)?(a):(b)) +#endif + #if MYNEWT #include "bsp/bsp.h" #else diff --git a/nimble/host/src/ble_gattc.c b/nimble/host/src/ble_gattc.c index 53a947c4f..391738263 100644 --- a/nimble/host/src/ble_gattc.c +++ b/nimble/host/src/ble_gattc.c @@ -61,6 +61,15 @@ #include "ble_hs_priv.h" #if 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 + /***************************************************************************** * $definitions / declarations * *****************************************************************************/ diff --git a/nimble/host/src/ble_hs_hci_util.c b/nimble/host/src/ble_hs_hci_util.c index cba6b6b0a..2584c3ee1 100644 --- a/nimble/host/src/ble_hs_hci_util.c +++ b/nimble/host/src/ble_hs_hci_util.c @@ -22,6 +22,14 @@ #include "host/ble_hs_hci.h" #include "ble_hs_priv.h" +#ifndef min +#define min(a, b) ((a)<(b)?(a):(b)) +#endif + +#ifndef max +#define max(a, b) ((a)>(b)?(a):(b)) +#endif + uint16_t ble_hs_hci_util_handle_pb_bc_join(uint16_t handle, uint8_t pb, uint8_t bc) { diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c index 334909f82..b3ef39ead 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -51,6 +51,15 @@ #include "../store/config/src/ble_store_config_priv.h" #if 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 + #if NIMBLE_BLE_SM /** Procedure timeout; 30 seconds. */ diff --git a/porting/nimble/include/os/os.h b/porting/nimble/include/os/os.h index ec495df9b..64800956c 100644 --- a/porting/nimble/include/os/os.h +++ b/porting/nimble/include/os/os.h @@ -30,14 +30,6 @@ extern "C" { #define static_assert _Static_assert #endif -#ifndef min -#define min(a, b) ((a)<(b)?(a):(b)) -#endif - -#ifndef max -#define max(a, b) ((a)>(b)?(a):(b)) -#endif - #include "syscfg/syscfg.h" #include "nimble/nimble_npl.h" diff --git a/porting/nimble/src/os_mbuf.c b/porting/nimble/src/os_mbuf.c index 6a1b95a5b..1e88bed9d 100644 --- a/porting/nimble/src/os_mbuf.c +++ b/porting/nimble/src/os_mbuf.c @@ -41,6 +41,14 @@ #include #include +#ifndef min +#define min(a, b) ((a)<(b)?(a):(b)) +#endif + +#ifndef max +#define max(a, b) ((a)>(b)?(a):(b)) +#endif + /** * @addtogroup OSKernel * @{