diff --git a/nimble/host/src/ble_att.c b/nimble/host/src/ble_att.c index cc7a1f115..a517bd36e 100644 --- a/nimble/host/src/ble_att.c +++ b/nimble/host/src/ble_att.c @@ -21,6 +21,14 @@ #include #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 + 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 33ad9b151..76168a1d7 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 a6e114cc2..b4731e153 100644 --- a/nimble/host/src/ble_gattc.c +++ b/nimble/host/src/ble_gattc.c @@ -60,6 +60,14 @@ #include "host/ble_gap.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 + /***************************************************************************** * $definitions / declarations * *****************************************************************************/ diff --git a/nimble/host/src/ble_hs_hci_util.c b/nimble/host/src/ble_hs_hci_util.c index 996e0fc10..ef993f390 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 8422c044f..328fdec58 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -50,6 +50,14 @@ #include "ble_hs_resolv_priv.h" #include "../store/config/src/ble_store_config_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 NIMBLE_BLE_SM /** Procedure timeout; 30 seconds. */ diff --git a/porting/nimble/include/os/os.h b/porting/nimble/include/os/os.h index f7a7ef9c5..da7427f6e 100644 --- a/porting/nimble/include/os/os.h +++ b/porting/nimble/include/os/os.h @@ -26,14 +26,6 @@ extern "C" { #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 92ea935f5..307d83bb5 100644 --- a/porting/nimble/src/os_mbuf.c +++ b/porting/nimble/src/os_mbuf.c @@ -40,6 +40,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 * @{