Skip to content

Commit

Permalink
fix: src/pycryptopp/_pycryptoppmodule.cpp:42:14: error: ‘Py_InitModul…
Browse files Browse the repository at this point in the history
…e3’ was not declared in this scope
  • Loading branch information
milahu committed Jul 29, 2023
1 parent e24e0f7 commit 204e5b3
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/pycryptopp/_pycryptoppmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,28 @@ static PyMethodDef _pycryptopp_functions[] = {
{NULL, NULL, 0, NULL} /* sentinel */
};

static struct PyModuleDef _pycryptopp = {
PyModuleDef_HEAD_INIT,
// TODO "" or "_"
//"pycryptopp",
"_pycryptopp",
_pycryptopp__doc__,
-1,
_pycryptopp_functions
};

#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC
init_pycryptopp(void) {
// TODO "_" or "__"
//PyInit_pycryptopp(void) {
PyInit__pycryptopp(void) {
PyObject *module;

module = Py_InitModule3("_pycryptopp", _pycryptopp_functions, _pycryptopp__doc__);
module = PyModule_Create(&_pycryptopp);
if (!module)
return;
return NULL;

PyObject* version;

Expand All @@ -61,12 +73,14 @@ init_pycryptopp(void) {

int succ = PyModule_AddObject(module, "cryptopp_version", version);
if (succ != 0)
return;
return NULL;


init_ecdsa(module);
init_rsa(module);
init_sha256(module);
init_aes(module);
init_xsalsa20(module);

return module;
}

0 comments on commit 204e5b3

Please sign in to comment.