Skip to content

Commit cde3907

Browse files
author
deepikabhavnani
committed
Resolve build errors with -D MBED_NO_NAMESPACE
1 parent 7960d10 commit cde3907

File tree

18 files changed

+29
-15
lines changed

18 files changed

+29
-15
lines changed

events/EventQueue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "events/mbed_events.h"
1919
#include "mbed.h"
2020

21+
using namespace events;
22+
using namespace mbed;
2123

2224
EventQueue::EventQueue(unsigned event_size, unsigned char *event_pointer) {
2325
if (!event_pointer) {

events/mbed_shared_queues.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "mbed.h"
1919

2020
using namespace events;
21+
using namespace rtos;
2122

2223
namespace mbed {
2324

features/frameworks/utest/source/utest_shim.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ utest_v1_scheduler_t utest_v1_get_scheduler()
5959
# include "mbed-hal/us_ticker_api.h"
6060
#else
6161
# include "mbed.h"
62+
using mbed::Timeout;
6263
#endif
6364

6465
// only one callback is active at any given time

features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class Nanostack::Interface : public OnboardNetworkStack::Interface, private mbed
5151
NanostackPhy &get_phy() const { return interface_phy; }
5252
int8_t interface_id;
5353
int8_t _device_id;
54-
Semaphore connect_semaphore;
54+
rtos::Semaphore connect_semaphore;
5555

56-
Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
56+
mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
5757
nsapi_connection_status_t _connect_status;
5858
bool _blocking;
5959
};

features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Nanostack::LoWPANNDInterface : public Nanostack::MeshInterface
3030
int LoWPANNDInterface::connect()
3131
{
3232
if (!_interface) {
33-
_interface = new (nothrow) Nanostack::LoWPANNDInterface(*_phy);
33+
_interface = new (std::nothrow) Nanostack::LoWPANNDInterface(*_phy);
3434
if (!_interface) {
3535
return NSAPI_ERROR_NO_MEMORY;
3636
}

features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int8_t EMACPhy::phy_register()
138138
phy.phy_tx_done_cb = NULL;
139139

140140
emac.set_memory_manager(memory_manager);
141-
emac.set_link_input_cb(callback(this, &EMACPhy::emac_phy_rx));
141+
emac.set_link_input_cb(mbed::callback(this, &EMACPhy::emac_phy_rx));
142142

143143
if (!emac.power_up()) {
144144
return -1;
@@ -183,7 +183,7 @@ nsapi_error_t Nanostack::add_ethernet_interface(EMAC &emac, bool default_if, Nan
183183
return NSAPI_ERROR_DEVICE_ERROR;
184184
}
185185

186-
single_phy = new (nothrow) EMACPhy(this->memory_manager, emac);
186+
single_phy = new (std::nothrow) EMACPhy(this->memory_manager, emac);
187187
if (!single_phy) {
188188
return NSAPI_ERROR_NO_MEMORY;
189189
}
@@ -194,7 +194,7 @@ nsapi_error_t Nanostack::add_ethernet_interface(EMAC &emac, bool default_if, Nan
194194

195195
Nanostack::EthernetInterface *interface;
196196

197-
interface = new (nothrow) Nanostack::EthernetInterface(*single_phy);
197+
interface = new (std::nothrow) Nanostack::EthernetInterface(*single_phy);
198198
if (!interface) {
199199
return NSAPI_ERROR_NO_MEMORY;
200200
}

features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ nsapi_error_t NanostackEthernetInterface::initialize(NanostackEthernetPhy *phy)
3838
return NSAPI_ERROR_PARAMETER;
3939
}
4040

41-
_interface = new (nothrow) Nanostack::EthernetInterface(*phy);
41+
_interface = new (std::nothrow) Nanostack::EthernetInterface(*phy);
4242
if (!_interface) {
4343
return NSAPI_ERROR_NO_MEMORY;
4444
}

features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Nanostack::ThreadInterface *ThreadInterface::get_interface() const
7979
int ThreadInterface::connect()
8080
{
8181
if (!_interface) {
82-
_interface = new (nothrow) Nanostack::ThreadInterface(*_phy);
82+
_interface = new (std::nothrow) Nanostack::ThreadInterface(*_phy);
8383
if (!_interface) {
8484
return NSAPI_ERROR_NO_MEMORY;
8585
}

features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include "platform/arm_hal_interrupt.h"
2424
#include <mbed_assert.h>
2525

26+
using namespace mbed;
27+
using namespace events;
28+
2629
static SingletonPtr<Timer> timer;
2730
static SingletonPtr<Timeout> timeout;
2831

features/netsocket/EMACInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include "EMACInterface.h"
18+
using namespace mbed;
1819

1920
/* Interface implementation */
2021
EMACInterface::EMACInterface(EMAC &emac, OnboardNetworkStack &stack) :

features/netsocket/EMACInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class EMACInterface : public virtual NetworkInterface
170170
char _ip_address[NSAPI_IPv6_SIZE];
171171
char _netmask[NSAPI_IPv4_SIZE];
172172
char _gateway[NSAPI_IPv4_SIZE];
173-
Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
173+
mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
174174
};
175175

176176
#endif

features/netsocket/TCPServer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "TCPServer.h"
1818
#include "mbed.h"
1919

20+
using namespace mbed;
2021
TCPServer::TCPServer()
2122
{
2223
}

features/unsupported/tests/mbed/env/test_env.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "test_env.h"
22

3+
using namespace mbed;
34
// Const strings used in test_end
45
const char* TEST_ENV_START = "start";
56
const char* TEST_ENV_SUCCESS = "success";

platform/ATCmdParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "mbed_poll.h"
2323
#include "mbed_debug.h"
2424

25+
using namespace mbed;
2526
#ifdef LF
2627
#undef LF
2728
#define LF 10

platform/FileSystemHandle.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "mbed.h"
1817
#include "FileSystemHandle.h"
1918
#include <errno.h>
2019

21-
int FileSystemHandle::open(DirHandle **dir, const char *path)
20+
namespace mbed {
21+
22+
int FileSystemHandle::open(mbed::DirHandle **dir, const char *path)
2223
{
2324
return -ENOSYS;
2425
}
@@ -47,3 +48,5 @@ int FileSystemHandle::statvfs(const char *path, struct statvfs *buf)
4748
{
4849
return -ENOSYS;
4950
}
51+
52+
} // namespace mbed

platform/mbed_wait_api_rtos.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void wait_us(int us)
4242
if ((us >= 1000) && core_util_are_interrupts_enabled()) {
4343
// Use the RTOS to wait for millisecond delays if possible
4444
sleep_manager_lock_deep_sleep();
45-
Thread::wait((uint32_t)us / 1000);
45+
rtos::Thread::wait((uint32_t)us / 1000);
4646
sleep_manager_unlock_deep_sleep();
4747
}
4848
// Use busy waiting for sub-millisecond delays, or for the whole

rtos/RtosTimer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void RtosTimer::constructor(mbed::Callback<void()> func, os_timer_type type) {
3434
osTimerAttr_t attr = { 0 };
3535
attr.cb_mem = &_obj_mem;
3636
attr.cb_size = sizeof(_obj_mem);
37-
_id = osTimerNew((void (*)(void *))Callback<void()>::thunk, type, &_function, &attr);
37+
_id = osTimerNew((void (*)(void *))mbed::Callback<void()>::thunk, type, &_function, &attr);
3838
MBED_ASSERT(_id);
3939
}
4040

rtos/Thread.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void Thread::constructor(osPriority priority,
7272
constructor(MBED_TZ_DEFAULT_ACCESS, priority, stack_size, stack_mem, name);
7373
}
7474

75-
void Thread::constructor(Callback<void()> task,
75+
void Thread::constructor(mbed::Callback<void()> task,
7676
osPriority priority, uint32_t stack_size, unsigned char *stack_mem, const char *name) {
7777
constructor(MBED_TZ_DEFAULT_ACCESS, priority, stack_size, stack_mem, name);
7878

@@ -90,7 +90,7 @@ void Thread::constructor(Callback<void()> task,
9090
}
9191
}
9292

93-
osStatus Thread::start(Callback<void()> task) {
93+
osStatus Thread::start(mbed::Callback<void()> task) {
9494
_mutex.lock();
9595

9696
if ((_tid != 0) || _finished) {

0 commit comments

Comments
 (0)