Current Ghostscript code doesn't compile as C++ . Ghostscript code uses "template" and "this" as variable names. C++ also has stricter rules about type conversion. Replacement of typedef'd types with classes helps to trace the access to the type during development. Since C++ needs stricter type handling, the Ghostscript code will be cleaner.
Just a note to track shared knowledge: Henry mentioned we sometimes treat 'bool' as 'int'. I think if we're going to have a bool type, it should be treated consistently, so it works just as well with the native C++ type. Failing that, we might as well simplify things by removing it entirely and fall back to standard C practice of actually using an int for true/false states.
Created attachment 5725 [details] Partial patch for C++ compatibility The changes turned out to be quite extensive. Plus some 3rd party libraries need to be modified as well, which I am not sure is proper to do. Attached is the patch of the fixes so far. It covers the gs native source codes (in /psi and /base folders), plus the 3rd party libraries except for zlib. Please review and let me know whether it is worth finishing the changes (in my opinion it is not, because it touches too many places).
- The patch cannot be applied to the current HEAD revision. - Applying many hunks manually, reviewing the rest, and fixing new code to match the changed code is a significant effort. - Even the most trivial change in the code can have unexpected results and this number of changes guarantees new bugs without fixing any old ones. - With the changes in every subsystem, the patch need extensive review but it didn't get any review in almost a year. Therefore the bug report is resolved as "won't fix".