diff --git a/features/FEATURE_CLIENT/mbed-client-classic/source/m2mconnectionhandlerpimpl.cpp b/features/FEATURE_CLIENT/mbed-client-classic/source/m2mconnectionhandlerpimpl.cpp index 5703d82701..2b4f5a708a 100644 --- a/features/FEATURE_CLIENT/mbed-client-classic/source/m2mconnectionhandlerpimpl.cpp +++ b/features/FEATURE_CLIENT/mbed-client-classic/source/m2mconnectionhandlerpimpl.cpp @@ -27,6 +27,7 @@ #include "eventOS_scheduler.h" #include "mbed-trace/mbed_trace.h" +#include "mbed.h" #define TRACE_GROUP "mClt" diff --git a/features/net/network-socket/Socket.cpp b/features/net/network-socket/Socket.cpp index c9be8921b1..7429144a39 100644 --- a/features/net/network-socket/Socket.cpp +++ b/features/net/network-socket/Socket.cpp @@ -15,6 +15,7 @@ */ #include "Socket.h" +#include "mbed.h" Socket::Socket() : _stack(0) diff --git a/features/net/network-socket/Socket.h b/features/net/network-socket/Socket.h index 35dfe0865b..c481930440 100644 --- a/features/net/network-socket/Socket.h +++ b/features/net/network-socket/Socket.h @@ -22,10 +22,6 @@ #include "rtos/Mutex.h" #include "Callback.h" -#ifndef NSAPI_NO_INCLUDE_MBED -#include "mbed.h" // needed for backwards compatability -#endif - /** Abstract socket class */ diff --git a/features/net/network-socket/TCPServer.cpp b/features/net/network-socket/TCPServer.cpp index 888b91b229..c3c23b0bcd 100644 --- a/features/net/network-socket/TCPServer.cpp +++ b/features/net/network-socket/TCPServer.cpp @@ -15,7 +15,7 @@ */ #include "TCPServer.h" -#include "Timer.h" +#include "mbed.h" TCPServer::TCPServer() : _pending(0), _accept_sem(0) diff --git a/features/net/network-socket/mbed_lib.json b/features/net/network-socket/mbed_lib.json new file mode 100644 index 0000000000..35edcf1017 --- /dev/null +++ b/features/net/network-socket/mbed_lib.json @@ -0,0 +1,6 @@ +{ + "name": "nsapi", + "config": { + "present": 1 + } +} diff --git a/features/net/network-socket/nsapi.h b/features/net/network-socket/nsapi.h index 35fd3a1b9f..d61fb5502c 100644 --- a/features/net/network-socket/nsapi.h +++ b/features/net/network-socket/nsapi.h @@ -21,9 +21,6 @@ // entry point for nsapi types #include "nsapi_types.h" -// disable bug-compatible mbed inclusion -#define NSAPI_NO_INCLUDE_MBED - #ifdef __cplusplus // entry point for C++ api diff --git a/hal/api/mbed.h b/hal/api/mbed.h index 3fac4c47ef..743438cf2c 100644 --- a/hal/api/mbed.h +++ b/hal/api/mbed.h @@ -22,6 +22,10 @@ #include "rtos/rtos.h" #endif +#if MBED_CONF_NSAPI_PRESENT +#include "network-socket/nsapi.h" +#endif + #include "toolchain.h" #include "platform.h"