Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.measure
Commits
304bb4c3
Commit
304bb4c3
authored
Jan 21, 2014
by
André Anjos
💬
Browse files
Python 3 compatibility
parent
18217a7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
xbob/measure/main.cpp
View file @
304bb4c3
...
...
@@ -954,7 +954,7 @@ static PyObject* roc_for_far(PyObject*, PyObject* args, PyObject* kwds) {
}
static
PyMethodDef
library
_methods
[]
=
{
static
PyMethodDef
module
_methods
[]
=
{
{
s_epc_str
,
(
PyCFunction
)
epc
,
...
...
@@ -1072,10 +1072,30 @@ static PyMethodDef library_methods[] = {
{
0
}
/* Sentinel */
};
PyDoc_STRVAR
(
module_docstr
,
"Bob metrics and performance figures"
);
#if PY_VERSION_HEX >= 0x03000000
static
PyModuleDef
module_definition
=
{
PyModuleDef_HEAD_INIT
,
XBOB_EXT_MODULE_NAME
,
module_docstr
,
-
1
,
module_methods
,
0
,
0
,
0
,
0
};
#endif
PyMODINIT_FUNC
XBOB_EXT_ENTRY_NAME
(
void
)
{
PyObject
*
m
=
Py_InitModule3
(
XBOB_EXT_MODULE_NAME
,
library_methods
,
"bob::measure bindings"
);
# if PY_VERSION_HEX >= 0x03000000
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
if
(
!
m
)
return
0
;
# else
PyObject
*
m
=
Py_InitModule3
(
XBOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
if
(
!
m
)
return
;
# endif
PyModule_AddStringConstant
(
m
,
"__version__"
,
XBOB_EXT_MODULE_VERSION
);
/* imports the NumPy C-API */
...
...
@@ -1084,4 +1104,8 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
/* imports xbob.blitz C-API */
import_xbob_blitz
();
# if PY_VERSION_HEX >= 0x03000000
return
m
;
# endif
}
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