Applying Swift macros to C types

Can one add macros to imported C types, e.g. by using __attribute__((swift_attr("@MyMacro"))) in the C header file?

This is not possible. Can you share an example of what kind of C macros you would like to import in that way? I can’t think of a case where the C macros translate nicely into Swift macros.

1 Like

Not C macros, just C types as defined in a .h file. For example, if you want to add something similar to @DictionaryStorage as demonstrated in the WWDC23 videos.