C++: Separate compiler option from CppDeclarationGenerator

This commit is contained in:
Katy Coe
2020-07-02 15:17:12 +02:00
parent 01519c4c29
commit 0731b380fd
2 changed files with 24 additions and 21 deletions

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Il2CppInspector.Cpp
{
public static class CppCompiler
{
public enum Type
{
BinaryFormat, // Inheritance structs use C syntax, and will automatically choose MSVC or GCC based on inferred compiler.
MSVC, // Inheritance structs are laid out assuming the MSVC compiler, which recursively includes base classes
GCC, // Inheritance structs are laid out assuming the GCC compiler, which packs members from all bases + current class together
}
public static Type GuessFromImage(IFileFormatReader image) => (image is PEReader? Type.MSVC : Type.GCC);
}
}