-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
CStruct with bitfields #43
Comments
This hasn't been implemented yet but I did check that it's possible with libtcc. It would look something like this in Cyber:
|
I see. Thanks for the response. htsFile *hts_open(const char *fn, const char *mode); where htsFile is: typedef struct htsFile {
uint32_t is_bin:1, is_write:1, is_be:1, is_cram:1, is_bgzf:1, dummy:27;
int64_t lineno;
kstring_t line;
char *fn, *fn_aux;
union {
BGZF *bgzf;
struct cram_fd *cram;
struct hFILE *hfile;
} fp;
void *state; // format specific state information
htsFormat format;
hts_idx_t *idx;
const char *fnidx;
struct sam_hdr_t *bam_header;
struct hts_filter_t *filter;
} htsFile; so I'd prefer not to specify that in cyber. In fact it can be completely opaque.
but I see:
Is there a way to do this without writing a separate shared lib containing a wrapper function that returns a |
You've set up bindLib correctly, but you called hts_open with 1 arg instead of 2. Since Cyber currently has function overloading by number of params, it say's it's missing a symbol. I'll make the error message more descriptive.
That's the intended purpose of #ptr, I think it will be renamed to #voidPtr in the near future. |
Oh, wow. Thanks for noticing this. Indeed it's working now. |
Hi, I know it's early days, but I wanted to report this in case there's already a solution. Below is a diff to your examples/{foo.c,ffi.cy} that shows the issue. In short, how to handle C structs that use bit fields?
The text was updated successfully, but these errors were encountered: