Skip to content

Commit 3c5f2c8

Browse files
Merge pull request #4251 from adamgreen/fixC++11BuildError
Fix C++11 build error w/ u-blox EVK-ODIN-W2
2 parents f2a648d + 5f13d95 commit 3c5f2c8

File tree

1 file changed

+5
-3
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/wifi_emac

1 file changed

+5
-3
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/sdk/wifi_emac/wifi_emac_api.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,11 @@ static void wifi_set_link_state_cb(emac_interface_t *emac, emac_link_state_chang
328328
emac_interface_t* wifi_emac_get_interface()
329329
{
330330
if (_intf == NULL) {
331-
_intf = new emac_interface_t();
332-
_intf->hw = NULL;
333-
memcpy((void*)&_intf->ops, &wifi_emac_interface, sizeof(wifi_emac_interface));
331+
_intf = (emac_interface_t*)malloc(sizeof(emac_interface_t));
332+
if (_intf) {
333+
_intf->hw = NULL;
334+
memcpy((void*)&_intf->ops, &wifi_emac_interface, sizeof(wifi_emac_interface));
335+
}
334336
}
335337
return _intf;
336338
}

0 commit comments

Comments
 (0)