Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
206ce636
Commit
206ce636
authored
Oct 02, 2019
by
Guilhem Saurel
Browse files
extern "C" for the main function
parent
c4c2f5a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dynamic-graph-py.cc
View file @
206ce636
...
...
@@ -98,16 +98,21 @@ PyObject* error_out(
}
// namespace python
}
// namespace dynamicgraph
#ifdef __cplusplus
extern
"C"
{
#endif
#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC
PyInit_
dynamic_g
rap
h
(
void
)
PyMODINIT_FUNC
PyInit_
w
rap
(
void
)
#else
void
init
dynamic_g
rap
h
(
void
)
void
init
w
rap
(
void
)
#endif
{
#if PY_MAJOR_VERSION >= 3
PyObject
*
module
=
PyModule_Create
(
&
dynamicgraph
::
python
::
dynamicGraphModuleDef
);
#else
PyObject
*
module
=
Py_InitModule
(
"
dynamic_g
rap
h
"
,
dynamicgraph
::
python
::
dynamicGraphMethods
);
PyObject
*
module
=
Py_InitModule
(
"
w
rap"
,
dynamicgraph
::
python
::
dynamicGraphMethods
);
#endif
if
(
module
==
NULL
)
...
...
@@ -124,3 +129,7 @@ PyObject* error_out(
return
module
;
#endif
}
#ifdef __cplusplus
}
// extern "C"
#endif
src/dynamic-graph-py.hh
View file @
206ce636
...
...
@@ -173,7 +173,7 @@ static PyMethodDef dynamicGraphMethods[] = {
__attribute__
((
unused
))
static
struct
PyModuleDef
dynamicGraphModuleDef
=
{
PyModuleDef_HEAD_INIT
,
"
dynamic_g
rap
h
"
,
"
w
rap"
,
NULL
,
sizeof
(
struct
dynamicgraph
::
python
::
module_state
),
dynamicGraphMethods
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment