From 81f5ed5415cab910234e09b1370b36533b332a63 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Sat, 7 May 2022 15:13:00 +0200 Subject: [PATCH] fix ngsolve loading --- ng/CMakeLists.txt | 2 +- ng/ngtcl.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 58e34e2f..3ad3d8be 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -15,7 +15,7 @@ target_sources(nglib PRIVATE onetcl.cpp) if(USE_GUI) target_sources(nggui PRIVATE - gui.cpp ngpkg.cpp demoview.cpp parallelfunc.cpp + gui.cpp ngpkg.cpp demoview.cpp parallelfunc.cpp ngtcl.cpp ) if(NOT BUILD_FOR_CONDA) diff --git a/ng/ngtcl.cpp b/ng/ngtcl.cpp index 125afa89..5706d5e6 100644 --- a/ng/ngtcl.cpp +++ b/ng/ngtcl.cpp @@ -1,9 +1,19 @@ +#include #include "../libsrc/meshing/visual_interface.hpp" -#include + +static void Impl_Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc) +{ + Tcl_SetResult(interp, result, (Tcl_FreeProc*)freeProc); +} + +static void Impl_Ng_Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc) +{ + Tcl_CreateCommand(interp, cmdName, proc, nullptr, nullptr); +} static bool dummy_init_pointers = [](){ - Ptr_Ng_Tcl_SetResult = Tcl_SetResult; - Ptr_Ng_Tcl_CreateCommand = Tcl_CreateCommand; + netgen::Ptr_Ng_Tcl_SetResult = Impl_Ng_Tcl_SetResult; + netgen::Ptr_Ng_Tcl_CreateCommand = Impl_Ng_Tcl_CreateCommand; return true; }();