You’re hammering metadata attributes into name mangling. Another name for it is data-smuggling. I think a better approach is to create an actual purpose-built attribute/metadata system that doesn’t contaminate your symbols with a lot of junk that really gets in the way when you’re debugging.
Okay, I’ve added callback function that let you let pick out individual values and group them into a Zig enum. That should take care of the issue with unnamed enum and enum defined using #define. There’re also new callbacks for changing params and fields declared as int to enum.
Handling of invalid value has been rolled into the BasicErrorScheme. You can use the invalid_value_fn callback to specific which value represents an error. By default, return values that are pointers are handled (since null pointers are always invalid in Zig).
And void and int can now be used as the root type.