Closed cyborgyn closed 2 years ago
Consider the following case:
class Program { static string category = "category"; }
C code generated with a call to static constructor, which is not generated:
static struct Program_STATIC_FIELDS_DECL__ /* IL2C_STATIC_FIELDS */ { IL2C_STATIC_FIELDS* pNext__; const uint16_t objRefCount__; const uint16_t valueCount__; //-------------------- objref System_String* category; } Program_STATIC_FIELDS__ = { NULL, 1, 0 }; System_String** Program_category_HANDLER__(void) { if (il2c_unlikely__(Program_STATIC_FIELDS_initializerCount__ != *il2c_initializer_count)) { Program_STATIC_FIELDS_initializerCount__ = *il2c_initializer_count; il2c_register_static_fields(&Program_STATIC_FIELDS__); Program__cctor(); } return &Program_STATIC_FIELDS__.category; }
Thus C compiler fails with Program__cctor(); is not declared.
@cyborgyn Sorry for the very delay. I understood #100 work and imported it with cherry-pick. 2cbb6f1da780acb289fb9f98d7b4adda99fd06c3
Related #98
Consider the following case:
C code generated with a call to static constructor, which is not generated:
Thus C compiler fails with Program__cctor(); is not declared.