Open tomsons26 opened 1 month ago
some info here: all gccs seem to accept -xc++, but we hard-code -lang c for many of the ps1 gcc compilers when we run the system c preprocessor. for c scratches, this seems necessary, at least on older GCCs. more investigation may need to be done there, but a "quick" fix is to just create additional Compilers for any case we need C++ support for these
There are compilers on decomp.me that do support C++ code but rely on file extension to determine if they should use the C++ compiler. For example, this seems to be the case for most PSX compilers. Only two 2.8.x versions have -x c++ or -language=c++ flag support.
Being able to specify the extension to use for code would probably be the simplest solution opposed to figuring out the language flags for various compiler versions. This could be a dropdown? in scratch'es Options tab with options like
.c
,.cpp