interrogate2swig.py

Things looking resolved:

  • Integration with makepanda.py works ok; this will probably help with file selection; it also means we know which module a file is associated with

New issues:

  • since we stripped out all the preprocessor symbols, this means the headerfile includes classes that shouldnt be there, and which are not visible in the headerfiles at compile time

Possible solutions:

  • run all headerfiles through the preprocessor before mashing them into the interface
  • pursuade swig to handle the #ifdefs etc for us. One issue with this is that our sorting code assumes that preprocessor directives dont matter; and handles sorting at the class level, treating what is in “class … { … };” as a unit.

Current strategy: run all headerfiles through preprocessor

  • we’ll use the compiler option to do preprocessing and add the # comments. This seems to work with both g++ and cl
  • we’ll use a parser that will strip everything from this output that didnt come from our original file
  • this will hopefully have the happy side-effect that we no longer have to consider macro expansion replacement at all
  • then we’ll put it through the grinder above

Hugh