Skip to content

Commit b6e381b

Browse files
author
deepikabhavnani
committed
MBED_NO_GLOBAL_USING_DIRECTIVE is added to remove auto-addition of namespace
Macro guard `MBED_NO_GLOBAL_USING_DIRECTIVE` is added around namespace, to avoid polluting users namespace.
1 parent fdca1e3 commit b6e381b

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

events/mbed_events.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
#include "events/mbed_shared_queues.h"
3232

33+
#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
3334
using namespace events;
35+
#endif
3436

3537
#endif
3638

mbed.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@
102102
#include "platform/FunctionPointer.h"
103103
#include "platform/ScopedLock.h"
104104

105+
#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
105106
using namespace mbed;
106107
using namespace std;
108+
#endif
107109

108110
#endif

rtos/Mail.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
#include "platform/NonCopyable.h"
3535

36+
#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
3637
using namespace rtos;
38+
#endif
3739

3840
namespace rtos {
3941
/** \addtogroup rtos */

rtos/rtos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#include "rtos/EventFlags.h"
3939
#include "rtos/ConditionVariable.h"
4040

41+
#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
4142
using namespace rtos;
43+
#endif
4244

4345
/* Get mbed lib version number, as RTOS depends on mbed lib features
4446
like mbed_error, Callback and others.

0 commit comments

Comments
 (0)