c2v icon indicating copy to clipboard operation
c2v copied to clipboard

A `wrapper` commands adds `C.` prefix for method that is not actually a C method in that case

Open ArtemkaKun opened this issue 3 years ago • 2 comments

Test file (for which wrapper was generated; The Machinery header api_registry,h) -> https://pastebin.com/NF6RjVaN

Error message

api_registry.v:94:2: error: struct embedding must be declared at the beginning of the struct body
   92 |     api_registry_version fn () Tm_version_t
   93 |     set fn (&i8, Tm_version_t, voidptr, u32)
   94 |     C.remove fn (voidptr)
      |     ~~~~~~~~
   95 |     get fn (&i8, Tm_version_t) voidptr
   96 |     get_optional fn (&voidptr, &i8, Tm_version_t)

Internal vfmt error while formatting file: ./api_registry.v.
Encountered a total of: 1 errors.

ArtemkaKun avatar Jul 15 '22 20:07 ArtemkaKun

it's because remove is registered as a builtin function in c2v i'm surprised there's a C lib using remove as a function name

medvednikov avatar Jul 15 '22 20:07 medvednikov

They also have a printf method in the log.h 😅

ArtemkaKun avatar Jul 15 '22 20:07 ArtemkaKun