Skip to content
Snippets Groups Projects
Commit a7a47981 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Change SDK to not return shared_ptr directly

parent b08cdbe6
No related branches found
No related tags found
1 merge request!353Basic C++ and Python SDK
Pipeline #33516 passed
......@@ -17,11 +17,11 @@ static bool g_isinit = false;
#define EXTERN_DLL_EXPORT extern "C"
#endif
EXTERN_DLL_EXPORT std::shared_ptr<voltu::System> voltu_initialise()
EXTERN_DLL_EXPORT voltu::System* voltu_initialise()
{
if (!g_isinit)
{
return std::make_shared<SystemImpl>();
return new SystemImpl();
}
else
{
......
......@@ -17,7 +17,7 @@ endif()
if(WIN32)
add_definitions(-DWIN32)
set(CMAKE_GENERATOR_TOOLSET "host=x64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2 /MP4 /std:c++11 /wd4996")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2 /MP4 /std:c++14 /wd4996")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DFTL_DEBUG /Wall")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
set(OS_LIBS "")
......
......@@ -60,13 +60,13 @@ std::shared_ptr<voltu::System> voltu::instance()
if (handle)
{
std::shared_ptr<voltu::System> (*init)();
init = (std::shared_ptr<voltu::System> (*)())getFunction(handle, "voltu_initialise");
voltu::System* (*init)();
init = (voltu::System* (*)())getFunction(handle, "voltu_initialise");
if (init)
{
g_init = true;
auto instance = init();
std::shared_ptr<voltu::System> instance(init());
if (!instance)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment