Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ static PyMethodDef FbfpgaMethods[] = {
{ NULL, NULL, 0, NULL },
};

PyMODINIT_FUNC
initfbfpgaio(void)
{
char docstr[] = "\
static char docstr[] = "\
1. hw_init():\n\
return value: True/False\n\
2. hw_release():\n\
Expand All @@ -122,5 +119,26 @@ initfbfpgaio(void)
In reading operation: data which is read from FPGA\n\
In writing operation: None\n";

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC
initfbfpgaio(void)
{
(void) Py_InitModule3("fbfpgaio", FbfpgaMethods, docstr);
}
#else
static struct PyModuleDef FbfpgaModule =
{
PyModuleDef_HEAD_INIT,
"fbfpgaio", /* name of module */
docstr,
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
FbfpgaMethods
};

PyMODINIT_FUNC
PyInit_fbfpgaio(void)
{
return PyModule_Create(&FbfpgaModule);
}
#endif