Some of the messiness is simply just that no time has been spent on tidying up but quite a bit is from supporting older compilers and c. I do not want to throw that support out but maybe it would be worth adding some flags to dltlc and dl_context_write_type_library_c_header() that controls what features that you want and what you are going to compile the generated headers with?
for example:
Do your compiler support static_assert() or _StaticAssert()? No need to generated DL_STATIC_ASSERT().
Do your compiler/language/language-version support sized_enums? No need to generate the fallback!
Some of the messiness is simply just that no time has been spent on tidying up but quite a bit is from supporting older compilers and c. I do not want to throw that support out but maybe it would be worth adding some flags to dltlc and dl_context_write_type_library_c_header() that controls what features that you want and what you are going to compile the generated headers with?
for example: