Bug 690765

Summary: Make Ghostscript compile as C++ program.
Product: Ghostscript Reporter: Alex Cherepanov <alex>
Component: GeneralAssignee: wendyst2
Status: RESOLVED WONTFIX    
Severity: normal Keywords: bountiable
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: Partial patch for C++ compatibility

Description Alex Cherepanov 2009-09-14 09:37:23 UTC
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.
Comment 1 Ralph Giles 2009-09-24 10:16:03 UTC
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.
Comment 2 wendyst2 2009-11-29 19:29:28 UTC
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).
Comment 3 Alex Cherepanov 2010-08-10 04:47:33 UTC
- 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".