haxscramper
haxscramper
Not sure if dynlib can even work with C++, need to find more examples on this one - https://forum.nim-lang.org/t/8660 - https://forum.nim-lang.org/t/8352#53847 > I don't understand why you mix .header and...
Const is a huge PITA - I dynlib deals with the inconsistencies by generating code like (it just ignores `const`-ness of the argument) ```c typedef N_CDECL_PTR(NCSTRING, tyProc__cTCodr69cPNr9chtH7apXJYg) (NCSTRING s); Dl_4294968796_...
``` [...]/@mnim_cxx_const_main.nim.c:63:15: error: conflicting types for ‘get_cstring_link’; have ‘void(char *)’ 63 | N_CDECL(void, get_cstring_link)(NCSTRING str); | ^~~~~~~~~~~~~~~~ /home/test/.choosenim/toolchains/nim-1.6.0/lib/nimbase.h:201:44: note: in definition of macro ‘N_CDECL’ 201 | # define N_CDECL(rettype, name)...
I think this could've been trivially solved if `Const[T] {.importcpp: "const '*0".}` worked correctly, but right now it 1. Does not work (generates ` const '*0 T1_;`) 2. Implicitly promotes...
I can wrap each type twice - as a regular object and as a `const`. This approach is of course insane, since I can also have `ptr T`, `ptr ptr...
After reading https://woboq.com/blog/verdigris-qt-without-moc.html I think it would be possible to use https://github.com/woboq/verdigris approach, either directly or via additional codegen. I would need to generate c++ classes at some point anyway,...
Make wrapper analyze build environment to provide necessary information for a wrapper to function properly *or* fail - [ ] checking the existence of a C define - conditionally enable...
Need to add support for interfacing with C++ package managers, at least with conan. Tried using it in CI builds - absolutely awesome, amounts to several very simple commands and...
In addition to the API wrapper generation, it is also necessary to properly reuse all the type import maps from the dependencies. For example, libssh2 contains [a file](https://github.com/haxscramper/hlibssh2/blob/2285da912acdb7b3a7459fe5b40d4cba223e8fa5/src/hlibssh2/type_import.xml) with all...
Generated wrappers should also contain a mapping between `wrapped Cxx types` and `nim module` that needs to be imported. This is needed to allow for inter-project dependencies.