Skip to content

Commit 726b405

Browse files
committed
Fix compile errors/warnings in older arduino cores.
1 parent c9dbc24 commit 726b405

File tree

7 files changed

+30
-2
lines changed

7 files changed

+30
-2
lines changed

src/nimble/nimble/host/mesh/src/cdb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include "nimble/porting/nimble/include/syscfg/syscfg.h"
8+
#if MYNEWT_VAL(BLE_MESH)
9+
710
#define BT_DBG_ENABLED MYNEWT_VAL(BLE_MESH_DEBUG_CDB)
811
#define LOG_MODULE_NAME bt_mesh_cdb
912
#include "nimble/porting/nimble/include/log/log.h"
@@ -386,3 +389,5 @@ void bt_mesh_cdb_app_key_store(const struct bt_mesh_cdb_app_key *key)
386389
}
387390
}
388391
#endif
392+
393+
#endif // MYNEWT_VAL(BLE_MESH)

src/nimble/nimble/host/src/ble_hs_hci_cmd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
#include "ble_hs_priv.h"
2929
#include "ble_monitor_priv.h"
3030
#ifdef ESP_PLATFORM
31-
#include "soc/soc_caps.h"
31+
# if defined __has_include
32+
# if __has_include ("soc/soc_caps.h")
33+
# include "soc/soc_caps.h"
34+
# endif
35+
# endif
3236
#endif
3337

3438
static int

src/nimble/nimble/host/src/ble_hs_hci_evt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ ble_hs_hci_evt_le_conn_complete(uint8_t subevent, const void *data,
435435
}
436436
#endif
437437

438+
#pragma GCC diagnostic push
439+
#pragma GCC diagnostic ignored "-Wpointer-arith"
438440
static int
439441
ble_hs_hci_evt_le_adv_rpt_first_pass(const void *data, unsigned int len)
440442
{
@@ -517,6 +519,7 @@ ble_hs_hci_evt_le_adv_rpt(uint8_t subevent, const void *data, unsigned int len)
517519

518520
return 0;
519521
}
522+
#pragma GCC diagnostic pop
520523

521524
static int
522525
ble_hs_hci_evt_le_dir_adv_rpt(uint8_t subevent, const void *data, unsigned int len)

src/nimble/nimble/host/src/ble_uuid.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ ble_uuid_to_mbuf(const ble_uuid_t *uuid, struct os_mbuf *om)
228228
return 0;
229229
}
230230

231+
#pragma GCC diagnostic push
232+
#pragma GCC diagnostic ignored "-Wpointer-arith"
231233
int
232234
ble_uuid_flat(const ble_uuid_t *uuid, void *dst)
233235
{
@@ -250,6 +252,7 @@ ble_uuid_flat(const ble_uuid_t *uuid, void *dst)
250252

251253
return 0;
252254
}
255+
#pragma GCC diagnostic pop
253256

254257
int
255258
ble_uuid_length(const ble_uuid_t *uuid)

src/nimble/porting/nimble/src/nimble_port.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030

3131
#ifdef ESP_PLATFORM
3232
#include "esp_log.h"
33-
#include "soc/soc_caps.h"
33+
# if defined __has_include
34+
# if __has_include ("soc/soc_caps.h")
35+
# include "soc/soc_caps.h"
36+
# endif
37+
# endif
3438
#endif
3539

3640
#if SOC_ESP_NIMBLE_CONTROLLER

src/nimble/porting/nimble/src/os_mbuf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ os_mbuf_len(const struct os_mbuf *om)
381381
return len;
382382
}
383383

384+
#pragma GCC diagnostic push
385+
#pragma GCC diagnostic ignored "-Wpointer-arith"
384386
int
385387
os_mbuf_append(struct os_mbuf *om, const void *data, uint16_t len)
386388
{
@@ -454,6 +456,7 @@ os_mbuf_append(struct os_mbuf *om, const void *data, uint16_t len)
454456
err:
455457
return (rc);
456458
}
459+
#pragma GCC diagnostic pop
457460

458461
int
459462
os_mbuf_appendfrom(struct os_mbuf *dst, const struct os_mbuf *src,
@@ -663,6 +666,9 @@ os_mbuf_adj(struct os_mbuf *mp, int req_len)
663666
}
664667
}
665668

669+
670+
#pragma GCC diagnostic push
671+
#pragma GCC diagnostic ignored "-Wpointer-arith"
666672
int
667673
os_mbuf_cmpf(const struct os_mbuf *om, int off, const void *data, int len)
668674
{
@@ -703,6 +709,7 @@ os_mbuf_cmpf(const struct os_mbuf *om, int off, const void *data, int len)
703709
}
704710
}
705711
}
712+
#pragma GCC diagnostic pop
706713

707714
int
708715
os_mbuf_cmpm(const struct os_mbuf *om1, uint16_t offset1,

src/nimble/porting/npl/freertos/src/npl_os_freertos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,9 @@ void npl_freertos_funcs_deinit(void)
13091309
#include "freertos/portable.h"
13101310
#include "esp_log.h"
13111311
portMUX_TYPE ble_port_mutex = portMUX_INITIALIZER_UNLOCKED;
1312+
# if CONFIG_BT_NIMBLE_USE_ESP_TIMER
13121313
static const char *TAG = "Timer";
1314+
# endif
13131315

13141316
#else
13151317
#include "nrf.h"

0 commit comments

Comments
 (0)