Add support for constants #5
Labels
Area-Translation
Issues concerning the translation from libclang into Biohazrd
Concept-CppFeatures
Issues concerning unsupported C++ features
IE:
One consideration to be made for these types: I believe C++ guarantees that
&SomeConst
is the same across all translation units. (If not, I bet most compilers do this anyway.) Making this guarantee means we can't let the constant be a C# const since C# does not allow taking the address of a constant. (And even if it did, the address would be different.)There are essentially three ways to represent C++-style constants in C#:
NativeLibrary.GetExport
static readonly
fieldType.TypeInitializer
orRuntimeHelpers.RunClassConstructor
)RuntimeHelpers.RunModuleConstructor
I think the right solution here is C, but will revisit when I go to implement.
The text was updated successfully, but these errors were encountered: