aboutsummaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-23 14:32:01 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:16 -0300
commit701466409c3c13ae4573bf73957f6a874ce5ccbf (patch)
treecc7ea48555863e12eaa30c04e0e6cbc9547c0adf /generator/cppgenerator.cpp
parentd27ed2fea367d787aa7319531d1df1bbd6739e71 (diff)
Create SHIBOKEN MODULE INIT macro.
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r--generator/cppgenerator.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index dfacb4cf2..35e9d2639 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -3940,14 +3940,8 @@ void CppGenerator::finishGeneration()
s << " /* m_clear */ 0," << endl;
s << " /* m_free */ 0" << endl;
s << "};" << endl << endl;
- s << " #define SBK_MODULE_INIT_ERROR 0" << endl;
- s << "extern \"C\" SBK_EXPORT_MODULE PyObject* PyInit_" << moduleName() << "()" << endl;
- s << "#else" << endl;
- s << " #define SBK_MODULE_INIT_ERROR" << endl;
- s << "extern \"C\" SBK_EXPORT_MODULE void init" << moduleName() << "()" << endl;
s << "#endif" << endl;
-
- s << '{' << endl;
+ s << "SBK_MODULE_INIT_FUNCTION_BEGIN(" << moduleName() << ")" << endl;
ErrorCode errorCode("SBK_MODULE_INIT_ERROR");
// module inject-code target/beginning
@@ -4056,10 +4050,7 @@ void CppGenerator::finishGeneration()
s << INDENT << "PySide::registerCleanupFunction(cleanTypesAttributes);" << endl;
}
- s << "#ifdef IS_PY3K" << endl;
- s << INDENT << "return module;" << endl;
- s << "#endif" << endl;
- s << '}' << endl << endl;
+ s << "SBK_MODULE_INIT_FUNCTION_END" << endl;
}
static ArgumentOwner getArgumentOwner(const AbstractMetaFunction* func, int argIndex)