-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
va_list type support (stdargs.h) #41
Comments
I investigated this (by the way, thank you so much for including a self contained example in the issue ❤️ ), and I think you're doing nothing wrong. If, for example, in the generated code you replace I think the problem is Crystal's LibC bindings don't define At the same time
So a workaround would be to define it (you can reopen |
Thank you for your answer ! I'm not sure that replacing If I understand it properly, I think that crystal's A way to solve this may be to add / ask for it's support in the crystal's LibC/posix binding ? |
Sorry, maybe my reply wasn't clear. I'm not proposing to replace About the LibC lib being generated with posix, I don't really know, so we can wait for him to confirm. If that's the case, maybe we can move this issue there. There's quite a lot of types that crystal_lib still doesn't support, maybe we should throw a |
We don't support You may use |
Thanks for the context info @ysbaddaden! The thing that got me is that it is explicitly listed here:
So we need to translate it to a variadic function |
I believe the VaList type is for the We can translate/map the implicit |
I see! Watching crystal_lib issues is really forcing me out of my comfort zone with C, so I really appreciate your guidance 🙇 (and your issues @olbat !). I've read a bit more about |
Sadly, not for the functions I've checked ... Anyway I think I'll leave them for now since it's not the most important functions of the library and I still have other problems to fix (such as symbols renaming/suffixing in shared libraries, I'll probably post something on the google group for this one).
Ofc: I'm working on a binding to the ICU library. If it goes well, I'll probably write a crystal wrapper too (at least for the main features since the lib is pretty big). |
@olbat Can this be closed now that we have crystal-lang/crystal#5103 ? |
Yes, I think it can be closed. I'll try to run it on the ICU binding to see how it goes :) |
Hello,
I'm trying to port a library that uses a
va_list
type (from stdargs.h) using crystal_lib.The problem is that it generates an alias to
LibC::VaList
that doesn't seems to exists in any of crystal's lib C bindings so I get anundefined constant LibC::VaList
at compile time.Example:
Am I doing something wrong ?
The text was updated successfully, but these errors were encountered: