Skip to content

Commit

Permalink
BUG: Fix names for automatic generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Dec 3, 2023
1 parent 1d1613c commit 1430109
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions srcgen/codata_constants/cpy_code.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ subroutine write_cpython_extension_declaration(fcode)
write(fcode, "(A)") ""
write(fcode, "(A)") "static PyMethodDef myMethods[] = {{ NULL, NULL, 0, NULL }};"
write(fcode, "(A)") ""
write(fcode, "(A)") 'static struct PyModuleDef codata = {PyModuleDef_HEAD_INIT, "codata", module_docstring, -1, myMethods};'
write(fcode, "(A)", advance="NO") 'static struct PyModuleDef constants = '
write(fcode, "(A)") '{PyModuleDef_HEAD_INIT, "constants", module_docstring, -1, myMethods};'
write(fcode, "(A)") ""
write(fcode, "(A)") "PyMODINIT_FUNC PyInit_codata(void){"
write(fcode, "(A)") "PyMODINIT_FUNC PyInit_constants(void){"
write(fcode, "(4X, A)") "PyObject *m;"
write(fcode, "(4X, A)") "PyObject *d;"
write(fcode, "(4X, A)") "PyObject *v;"
write(fcode, "(4X, A)") "m = PyModule_Create(&codata);"
write(fcode, "(4X, A)") "m = PyModule_Create(&constants);"
write(fcode, "(4X, A)") "d = PyModule_GetDict(m);"
write(fcode, "(A)") ""
end subroutine
Expand Down
2 changes: 1 addition & 1 deletion srcgen/codata_constants/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ program generator
open(file=fpath, newunit=fpython, status="new", action="write")

! CPYTHON
fpath = root//'pywrapper/pycodata/cpy_codata.c'
fpath = root//'pywrapper/pycodata/cpy_codata_constants.c'
inquire(file=fpath, exist=exist)
if(exist)then
open(file=fpath, newunit=unit, status="old")
Expand Down

0 comments on commit 1430109

Please sign in to comment.