MXS-1840 Compile all routers as C++

Minimal changes, only what is needed in order to make it compile.
This commit is contained in:
Johan Wikman
2018-05-03 15:53:17 +03:00
parent 10b2b4ac37
commit 1f6cc6db8a
39 changed files with 476 additions and 427 deletions

View File

@ -1,4 +1,4 @@
add_library(cli SHARED cli.c ../debugcli/debugcmd.c)
add_library(cli SHARED cli.cc ../debugcli/debugcmd.cc)
target_link_libraries(cli maxscale-common)
set_target_properties(cli PROPERTIES VERSION "1.0.0")
install_module(cli core)

View File

@ -65,7 +65,7 @@ static CLI_INSTANCE *instances;
*
* @return The module object
*/
MXS_MODULE* MXS_CREATE_MODULE()
extern "C" MXS_MODULE* MXS_CREATE_MODULE()
{
MXS_NOTICE("Initialise CLI router module");
spinlock_init(&instlock);
@ -122,7 +122,7 @@ createInstance(SERVICE *service, char **options)
CLI_INSTANCE *inst;
int i;
if ((inst = MXS_MALLOC(sizeof(CLI_INSTANCE))) == NULL)
if ((inst = static_cast<CLI_INSTANCE*>(MXS_MALLOC(sizeof(CLI_INSTANCE)))) == NULL)
{
return NULL;
}
@ -180,7 +180,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
session->state = SESSION_STATE_READY;
return (void *)client;
return reinterpret_cast<MXS_ROUTER_SESSION*>(client);
}
/**