Skip to content

Commit

Permalink
Improved pre-processing for SWIG problems
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-easterbrook committed Dec 2, 2023
1 parent 007194c commit d05306a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 1 addition & 8 deletions src/swig-0_28_0/basicio_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9978,14 +9978,7 @@ SWIGINTERN SwigPyClientData SwigPyBuiltin__Exiv2__MemIo_clientdata = {0, 0, 0, 0

static SwigPyGetSet XPathIo___dict___getset = { SwigPyObject_get___dict__, 0 };
SWIGINTERN PyGetSetDef SwigPyBuiltin__Exiv2__XPathIo_getset[] = {
{ (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)"\n"
" The extension of the temporary file which is created when getting input data\n"
" to read metadata. This file will be deleted in destructor.\n"
"\n"
" The extension of the generated file which is created when getting input data\n"
" to add or modify the metadata.\n"
"Default constructor that reads data from stdin/data uri path and writes them to the temp file.\n"
"", &XPathIo___dict___getset },
{ (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)" Default constructor that reads data from stdin/data uri path and writes them to the temp file.", &XPathIo___dict___getset },
{ NULL, NULL, NULL, NULL, NULL } /* Sentinel */
};

Expand Down
8 changes: 5 additions & 3 deletions utils/build_swig.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ def main():
with open(os.path.join(incl_dir, file), 'r') as in_file:
with open(os.path.join(dest, file), 'w') as out_file:
for line in in_file.readlines():
if 'static constexpr auto' in line:
continue
line = attr.sub('', line)
if swig_version < (4, 2, 0):
line = line.replace('static constexpr auto',
'static const char*')
if swig_version < (4, 1, 0):
line = attr.sub('', line)
out_file.write(line)
# make options list
swig_opts = ['-c++', '-python', '-builtin',
Expand Down

0 comments on commit d05306a

Please sign in to comment.