-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sqlite binding #170
Comments
I would like to generate bindings for library which is using SQLite. So as a hack I copy pasted stdarg.h in my project and I changed the include to Then, after having performed the hack above the situation is worse because 118 errors are emitted. Thanks. |
Hi @david-bouyssie, I'll take a look at your problem tomorrow |
Would be awesome. |
I started work on sqlite bindings back in August. I just pushed my WIP branch https://github.com/scala-native/scala-native-bindgen/compare/sqlite-binding I don't remember if I got any tests working, but you could use it as a starting point. As long as you use the docker build infrastructure for generating the bindings (which might not be well documented) you shouldn't run into issues with |
Thank you so much. |
For sbt you can use the |
Hi. I have some good progress regarding SQLite bindings usage. I have however some issues with some specific C typedefs. typedef void (*sqlite3_destructor_type)(void*);
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) And I don't know how to do it manually. Do I have to define a C function pointer? But I don't figure out how the SQLite library will understand the function pointer definition. Additionally I also observed that sqlite3_win32_xxx functions and SQLITE_WIN32_XXX constants were not exported by bindgen. |
I'm surprised that the typedef is not translates. For the macro, it is supposed to handle constants, but those macros looks like black magic. 🙀 If we cannot fix this in the bindings generator, one option would be to allow some custom code to be included. |
Actually I had a short discussion with @densh on gitter. val SQLITE_STATIC = 0.cast[CFunctionPtr1[Ptr[Byte], Unit]]
val SQLITE_TRANSIENT = 1.cast[CFunctionPtr1[Ptr[Byte], Unit]] But with the tag 0.3.8 this trick doesn't seem to work. I didn't try with the latest version of the github master branch. |
Moreover I don't know why but the section named |
FYI, sqlite4s 0.1.0 is now out 😄 |
No description provided.
The text was updated successfully, but these errors were encountered: