decompme / decomp.me

Collaborative decompilation and reverse engineering website
https://decomp.me
MIT License
367 stars 112 forks source link

Option to specify code file extension #1297

Open tomsons26 opened 1 month ago

tomsons26 commented 1 month ago

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

ethteck commented 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