Excluding functions with ifndef SWIG causing wrong function to get called
"Abshire, Ian" <[email protected]> Mon, 22 Aug 2022 22:57:15 +0000
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <PR3P190MB1020D2FBDB3F53C2ECD8DEDBED719@PR3P190MB1020.EURP190.PROD.OUTLOOK.COM> |
Hello, I have some question about an issue we have encountered. We use the SWIG preprocessor definition to exclude functions in the header file that we don't want wrapped (e.g. #ifndef SWIG). The issue we found is when we surround a function we want to exclude with this block, the functions declared after that will not get called correctly from Python. Instead, some other unexpected function will get called as if there is an offset. When we move all exclusion blocks to the end of the public section of the header, the wrapped functions work as expected. We also generate a C# interface and have not seen this issue there, only Python. Is the way we are excluding functions a good practice? Is it best practice to put all functions we want excluded at the end of the header? Is this a bug or a configuration issue? I've searched through the docs, but so far have been unable to discern answers to these questions. Thank you in advance for any help or insights! Ian _______________________________________________ Swig-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/swig-user