Compile load_utils.c as C++

This commit is contained in:
Johan Wikman
2017-03-23 22:06:50 +02:00
parent a095c80d24
commit 96df523ce4
3 changed files with 9 additions and 8 deletions

View File

@ -7,13 +7,14 @@ add_library(maxscale-common SHARED
config.cc
config_runtime.cc
dcb.cc
filter.cc
externcmd.cc
paths.cc
filter.cc
hashtable.cc
hint.cc
housekeeper.cc
load_utils.c log_manager.cc maxscale_pcre2.c misc.c mlist.c modutil.c monitor.c queuemanager.c query_classifier.cc poll.c random_jkiss.c resultset.c router.cc secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c skygw_utils.cc statistics.c listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c)
paths.cc
load_utils.cc
log_manager.cc maxscale_pcre2.c misc.c mlist.c modutil.c monitor.c queuemanager.c query_classifier.cc poll.c random_jkiss.c resultset.c router.cc secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c skygw_utils.cc statistics.c listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c)
if(WITH_JEMALLOC)
target_link_libraries(maxscale-common ${JEMALLOC_LIBRARIES})

View File

@ -90,7 +90,7 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
size_t realsize = size * nmemb;
struct MemoryStruct *mem = (struct MemoryStruct *)userp;
void *data = MXS_REALLOC(mem->data, mem->size + realsize + 1);
char *data = (char*)MXS_REALLOC(mem->data, mem->size + realsize + 1);
if (data == NULL)
{
@ -201,8 +201,8 @@ void *load_module(const char *module, const char *type)
return NULL;
}
void *(*entry_point)() = sym;
MXS_MODULE *mod_info = entry_point();
void *(*entry_point)() = (void *(*)())sym;
MXS_MODULE *mod_info = (MXS_MODULE*)entry_point();
if (!check_module(mod_info, type, module) ||
(mod = register_module(module, type, dlhandle, mod_info)) == NULL)
@ -730,7 +730,7 @@ do_http_post(GWBUF *buffer, void *cfg)
FEEDBACK_CONF *feedback_config = (FEEDBACK_CONF *) cfg;
/* allocate first memory chunck for httpd servr reply */
chunk.data = MXS_MALLOC(1); /* will be grown as needed by the realloc above */
chunk.data = (char*)MXS_MALLOC(1); /* will be grown as needed by the realloc above */
MXS_ABORT_IF_NULL(chunk.data);
chunk.size = 0; /* no data at this point */

View File

@ -45,7 +45,7 @@
#include <regex.h>
#include <maxscale/maxscale_test.h>
#include "../load_utils.c"
#include "../load_utils.cc"
static char* server_options[] =
{