From 5aea3220c84a07375718f49f60ad8f3f58ef3080 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 17 Jan 2016 19:17:00 +0100 Subject: [PATCH] + simplify porting of template module to Python3 --- src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp | 5 +---- src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp b/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp index f6721bb0d..76bb12d82 100644 --- a/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp +++ b/src/Tools/_TEMPLATE_/App/App_TEMPLATE_.cpp @@ -49,8 +49,7 @@ private: /* Python entry */ -extern "C" { -void _TEMPLATE_AppExport init_TEMPLATE_() { +PyMODINIT_FUNC init_TEMPLATE_() { // ADD YOUR CODE HERE // @@ -58,5 +57,3 @@ void _TEMPLATE_AppExport init_TEMPLATE_() { new _TEMPLATE_::Module(); Base::Console().Log("Loading _TEMPLATE_ module... done\n"); } - -} // extern "C" diff --git a/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp b/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp index 394b3f2a9..2e03a0be3 100644 --- a/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp +++ b/src/Tools/_TEMPLATE_/Gui/App_TEMPLATE_Gui.cpp @@ -55,8 +55,7 @@ private: /* Python entry */ -extern "C" { -void _TEMPLATE_GuiExport init_TEMPLATE_Gui() +PyMODINIT_FUNC init_TEMPLATE_Gui() { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); @@ -73,5 +72,3 @@ void _TEMPLATE_GuiExport init_TEMPLATE_Gui() new _TEMPLATE_Gui::Module(); Base::Console().Log("Loading GUI of _TEMPLATE_ module... done\n"); } - -} // extern "C"