Open rmannibucau opened 3 years ago
@rmannibucau thanks for the feature request we will look into it and update the issue
There is work in progress for the OpenJDK project Panama to extract Java declarations from C header files. At this time, we do not think we will have time to implement something for the Native Image C API, but instead wait for project Panama to be done and then support Panama also in Native Image.
Feature request
Is your feature request related to a problem? Please describe. Testing the native-image library generation, I realized that writing the C binding (@CStruct, @CFunction etc) is quite bothering, long and error prone.
Describe the solution you'd like. It would be neat to have a generate in svm or graal (more than fine to install it with gu), something along:
Indeed it can require to go through some macro (this is why I used httpd as an example) and potentially visit some other imported file but the gain is huge.
Describe who do you think will benefit the most. Anyone wanting to plug in in a system written in C/C++ using java.
Describe alternatives you've considered.
(but both options creates additional cost and are harder to validate, in particular when there are some #ifdef/#ifndef blocks)